options

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(opts *CommonOptions) *cobra.Command

Types

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

type CommonOptions

type CommonOptions struct {
	// In, Out, and Err represent the respective data streams that the command
	// may act upon. They are attached directly to any sub-process of the executed
	// command.
	In       io.Reader
	Out, Err io.Writer

	// Clients represents a factory interface that creates instances of each
	// client type. For example, to create an instance of the cloud provider
	// client interface, call the following method Clients.CloudProvider().
	Clients clients.Factory

	// Noninteractive disables the interactive mode user interface by quieting the
	// configuration prompts.
	Noninteractive bool

	// DryRun configures the command to print the actions that would be executed,
	// without executing them.
	DryRun bool

	// Timeout configures the maximum duration before timing out the execution of
	// the command.
	Timeout time.Duration

	// Verbose enables verbose logging.
	Verbose bool

	// Profile configures the name of the credentials profile to use.
	//
	// Defaults to `default`.
	Profile string

	// PprofProfile and PprofOutput enables collecting of runtime profiling data
	// for the command's process in the format expected by the pprof visualization
	// tool.
	//
	// PprofProfile configures the type of profile to capture:
	// 	- cpu
	// 	- heap
	// 	- goroutine
	// 	- threadcreate
	// 	- block
	// 	- mutex
	//
	// PprofOutput configures the path of the file to write the profile to.
	PprofProfile, PprofOutput string
}

CommonOptions contains common options and helper methods.

func NewCommonOptions

func NewCommonOptions(in io.Reader, out, err io.Writer) *CommonOptions

func (*CommonOptions) Init

func (x *CommonOptions) Init(fs *pflag.FlagSet)

func (*CommonOptions) Validate

func (x *CommonOptions) Validate() error

Jump to

Keyboard shortcuts

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