cli

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitWithError

func ExitWithError(code int, err error)

ExitWithError prints an error message and exits the application with ErrorCode: code

Types

type CLI

type CLI interface {
	Name() string
	ConfigFileName() string
	ConfigDir() string
}

func GetOrCreateCLI

func GetOrCreateCLI() CLI

GetOrCreateCLI e

type Config

type Config interface {
}

func NewConfig

func NewConfig() Config

type Contextified

type Contextified struct {
	// contains filtered or unexported fields
}

Contextified objects have explicit references to the GlobalContext, so that G can be swapped out for something else. We're going to incrementally start moving objects over to this system.

func NewContextified

func NewContextified(gc *GlobalContext) Contextified

func (Contextified) G

func (c Contextified) G() *GlobalContext

func (Contextified) GStrict

func (c Contextified) GStrict() *GlobalContext

func (*Contextified) SetGlobalContext

func (c *Contextified) SetGlobalContext(g *GlobalContext)

type Contextifier

type Contextifier interface {
	G() *GlobalContext
}

type DefaultConfigImpl

type DefaultConfigImpl struct{}

type DevEnvDir

type DevEnvDir string
const (
	SDKS      DevEnvDir = "sdks"
	Downloads DevEnvDir = "downloads"
	Lib       DevEnvDir = "lib"
	Bin       DevEnvDir = "bin"
	Tmp       DevEnvDir = "tmp"
)

func ListDevEnvDirs

func ListDevEnvDirs() []DevEnvDir

type GlobalContext

type GlobalContext struct {
	Log *logging.Log // Handles all logging
	VDL *VDebugLog   // verbose debug log

}

type StaticOption

type StaticOption func(config *staticConfig) *staticConfig

StaticOption configures an instance ofg staticConfig lazily

func DefaultStaticCliConfigOption

func DefaultStaticCliConfigOption() StaticOption

DefaultStaticCliConfigOption Configures default CliName, CliDescription and CliEnvPrefix

func DefaultStaticConfigFileOption

func DefaultStaticConfigFileOption() StaticOption

DefaultStaticConfigFileOption configures defaults for ConfigFileName and ConfigFileType

func StaticCliConfigOption

func StaticCliConfigOption(cliName, cliDescription string) StaticOption

StaticCliConfigOption Configures the CliName, CliDescription and CliEnvPrefix of this CLI application

func StaticConfigFileOption

func StaticConfigFileOption(configName, configType string) StaticOption

StaticConfigFileOption configures the ConfigFileName and ConfigFileType

type VDebugLevel

type VDebugLevel int

type VDebugLog

type VDebugLog struct {
	// contains filtered or unexported fields
}

VDebugLog is a "Verbose" debug logger; enable it if you really want spam and/or minutiae

func NewVDebugLog

func NewVDebugLog(l *logger.Logger) *VDebugLog

Jump to

Keyboard shortcuts

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