cli

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStdIOStreams

func NewStdIOStreams() streams.IOStreams

NewStdIOStreams returns an IOStreams from os.Stdin, os.Stdout.

func NewZapLogger

func NewZapLogger() log.Logger

func PrintFlags

func PrintFlags(flags *pflag.FlagSet, log log.Logger)

PrintFlags logs the flags in the flag set.

func StartProfiling

func StartProfiling(profile, output string) error

StartProfiling initializes profiling for the current process.

func StopProfiling

func StopProfiling(profile, output string) error

StopProfiling stops the profiler.

Types

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.
	IOStreams streams.IOStreams

	// Log represents the common internal logger implementation.
	Log log.Logger
}

CommonOptions contains common options.

func NewCommonOptions

func NewCommonOptions(streams streams.IOStreams, log log.Logger) *CommonOptions

NewCommonOptions returns a new CommonOptions object.

func (*CommonOptions) SetIOStreams

func (o *CommonOptions) SetIOStreams(streams streams.IOStreams)

SetIOStreams sets the IOStreams.

func (*CommonOptions) SetLog

func (o *CommonOptions) SetLog(log log.Logger)

SetLog sets the Log.

Jump to

Keyboard shortcuts

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