cli

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) TemplateName added in v0.1.3

func (req GenerateClientRequest) TemplateName() string

TemplateName translates the Language option into the name of the template we should use for generation.

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 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".

type GenerateServer

type GenerateServer struct{}

GenerateServer handles the registration and execution of the 'frodo gateway' CLI subcommand.

func (GenerateServer) Command

func (c GenerateServer) Command() *cobra.Command

Command creates the Cobra struct describing this CLI command and its options.

func (GenerateServer) Exec

func (c GenerateServer) Exec(request *GenerateServerRequest) error

Exec actually executes the parsing/generating logic creating the gateway for the given declaration.

type GenerateServerRequest

type GenerateServerRequest struct {

	// InputFileName is the service definition to parse/process (the "--service" option)
	InputFileName string
	// contains filtered or unexported fields
}

GenerateServerRequest contains all of the CLI options used in the "frodo client" command.

func (GenerateServerRequest) ToFileTemplate

func (opt GenerateServerRequest) 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".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL