cli

package
v0.0.0-...-a3b524e Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceFlag = "trace"
)

Variables

This section is empty.

Functions

func DefaultLogLevel

func DefaultLogLevel() int

Types

type BaseConfig

type BaseConfig struct {
	// Output level for logging
	LogLevel int `mapstructure:"log_level"`
}

func DefaultBaseConfig

func DefaultBaseConfig() BaseConfig

type Config

type Config struct {
	// Top level options use an anonymous struct
	BaseConfig `mapstructure:",squash"`
}

func DefaultConfig

func DefaultConfig() *Config

type Executable

type Executable interface {
	Execute() error
}

type Executor

type Executor struct {
	*cobra.Command
	Exit func(int) // this is os.Exit by default, override in tests
}

func PrepareBaseCmd

func PrepareBaseCmd(cmd *cobra.Command) Executor

func (Executor) Execute

func (e Executor) Execute() error

type ExitCoder

type ExitCoder interface {
	ExitCode() int
}

Jump to

Keyboard shortcuts

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