Documentation
¶
Index ¶
- Constants
- func GetBool(c Cfg, key string, def ...bool) (bool, error)
- func GetBoolDef(key string, def ...bool) (bool, error)
- func GetFloat[T types.FloatUnion](c Cfg, key string, def ...T) (T, error)
- func GetFloatDef[T types.FloatUnion](key string, def ...T) (T, error)
- func GetInt[T types.IntUnion](c Cfg, key string, def ...T) (T, error)
- func GetIntDef[T types.IntUnion](key string, def ...T) (T, error)
- func GetObj[T any](c Cfg, key string, def ...T) (T, error)
- func GetObjDef[T any](key string, def ...T) (T, error)
- func GetStr(c Cfg, key string, def ...string) (string, error)
- func GetStrDef(key string, def ...string) (string, error)
- func GetUint[T types.UintUnion](c Cfg, key string, def ...T) (T, error)
- func GetUintDef[T types.UintUnion](key string, def ...T) (T, error)
- func HasDefault() bool
- func SetDefault(cfg Cfg)
- type Cfg
- func ParseJsonDir(jsonDir string) (Cfg, error)
- func ParseJsonFile(jsonPath string) (Cfg, error)
- func ParseJsonString(jsonStr string) (Cfg, error)
- func SetDefaultFromDir(jsonDir string) (Cfg, error)
- func SetDefaultFromFile(jsonPath string) (Cfg, error)
- func SetDefaultFromStr(jsonStr string) (Cfg, error)
- func (c Cfg) GetBool(key string, def ...bool) (bool, error)
- func (c Cfg) GetFloat32(key string, def ...float32) (float32, error)
- func (c Cfg) GetFloat64(key string, def ...float64) (float64, error)
- func (c Cfg) GetInt(key string, def ...int) (int, error)
- func (c Cfg) GetInt16(key string, def ...int16) (int16, error)
- func (c Cfg) GetInt32(key string, def ...int32) (int32, error)
- func (c Cfg) GetInt64(key string, def ...int64) (int64, error)
- func (c Cfg) GetInt8(key string, def ...int8) (int8, error)
- func (c Cfg) GetMap(key string, def ...map[string]any) (map[string]any, error)
- func (c Cfg) GetObj(key string, t *any, def ...any) error
- func (c Cfg) GetStr(key string, def ...string) (string, error)
- func (c Cfg) GetUint(key string, def ...uint) (uint, error)
- func (c Cfg) GetUint16(key string, def ...uint16) (uint16, error)
- func (c Cfg) GetUint32(key string, def ...uint32) (uint32, error)
- func (c Cfg) GetUint64(key string, def ...uint64) (uint64, error)
- func (c Cfg) GetUint8(key string, def ...uint8) (uint8, error)
- func (c Cfg) Merge(another Cfg) Cfg
Constants ¶
View Source
const ( ErrCodeCfgMissing = "CFG_MISSING" ErrCodeCfgBadType = "CFG_BAD_TYPE" )
Variables ¶
This section is empty.
Functions ¶
func GetFloatDef ¶
func GetFloatDef[T types.FloatUnion](key string, def ...T) (T, error)
func HasDefault ¶
func HasDefault() bool
func SetDefault ¶
func SetDefault(cfg Cfg)
Types ¶
type Cfg ¶
func ParseJsonDir ¶
func ParseJsonFile ¶
func ParseJsonString ¶
func SetDefaultFromDir ¶
func SetDefaultFromFile ¶
func SetDefaultFromStr ¶
Click to show internal directories.
Click to hide internal directories.