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 ¶
- type ExitError
- type Runner
- type RunnerOption
- func RunnerWithCachePath(cachePath string) RunnerOption
- func RunnerWithConfigData(configData string) RunnerOption
- func RunnerWithDevelMode() RunnerOption
- func RunnerWithErrorFormat(errorFormat string) RunnerOption
- func RunnerWithJSON() RunnerOption
- func RunnerWithLogger(logger *zap.Logger) RunnerOption
- func RunnerWithProtocBinPath(protocBinPath string) RunnerOption
- func RunnerWithProtocURL(protocURL string) RunnerOption
- func RunnerWithProtocWKTPath(protocWKTPath string) RunnerOption
- func RunnerWithWalkTimeout(walkTimeout time.Duration) RunnerOption
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, document bool) error Create(args []string, pkg string) error Version() error CacheUpdate(args []string) error CacheDelete() error Files(args []string) error Compile(args []string, dryRun bool) error Gen(args []string, dryRun bool) error Lint(args []string, listAllLinters bool, listLinters bool, listAllLintGroups bool, listLintGroup string, diffLintGroups string, generateIgnores bool) error Format(args []string, overwrite, diffMode, lintMode, fix bool) error All(args []string, disableFormat, disableLint, fix bool) error GRPC(args, headers []string, address, method, data, callTimeout, connectTimeout, keepaliveTime string, stdin bool, details bool, tls bool, insecure bool, cacert string, cert string, key string, serverName string) error InspectPackages(args []string) error InspectPackageDeps(args []string, name string) error InspectPackageImporters(args []string, name string) error BreakCheck(args []string, gitBranch string, descriptorSetPath string) error BreakDescriptorSet(args []string, outputPath string) error DescriptorSet(args []string, includeImports bool, includeSourceInfo bool, outputPath string, tmp 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 RunnerWithConfigData ¶
func RunnerWithConfigData(configData string) RunnerOption
RunnerWithConfigData returns a RunnerOption that uses the given config path.
func RunnerWithDevelMode ¶
func RunnerWithDevelMode() RunnerOption
RunnerWithDevelMode returns a RunnerOption that allows devel-mode.
func RunnerWithErrorFormat ¶
func RunnerWithErrorFormat(errorFormat string) RunnerOption
RunnerWithErrorFormat returns a RunnerOption that uses the given colon-separated error format. The default is filename:line:column:message.
func RunnerWithJSON ¶
func RunnerWithJSON() RunnerOption
RunnerWithJSON returns a RunnerOption that will print failures as JSON.
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 RunnerWithProtocBinPath ¶
func RunnerWithProtocBinPath(protocBinPath string) RunnerOption
RunnerWithProtocBinPath returns a RunnerOption that uses the given protoc binary path.
func RunnerWithProtocURL ¶
func RunnerWithProtocURL(protocURL string) RunnerOption
RunnerWithProtocURL returns a RunnerOption that uses the given protoc zip file URL.
func RunnerWithProtocWKTPath ¶
func RunnerWithProtocWKTPath(protocWKTPath string) RunnerOption
RunnerWithProtocWKTPath returns a RunnerOption that uses the given path to include the well-known types.
func RunnerWithWalkTimeout ¶
func RunnerWithWalkTimeout(walkTimeout time.Duration) RunnerOption
RunnerWithWalkTimeout returns a RunnerOption that sets a given walk timeout