Documentation ¶
Overview ¶
Package exec brings all the functionality of Prototool together in a format easily consumable by CLI libraries. It is effectively the glue between internal/cmd and all other packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner interface { Init(args []string, uncomment bool) error Create(args []string, pkg string) error Version() error Download() error Clean() error Files(args []string) error Compile(args []string, dryRun bool) error Gen(args []string, dryRun bool) error DescriptorProto(args []string) error FieldDescriptorProto(args []string) error ServiceDescriptorProto(args []string) error Lint(args []string, listAllLinters bool, listLinters bool) error ListLintGroup(group string) error ListAllLintGroups() error Format(args []string, overwrite, diffMode, lintMode, fix bool) error BinaryToJSON(args []string) error JSONToBinary(args []string) error All(args []string, disableFormat, disableLint, fix bool) error GRPC(args, headers []string, address, method, data, callTimeout, connectTimeout, keepaliveTime string, stdin bool) error }
Runner runs commands.
The args given are the args from the command line. Each additional parameter generally refers to a command-specific flag.
type RunnerOption ¶
type RunnerOption func(*runner)
RunnerOption is an option for a new Runner.
func RunnerWithCachePath ¶
func RunnerWithCachePath(cachePath string) RunnerOption
RunnerWithCachePath returns a RunnerOption that uses the given cache path.
func RunnerWithLogger ¶
func RunnerWithLogger(logger *zap.Logger) RunnerOption
RunnerWithLogger returns a RunnerOption that uses the given logger.
The default is to use zap.NewNop().
func RunnerWithPrintFields ¶
func RunnerWithPrintFields(printFields string) RunnerOption
RunnerWithPrintFields returns a RunnerOption that uses the given colon-separated print fields. The default is filename:line:column:message.
func RunnerWithProtocURL ¶
func RunnerWithProtocURL(protocURL string) RunnerOption
RunnerWithProtocURL returns a RunnerOption that uses the given protoc zip file URL.