Documentation
¶
Index ¶
- func Bind(bindKey, trueKey string)
- func Exsit(key string) bool
- func Get(key string) string
- func GetInt64(key string) int64
- func ImportLines(data []string) error
- func JoinClassNameAndKey(className, subKey string) (key string)
- func Set(key, value string)
- func SetDefault(key, value string)
- func ToString() string
- type Settings
- func (s *Settings) Bind(bindKey, trueKey string)
- func (s Settings) Exsit(key string) bool
- func (s Settings) Get(key string) (value string)
- func (s *Settings) GetChild(className string) (child *Settings)
- func (s Settings) GetInt64(key string) int64
- func (s *Settings) ImportLines(data []string) error
- func (s *Settings) Set(key, value string)
- func (s *Settings) SetDefault(key, value string)
- func (s Settings) ToString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶
func Bind(bindKey, trueKey string)
Bind 将bindKey与trueKey进行绑定,使bindKey单向映射为trueKey 一个trueKey可映射多个bindKey
func JoinClassNameAndKey ¶
JoinClassNameAndKey 将class_name与sub_key用标准class分隔符连接起来
Types ¶
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings 基于文本的配置管理器 忽略键名大小写 可设置键名绑定
func (*Settings) ImportLines ¶
ImportLines 从 []string 导入数据 每行应该遵从以下格式: key = value
func (*Settings) SetDefault ¶
SetDefault 设置默认值,不会覆盖既有值
Click to show internal directories.
Click to hide internal directories.