Help us shape the future of Go! Take the 2026 Go Developer Survey

interfaces

package
v1.0.1002 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 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()
	GetVersion() (ver *Version)
	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)
}

type Version added in v1.0.1002

type Version struct {
	Name            string `json:"name"`
	Version         string `json:"version"`
	BuildDate       string `json:"build_date"`
	OSBuildName     string `json:"os_build_name"`
	RuntimeVersion  string `json:"runtime_version"`
	RuntimeOS       string `json:"runtime_os"`
	RuntimeArch     string `json:"runtime_arch"`
	RuntimeCompiler string `json:"runtime_compiler"`
	RunningOn       string `json:"running_on"`
}

func GetVersion added in v1.0.1002

func GetVersion(name, version, buildDate, oSBuildName string) (ver *Version)

Jump to

Keyboard shortcuts

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