config

package
v0.0.0-...-8122643 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeEmpty      = ""
	TypeBool       = "bool"
	TypeInt        = "int"
	TypeIntList    = "int_list"
	TypeFloat      = "float"
	TypeFloatList  = "float_list"
	TypeString     = "string"
	TypeStringList = "string_list"
)

Variables

This section is empty.

Functions

func LoadArgs

func LoadArgs(cfg Config, args []string) error

Types

type Config

type Config interface {
	Get(key string) interface{}
	GetString(key string) string
	GetBool(key string) bool
	GetInt(key string) int
	GetInt32(key string) int32
	GetInt64(key string) int64
	GetUint(key string) uint
	GetUint32(key string) uint32
	GetUint64(key string) uint64
	GetFloat64(key string) float64
	GetIntSlice(key string) []int
	GetStringSlice(key string) []string
	GetFloat64Slice(key string) []float64
	GetStringMapString(key string) map[string]string

	SetDefault(key string, value interface{})
	Set(key string, value interface{})

	IsSet(key string) bool

	AllKeys() []string

	Rebuild() error
	ToString() string
}

type WithCfg

type WithCfg interface {
	Cfg() Config
}

type WithCfgBase

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

func (*WithCfgBase) Cfg

func (w *WithCfgBase) Cfg() Config

func (*WithCfgBase) SetCfg

func (w *WithCfgBase) SetCfg(cfg Config)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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