Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateService ¶
type CreateService struct{}
CreateService is the scaffolding command that creates a new service directory and a minimal template Go declaration file w/ your service and some sample operations.
func (CreateService) Command ¶
func (c CreateService) Command() *cobra.Command
Command creates the Cobra struct describing this CLI command and its options.
func (CreateService) Exec ¶
func (c CreateService) Exec(request *CreateServiceRequest) error
Exec creates the bare minimum code required to have a frodo-powered service. It creates a directory for the service code to live, a declaration file that contains the interface and model definitions, and a skeleton implementation. These all help establish some of the base patterns you should use when working with frodo services.
type CreateServiceRequest ¶
type CreateServiceRequest struct {
// ServiceName is the value of the --service argument.
ServiceName string
// Directory is the value of the --dir argument which defines where the new .go files will be written.
Directory string
// Force is the status of the --force flag to overwrite files if they already exist.
Force bool
// Port defines which HTTP port you want the RPC/HTTP gateway to run on by default.
Port int
}
CreateServiceRequest contains the inputs from our "frodo create" CLI command.
type GenerateClient ¶
type GenerateClient struct{}
GenerateClient handles the registration and execution of the 'frodo client' CLI subcommand.
func (GenerateClient) Command ¶
func (c GenerateClient) Command() *cobra.Command
Command creates the Cobra struct describing this CLI command and its options.
func (GenerateClient) Exec ¶
func (c GenerateClient) Exec(request *GenerateClientRequest) error
Exec takes all of the parsed CLI flags and generates the target client artifact.
type GenerateClientRequest ¶
type GenerateClientRequest struct {
// InputFileName is the service definition to parse/process (the "--service" option)
InputFileName string
// Language is the programming language for the client to generate (the "--language" option)
Language string
// contains filtered or unexported fields
}
GenerateClientRequest contains all of the CLI options used in the "frodo client" command.
func (GenerateClientRequest) ToFileTemplate ¶
func (opt GenerateClientRequest) ToFileTemplate(name string) generate.FileTemplate
ToFileTemplate constructs a new 'FileTemplate' based on the 'Template' option on this command. When it's blank, you'll get a version pointing at one of our standard templates. If it has a value, you'll get a version that looks for the template on the local file system.
The 'name' argument specifies the suffix we will use for the generated artifact. For instance, if you are generating the artifact named "client.js" for the Go service definition file "foo_service.go" then you will generate a file named "foo_service.gen.client.js".
type GenerateDocs ¶
type GenerateDocs struct{}
GenerateDocs handles the registration and execution of the 'frodo docs' CLI subcommand.
func (GenerateDocs) Command ¶
func (c GenerateDocs) Command() *cobra.Command
Command creates the Cobra struct describing this CLI command and its options.
func (GenerateDocs) Exec ¶
func (c GenerateDocs) Exec(request *GenerateDocsRequest) error
Exec takes all of the parsed CLI flags and generates the service's documentation artifact(s).
type GenerateDocsRequest ¶
type GenerateDocsRequest struct {
// InputFileName is the service definition to parse/process (the "--service" option)
InputFileName string
// contains filtered or unexported fields
}
GenerateDocsRequest contains all of the CLI options used in the "frodo docs" command.
func (GenerateDocsRequest) ToFileTemplate ¶
func (opt GenerateDocsRequest) ToFileTemplate(name string) generate.FileTemplate
ToFileTemplate constructs a new 'FileTemplate' based on the 'Template' option on this command. When it's blank, you'll get a version pointing at one of our standard templates. If it has a value, you'll get a version that looks for the template on the local file system.
The 'name' argument specifies the suffix we will use for the generated artifact. For instance, if you are generating the artifact named "client.js" for the Go service definition file "foo_service.go" then you will generate a file named "foo_service.gen.client.js".
type GenerateGateway ¶
type GenerateGateway struct{}
GenerateGateway handles the registration and execution of the 'frodo gateway' CLI subcommand.
func (GenerateGateway) Command ¶
func (c GenerateGateway) Command() *cobra.Command
Command creates the Cobra struct describing this CLI command and its options.
func (GenerateGateway) Exec ¶
func (c GenerateGateway) Exec(request *GenerateGatewayRequest) error
Exec actually executes the parsing/generating logic creating the gateway for the given declaration.
type GenerateGatewayRequest ¶
type GenerateGatewayRequest struct {
// InputFileName is the service definition to parse/process (the "--service" option)
InputFileName string
// contains filtered or unexported fields
}
GenerateGatewayRequest contains all of the CLI options used in the "frodo client" command.
func (GenerateGatewayRequest) ToFileTemplate ¶
func (opt GenerateGatewayRequest) ToFileTemplate(name string) generate.FileTemplate
ToFileTemplate constructs a new 'FileTemplate' based on the 'Template' option on this command. When it's blank, you'll get a version pointing at one of our standard templates. If it has a value, you'll get a version that looks for the template on the local file system.
The 'name' argument specifies the suffix we will use for the generated artifact. For instance, if you are generating the artifact named "client.js" for the Go service definition file "foo_service.go" then you will generate a file named "foo_service.gen.client.js".
type GenerateMock ¶
type GenerateMock struct{}
GenerateMock handles the registration and execution of the 'frodo mock' CLI subcommand.
func (GenerateMock) Command ¶
func (c GenerateMock) Command() *cobra.Command
Command creates the Cobra struct describing this CLI command and its options.
func (GenerateMock) Exec ¶
func (c GenerateMock) Exec(request *GenerateMockRequest) error
Exec takes all of the parsed CLI flags and generates the target mock service artifact.
type GenerateMockRequest ¶
type GenerateMockRequest struct {
// InputFileName is the service definition to parse/process (the "--service" option)
InputFileName string
// contains filtered or unexported fields
}
GenerateMockRequest contains all of the CLI options used in the "frodo mock" command.
func (GenerateMockRequest) ToFileTemplate ¶
func (opt GenerateMockRequest) ToFileTemplate(name string) generate.FileTemplate
ToFileTemplate constructs a new 'FileTemplate' based on the 'Template' option on this command. When it's blank, you'll get a version pointing at one of our standard templates. If it has a value, you'll get a version that looks for the template on the local file system.
The 'name' argument specifies the suffix we will use for the generated artifact. For instance, if you are generating the artifact named "client.js" for the Go service definition file "foo_service.go" then you will generate a file named "foo_service.gen.client.js".