runner

package
v1.0.0-beta.8 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExitOnError bool

ExitOnError if true, will cause commands to call os.Exit instead of returning an error. Used for skipping printing usage on failure.

View Source
var StackOnError bool

StackOnError if true, will print a stack trace on failure.

Functions

func FixDocs

func FixDocs(new string, c *cobra.Command)

FixDocs replaces instances of old with new in the docs for c

func HandleError

func HandleError(ctx context.Context, err error) error

func ParseFieldPath

func ParseFieldPath(path string) ([]string, error)

ParseFieldPath parse a flag value into a field path

Types

type CmdRunner

type CmdRunner interface {
	ExecuteCmd(w io.Writer, pkgPath string) error
}

CmdRunner interface holds ExecuteCmd definition which executes respective command's implementation on single package

type ExecuteCmdOnPkgs

type ExecuteCmdOnPkgs struct {
	RootPkgPath        string
	RecurseSubPackages bool
	NeedOpenAPI        bool
	CmdRunner          CmdRunner
	Writer             io.Writer
	SkipPkgPathPrint   bool
}

ExecuteCmdOnPkgs struct holds the parameters necessary to execute the filter command on packages in rootPkgPath

func (ExecuteCmdOnPkgs) Execute

func (e ExecuteCmdOnPkgs) Execute() error

ExecuteCmdOnPkgs takes the function definition for a command to be executed on single package, applies that definition recursively on all the subpackages present in rootPkgPath if recurseSubPackages is true, else applies the command on rootPkgPath only

Jump to

Keyboard shortcuts

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