Documentation
¶
Overview ¶
Package svctool implements svcmux/svcdec tools command line parsing
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator func(c context.Context, a *GeneratorArgs) error
type GeneratorArgs ¶
type GeneratorArgs struct {
PackageName string
Services []*Service
ExtraImports []Import
Out io.Writer
}
GeneratorArgs is passed to the function responsible for generating files.
type Service ¶
type Service struct {
TypeName string
Node *ast.InterfaceType
Methods []*Method
}
Service contains the result of parsing the generated code for a pRPC service.
type Tool ¶
type Tool struct {
// Name of the tool, e.g. "svcmux" or "svcdec".
Name string
// OutputFilenameSuffix is the suffix of generated file names,
// e.g. "mux" or "dec" for foo_mux.go or foo_dec.go.
OutputFilenameSuffix string
// Types are type names from the Go package defined by Dir or FileNames.
Types []string
// Output is the base name for the output file.
Output string
// Dir is a Go package's directory.
Dir string
// FileNames is a list of source files from a single Go package.
FileNames []string
}
Tool is a helper class for svcmux and svcdec.
func (*Tool) Main ¶
Main does some setup (arg parsing, logging), calls t.Run, prints any errors and exits.
func (*Tool) ParseArgs ¶
ParseArgs parses command arguments. Exits if they are invalid.
Source Files
¶
- parser.go
- tool.go
Click to show internal directories.
Click to hide internal directories.