Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Get ¶
type Get interface {
// Any 根据 key 获取对应数据
Any(key string) (interface{}, error)
// C 获取配置
C(key string) (string, error)
// CB 获取配置,结果转为 bool
CB(key string) (bool, error)
// CI 获取配置,结果转为 int
CI(key string) (int, error)
// CI32 获取配置,结果转为 CI32
CI32(key string) (int32, error)
// CI64 获取配置,结果转为 int64
CI64(key string) (int64, error)
// CF32 获取配置,结果转为 float32
CF32(key string) (float32, error)
// CF64 获取配置,结果转为 float64
CF64(key string) (float64, error)
// DB 获取配置,结果转为 bool
DB(key string, def bool) bool
// DI 获取配置,结果转为 int
DI(key string, def int) int
// DI32 获取配置,结果转为 int32
DI32(key string, def int32) int32
// DI64 获取配置,结果转为 int64
DI64(key string, def int64) int64
// DF32 获取配置,结果转为 float32
DF32(key string, def float32) float32
// DF64 获取配置,结果转为 float64
DF64(key string, def float64) float64
}
Get 获取配置数据
type Load ¶
type Load interface {
// LoadJSON 从 bytes 数据中读取配置
LoadJSON(bytes []byte) error
// LoadTOML 从 bytes 数据中读取配置
LoadTOML(bytes []byte) error
// LoadYAML 从 bytes 数据中读取配置
LoadYAML(bytes []byte) error
// FileJSON 从 json 文件中读取配置
FileJSON(path string) error
// FileTOML 从 toml 文件中读取配置
FileTOML(path string) error
// FileYAML 从 yaml 文件中读取配置
FileYAML(path string) error
}
Load 加载配置文件
Click to show internal directories.
Click to hide internal directories.