Scaffold a new gRPC router plugin
init
command scaffolds a new gRPC router plugin project with all the necessary files and directory structure.
Argument | Description |
---|---|
name | Name of the plugin |
Option | Description | Default |
---|---|---|
-p, --project <project> | The name of the project | cosmo |
-d, --directory <directory> | Directory to create the plugin in | . (current directory) |
-l, --language <language> | Programming language to use for the plugin | go |
--only-plugin | Creates only a plugin without bootstrapping a full router project | false |
src/schema.graphql
)src/main.go
, src/main_test.go
)generated/service.proto
)go.mod
)README.md
)generated/
: Contains generated Go code based on your schemabin/
: Contains compiled binaries for your plugin--only-plugin
flag. This is useful if you want to create a plugin in an existing router project.
src/schema.graphql
make generate
src/main.go
src/main_test.go
and run them with make test
make build