Documentation
¶
Overview ¶
配置管理. 配置文件格式支持:json, xml, toml, yaml/yml
Index ¶
- type Config
- func (c *Config) AddPath(path string) error
- func (c *Config) Close()
- func (c *Config) Get(pattern string, file ...string) interface{}
- func (c *Config) GetArray(pattern string, file ...string) []interface{}
- func (c *Config) GetBool(pattern string, file ...string) bool
- func (c *Config) GetFilePath(file ...string) string
- func (c *Config) GetFloat32(pattern string, file ...string) float32
- func (c *Config) GetFloat64(pattern string, file ...string) float64
- func (c *Config) GetInt(pattern string, file ...string) int
- func (c *Config) GetInt16(pattern string, file ...string) int16
- func (c *Config) GetInt32(pattern string, file ...string) int32
- func (c *Config) GetInt64(pattern string, file ...string) int64
- func (c *Config) GetInt8(pattern string, file ...string) int8
- func (c *Config) GetMap(pattern string, file ...string) map[string]interface{}
- func (c *Config) GetString(pattern string, file ...string) string
- func (c *Config) GetStrings(pattern string, file ...string) []string
- func (c *Config) GetUint(pattern string, file ...string) uint
- func (c *Config) GetUint16(pattern string, file ...string) uint16
- func (c *Config) GetUint32(pattern string, file ...string) uint32
- func (c *Config) GetUint64(pattern string, file ...string) uint64
- func (c *Config) GetUint8(pattern string, file ...string) uint8
- func (c *Config) Reload()
- func (c *Config) SetFileName(name string)
- func (c *Config) SetPath(path string) error
- func (c *Config) SetViolenceCheck(check bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
配置管理对象
func (*Config) GetFilePath ¶
获取指定文件的绝对路径,默认获取默认的配置文件路径
func (*Config) GetFloat32 ¶
返回指定json中的float32
func (*Config) GetFloat64 ¶
返回指定json中的float64
func (*Config) SetViolenceCheck ¶
设置是否执行层级冲突检查,当键名中存在层级符号时需要开启该特性,默认为关闭。 开启比较耗性能,也不建议允许键名中存在分隔符,最好在应用端避免这种情况。
Click to show internal directories.
Click to hide internal directories.