Documentation
¶
Index ¶
- func GetConfStrByLine(line string) (itemk, itemv string)
- type Conf
- func (cf *Conf) AddComment(title string, comment ...string)
- func (cf *Conf) BoolVar(pval *bool, name string, defval bool, title string, usage ...string)
- func (cf Conf) DefaultString() string
- func (cf *Conf) Float64Var(pval *float64, name string, defval float64, title string, usage ...string)
- func (cf *Conf) IntListVar(pval *[]int, name string, defval []int, title string, usage ...string)
- func (cf *Conf) IntVar(pval *int, name string, defval int, title string, usage ...string)
- func (cf *Conf) Parse() error
- func (cf *Conf) SetItemVarByEnv() error
- func (cf Conf) String() string
- func (cf *Conf) StringListVar(pval *[]string, name string, defval []string, title string, usage ...string)
- func (cf *Conf) StringVar(pval *string, name string, defval, title string, usage ...string)
- func (cf *Conf) UpdateFile(fpath string) error
- type ConfItem
- type JsonConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfStrByLine ¶
Types ¶
type Conf ¶
type Conf struct {
// contains filtered or unexported fields
}
func (*Conf) AddComment ¶
func (*Conf) Float64Var ¶
func (*Conf) IntListVar ¶
func (*Conf) SetItemVarByEnv ¶ added in v1.1.1
SetItemVarByEnv 从操作系统的环境变量获取配置
func (*Conf) StringListVar ¶
func (*Conf) UpdateFile ¶
type JsonConf ¶ added in v1.1.3
type JsonConf struct {
// contains filtered or unexported fields
}
JsonConf 以 JSON 文件格式保存和读取配置
func NewJsonConf ¶ added in v1.1.3
NewJsonConf 创建 JsonConf 实例,dirPath 为配置文件存放目录
Source Files
¶
Click to show internal directories.
Click to hide internal directories.