interfaces

package
v1.0.1001 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowVersion

func ShowVersion(name, version, buildDate, oSBuildName string)

Types

type Cli

type Cli interface {
	Init(opt Options)
	// ShowVersion - default show version
	ShowVersion()
	SetConfig(cfg interface{})
	GenerateConfig(cfg interface{}, output string)
	SetDefaultAction(callback func(ctx interface{}) (err error))
	SetCommand(subcommand []*Command)
	Run(inputs ...any) (err error)
	ParsingContext(ctx interface{}) ParsingContext
	RegisterClean(inputs ...any)
}

type Command

type Command struct {
	EnvConfigName              string
	Config                     interface{}
	Name                       string
	Description                string
	Action                     func(ctx interface{}) (err error)
	SubCommand                 []*Command
	NotExitWhenCommandNotFound bool
	DisableDefaultFlag         bool
}

type Options

type Options struct {
	Name                string
	Description         string
	Version             string
	BuildDate           string
	OSBuildName         string
	Logger              logger.Logger
	DisableDefaultFlag  bool
	ShowVersionFunction func()
}

type ParsingContext

type ParsingContext interface {
	ArgumentsFirst() (val string, err error)
}

type SecretEngine

type SecretEngine interface {
	Init() error
	GetVariableData(key string) string
	GetConfigData(key string) (res []byte, err error)
}

Jump to

Keyboard shortcuts

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