cli

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cli provides the BindPlane command line client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatError added in v1.11.0

func FormatError(err error) error

FormatError takes in an error and formats it in a user friendly way

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
Package commands provides the root command and all subcommands for the bindplane-op cli
Package commands provides the root command and all subcommands for the bindplane-op cli
apply
Package apply provides the apply command, which upserts resources from a file to the store.
Package apply provides the apply command, which upserts resources from a file to the store.
copy
Package copy provides the copy command.
Package copy provides the copy command.
delete
Package delete provides the delete command, as well as subcommands for deleting specific resources and resource types.
Package delete provides the delete command, as well as subcommands for deleting specific resources and resource types.
get
Package get provides the get command, which displays one or more resources, as well as subcommands for each resource type.
Package get provides the get command, which displays one or more resources, as well as subcommands for each resource type.
initialize
Package initialize provides the initialize command, which initializes an installation.
Package initialize provides the initialize command, which initializes an installation.
install
Package install provides the install command, which installs a new agent.
Package install provides the install command, which installs a new agent.
label
Package label contains the label command.
Package label contains the label command.
profile
Package profile provides commands for managing BindPlane profile configurations.
Package profile provides commands for managing BindPlane profile configurations.
serve
Package serve provides the `serve` command for the CLI.
Package serve provides the `serve` command for the CLI.
sync
Package sync provides the sync command, which synchronizes an agent-version from github with the store.
Package sync provides the sync command, which synchronizes an agent-version from github with the store.
update
Package update contains the update command, which upgrades a specific agent
Package update contains the update command, which upgrades a specific agent
validate
Package validate provides the validate command
Package validate provides the validate command
version
Package version provides the version command, which prints the BindPlane version.
Package version provides the version command, which prints the BindPlane version.
Package flags provides functions for adding flags to CLI commands
Package flags provides functions for adding flags to CLI commands
Package printer provides an interface for printing resources, and several implementations.
Package printer provides an interface for printing resources, and several implementations.

Jump to

Keyboard shortcuts

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