Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(val string, b bool) bool
- func Data(fileName string) ini.File
- func Debug() bool
- func Float64(val string, b bool) float64
- func Init(debug bool, parser ...Parser) (err error)
- func Int(val string, b bool) int
- func Reload() error
- func SetDebug(b bool)
- func String(val string, b bool) string
- type FileParser
- type ManualParser
- type Parser
Constants ¶
View Source
const ( // v1版本 V1 = "v1" // v2版本 V2 = "v2" )
Variables ¶
View Source
var ( // 兼容旧的调用方法,不建议使用 Config = c.data // 版本号 Version = "v2.0" )
View Source
var ( // 文件没有找到的错误 ErrFileNotExist = errors.New("file not exist") )
Functions ¶
Types ¶
type FileParser ¶
FileParser 文件解析
func NewFileParser ¶
func NewFileParser(debug bool, configPath ...string) FileParser
NewFileParser 新建文件 Parser
func NewFileParserV1 ¶
func NewFileParserV1(debug bool, configPath ...string) FileParser
func NewFileParserV2 ¶
func NewFileParserV2(debug bool, configPath ...string) FileParser
新建文件Parser(v2)版本
func (FileParser) Parse ¶
func (f FileParser) Parse() (data map[string]ini.File, err error)
Parse 解析
type ManualParser ¶
type ManualParser struct {
// contains filtered or unexported fields
}
ManualParser 手动解析器
func (ManualParser) Parse ¶
func (mp ManualParser) Parse() (data map[string]ini.File, err error)
Parse 解析
func (*ManualParser) SetConfig ¶
func (mp *ManualParser) SetConfig(appName, section, key, value string)
SetConfig 设置value
func (*ManualParser) SetFile ¶
func (mp *ManualParser) SetFile(fileName string, data ini.File)
SetFile 设置file的值
func (*ManualParser) SetSection ¶
func (mp *ManualParser) SetSection(fileName, section string, data ini.Section)
SetSection 设置section的值
Click to show internal directories.
Click to hide internal directories.