Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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.
var StackOnError bool
StackOnError if true, will print a stack trace on failure.
Functions ¶
func ParseFieldPath ¶
ParseFieldPath parse a flag value into a field path
Types ¶
type CatRunner ¶
type CatRunner struct {
Command *cobra.Command
Ctx context.Context
Format bool
KeepAnnotations bool
Styles []string
StripComments bool
RecurseSubPackages bool
}
CatRunner contains the run function
func GetCatRunner ¶
GetCatRunner returns a command CatRunner.
func (*CatRunner) ExecuteCmd ¶
ExecuteCmd outputs the contents of a single package at pkgPath. It intentionally does NOT recurse into nested subpackages (directories containing a Kptfile). Subpackage recursion is handled by the caller (runner.ExecuteCmdOnPkgs) which invokes ExecuteCmd once per package when RecurseSubPackages is set. Callers invoking ExecuteCmd directly will only see the top-level package content; use ExecuteCmdOnPkgs for recursive traversal.
type CmdRunner ¶
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