exec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitError

type ExitError struct {
	Code    int
	Message string
}

ExitError is an error that signals to exit with a certain code.

func (*ExitError) Error

func (e *ExitError) Error() string

Error implements error.

type Runner

type Runner interface {
	Init(args []string, uncomment bool) error
	Version() error
	Download() error
	Clean() error
	Files(args []string) error
	Compile(args []string) error
	Gen(args []string) error
	DescriptorProto(args []string) error
	FieldDescriptorProto(args []string) error
	ServiceDescriptorProto(args []string) error
	ProtocCommands(args []string, genCommands bool) error
	Lint(args []string) error
	ListLinters() error
	ListAllLinters() error
	ListLintGroup(group string) error
	ListAllLintGroups() error
	Format(args []string, overwrite bool, diffMode bool, lintMode bool) error
	BinaryToJSON(args []string) error
	JSONToBinary(args []string) error
	All(args []string, disableFormat bool, disableLint bool) error
	GRPC(args []string, headers []string, callTimeout string, connectTimeout string, keepaliveTime string) error
}

Runner runs commands.

func NewRunner

func NewRunner(workDirPath string, input io.Reader, output io.Writer, options ...RunnerOption) Runner

NewRunner returns a new Runner.

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 RunnerWithDirMode

func RunnerWithDirMode() RunnerOption

RunnerWithDirMode returns a RunnerOption that will act as if the file given is the directory of the file, but only print the failures from that file.

func RunnerWithHarbormaster added in v0.2.0

func RunnerWithHarbormaster() RunnerOption

RunnerWithHarbormaster returns a RunnerOption that will print failures as Harbormaster compatible JSON.

https://secure.phabricator.com/conduit/method/harbormaster.sendmessage

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.

Jump to

Keyboard shortcuts

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