runner

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Copyright 2019 The Kubernetes Authors. SPDX-License-Identifier: Apache-2.0

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(newStr string, c *cobra.Command)

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

func HandleError

func HandleError(c *cobra.Command, 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