import "go.chromium.org/luci/grpc/internal/svctool"
Package svctool implements svcmux/svcdec tools command line parsing
type Generator func(c context.Context, a *GeneratorArgs) error
type GeneratorArgs struct { PackageName string Services []*Service ExtraImports []Import Out io.Writer }
GeneratorArgs is passed to the function responsible for generating files.
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 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.
Main does some setup (arg parsing, logging), calls t.Run, prints any errors and exits.
ParseArgs parses command arguments. Exits if they are invalid.
Run parses Go files and generates a new file using f.
Package svctool imports 18 packages (graph) and is imported by 4 packages. Updated 2021-01-21. Refresh now. Tools for package owners.