clioptions

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagDryRun is for --dry-run
	FlagDryRun = "dry-run"
	// FlagContext is for --context passed to kubectl
	FlagContext = "context"
	// FlagKubeConfigFile is for --kubeconfig passed to kubectl
	FlagKubeConfigFile = "kubeconfig"
	// FlagVerbosity is for --verbose
	FlagVerbosity = "verbose"
)

Variables

This section is empty.

Functions

func BindGlobalFlags

func BindGlobalFlags(v *viper.Viper, flags *pflag.FlagSet)

BindGlobalFlags binds global (reusable flags) to a particular flagset, such as from a subcommand

Types

type CommandOption

type CommandOption func(option *CommandOptions)

CommandOption is part of the functional API for creating new cobra commands

type CommandOptions

type CommandOptions struct {
	IOStreams
}

CommandOptions is part of the functional API for creating new cobra commands

type IOStreams

type IOStreams struct {
	// In think, os.Stdin
	In io.Reader
	// Out think, os.Stdout
	Out io.Writer
	// ErrOut think, os.Stderr
	ErrOut io.Writer
}

IOStreams provides the standard names for iostreams. This is useful for embedding and for unit testing. Inconsistent and different names make it hard to read and review code

func NewTestIOStreams

func NewTestIOStreams() IOStreams

NewTestIOStreams returns a valid IOStreams and in, out, errout buffers for unit tests

func NewTestIOStreamsDiscard

func NewTestIOStreamsDiscard() IOStreams

NewTestIOStreamsDiscard returns a valid IOStreams that just discards

Jump to

Keyboard shortcuts

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