cli

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultServer

func DefaultServer(cmd *cobra.Command) (*grpc.Server, error)

DefaultServer builds a gRPC server from the given flags.

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 NewHtpasswdCommand

func NewHtpasswdCommand() *cobra.Command

NewHtpasswdCommand ...

func NewTestserverCommand

func NewTestserverCommand() *cobra.Command

NewTestserverCommand ...

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