cli

package
v0.0.0-...-8f3cd9b Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Defaults

func Defaults(c *cobra.Command) *cobra.Command

Defaults applies default settings to a cobra.Command to improve the help output.

func ExitErrorf

func ExitErrorf(code ExitCode, format string, args ...interface{}) error

ExitErrorf formats and error message along with the ExitCode.

func NamespaceOrDefault

func NamespaceOrDefault(ns string) string

NamespaceOrDefault returns the namespace ns, or "default" if ns is empty.

func NewBootstrapCommand

func NewBootstrapCommand() *cobra.Command

NewBootstrapCommand returns a command that writes an Envoy bootstrap file.

func NewCreateCommand

func NewCreateCommand() *cobra.Command

NewCreateCommand ...

func NewRunCommand

func NewRunCommand() *cobra.Command

NewRunCommand returns a command that runs the controller.

Types

type ExitCode

type ExitCode int

ExitCode is a process exit code suitable for use with os.Exit.

const (
	// EX_FAIL is an exit code indicating an unspecified error.
	EX_FAIL ExitCode = 1 //nolint(golint)

	// EX_USAGE is an exit code indicating invalid invocation syntax.
	EX_USAGE ExitCode = 65 //nolint(golint)

	// EX_NOINPUT is an exit code indicating missing input data.
	EX_NOINPUT ExitCode = 66 //nolint(golint)

	// EX_DATAERR means the input data was incorrect in some
	// way.  This should only be used for user's data and not
	// system files.
	EX_DATAERR ExitCode = 65 //nolint(golint)

	// EX_CONFIG means that something was found in an unconfigured
	// or misconfigured state.
	EX_CONFIG ExitCode = 78 //nolint(golint)
)

type ExitError

type ExitError struct {
	Code ExitCode
	Err  error
}

ExitError captures an ExitCode and its associated error message.

func (ExitError) Error

func (e ExitError) Error() string

Jump to

Keyboard shortcuts

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