cli

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindPlane

type BindPlane struct {
	Config *common.Config

	// ProfileName represents the name of the current profile in use. If empty, either a --config flag is being used or
	// there is no current profile name. This is set during initialization in root.go.
	ProfileName string

	// ConfigFile is the path to the configuration file in use. This is either the value of the --config flag or the
	// config file based on the current profile. It will be empty if there is no --config flag or current profile.
	ConfigFile string
	// contains filtered or unexported fields
}

BindPlane is an instance of the BindPlane command line client

func NewBindPlane

func NewBindPlane(config *common.Config, writer io.Writer) *BindPlane

NewBindPlane TODO(doc)

func NewBindPlaneForTesting

func NewBindPlaneForTesting() *BindPlane

NewBindPlaneForTesting is primarily used for testing and sets an empty config, the writer to Stdout, and a nop logger.

func (*BindPlane) AddShutdownHook

func (i *BindPlane) AddShutdownHook(hook ShutdownHook)

AddShutdownHook adds a hook to be called at shutdown. It is expected to be used during initialization and is not safe to call from multiple goroutines. Shutdown hooks will be called on shutdown in the order that they were added (i.e. FIFO).

func (*BindPlane) Client

func (i *BindPlane) Client() (client.BindPlane, error)

Client initializes and returns the client. The client will be initialized once.

func (*BindPlane) LogLevel

func (i *BindPlane) LogLevel() zapcore.Level

LogLevel returns the zapcore.Level that will used to initialize the logger. For Production, we use zapcore.InfoLevel. Test and Development both use zapcore.DebugLevel.

func (*BindPlane) Logger

func (i *BindPlane) Logger() *zap.Logger

Logger returns a logger that can be used for logging

func (*BindPlane) Printer

func (i *BindPlane) Printer() printer.Printer

Printer initializes and returns the printer. The printer will be initialized once.

func (*BindPlane) SetClient

func (i *BindPlane) SetClient(client client.BindPlane)

SetClient will set the client used by the BindPlane client. Primarily used for testing.

func (*BindPlane) Shutdown

func (i *BindPlane) Shutdown()

Shutdown will be called when the command completes

type ShutdownHook

type ShutdownHook func()

ShutdownHook is called at shutdown when added using AddShutdownHook

Directories

Path Synopsis
get

Jump to

Keyboard shortcuts

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