Documentation
¶
Index ¶
- Constants
- func GetGlobalConfig() any
- func LoadAndDecode(path string, v interface{}) error
- func SetGlobalConfig(cfg any)
- type Config
- func (c Config) Decode(key string, v any) error
- func (c Config) GetBool(key string, defaultValue bool) bool
- func (c Config) GetFloat32(key string, defaultValue float32) float32
- func (c Config) GetFloat64(key string, defaultValue float64) float64
- func (c Config) GetInt(key string, defaultValue int) int
- func (c Config) GetInt32(key string, defaultValue int32) int32
- func (c Config) GetInt64(key string, defaultValue int64) int64
- func (c Config) GetString(key string, defaultValue string) string
- func (c Config) GetUint(key string, defaultValue uint) uint
- func (c Config) GetUint32(key string, defaultValue uint32) uint32
- func (c Config) GetUint64(key string, defaultValue uint64) uint64
Constants ¶
View Source
const SEPARATOR = "."
SEPARATOR 配置名称中的层级分隔符
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config map[string]yaml.Node
func (Config) GetFloat32 ¶
GetFloat32 获取指定KEY的Float32值
func (Config) GetFloat64 ¶
GetFloat64 获取指定KEY的Float64值
Click to show internal directories.
Click to hide internal directories.