Documentation ¶
Overview ¶
Author: Kernel.Huang Mail: kernelman79@gmail.com File: config.go Date: 8/9/22 1:57 PM
Author: Kernel.Huang Mail: kernelman79@gmail.com File: config.go Date: 8/9/22 1:57 PM
Index ¶
- Variables
- type TomlConfig
- func (tf *TomlConfig) AtBool() bool
- func (tf *TomlConfig) AtInt() int
- func (tf *TomlConfig) AtInt64() int64
- func (tf *TomlConfig) AtStr() string
- func (tf *TomlConfig) Fetch(key string) *TomlConfig
- func (tf *TomlConfig) Get(key string) *TomlConfig
- func (tf *TomlConfig) Got(key string) *TomlConfig
- func (tf *TomlConfig) NewStructToml(dirname string, filename string, structured interface{}) interface{}
- func (tf *TomlConfig) NewToml(dirname string, filename string) *TomlConfig
- func (tf *TomlConfig) Read(key string) *TomlConfig
- func (tf *TomlConfig) To() interface{}
- func (tf *TomlConfig) ToBool() bool
- func (tf *TomlConfig) ToInt() int
- func (tf *TomlConfig) ToInt64() int64
- func (tf *TomlConfig) ToStr() string
- func (tf *TomlConfig) Zone(key string) *TomlConfig
- type YamlConfig
Constants ¶
This section is empty.
Variables ¶
var Toml = new(TomlConfig)
var Yaml = new(YamlConfig)
Functions ¶
This section is empty.
Types ¶
type TomlConfig ¶
type TomlConfig struct { Structured interface{} // contains filtered or unexported fields }
func (*TomlConfig) AtBool ¶
func (tf *TomlConfig) AtBool() bool
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").AtBool()
func (*TomlConfig) AtInt ¶
func (tf *TomlConfig) AtInt() int
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").AtInt()
func (*TomlConfig) AtInt64 ¶
func (tf *TomlConfig) AtInt64() int64
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").AtInt64()
func (*TomlConfig) AtStr ¶
func (tf *TomlConfig) AtStr() string
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").AtStr()
func (*TomlConfig) Fetch ¶
func (tf *TomlConfig) Fetch(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Fetch("key").ToStr()
func (*TomlConfig) Get ¶
func (tf *TomlConfig) Get(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").To()
func (*TomlConfig) Got ¶
func (tf *TomlConfig) Got(key string) *TomlConfig
The Fetch function alias Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Got("key").ToStr()
func (*TomlConfig) NewStructToml ¶
func (tf *TomlConfig) NewStructToml(dirname string, filename string, structured interface{}) interface{}
Example:
var structured structuredConfig config.Toml.NewStructToml("config", "config.toml", &structured)
func (*TomlConfig) NewToml ¶
func (tf *TomlConfig) NewToml(dirname string, filename string) *TomlConfig
func (*TomlConfig) Read ¶
func (tf *TomlConfig) Read(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToStr() or ToInt()
func (*TomlConfig) To ¶
func (tf *TomlConfig) To() interface{}
*
- Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").To()
func (*TomlConfig) ToBool ¶
func (tf *TomlConfig) ToBool() bool
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToBool()
func (*TomlConfig) ToInt ¶
func (tf *TomlConfig) ToInt() int
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToInt()
func (*TomlConfig) ToInt64 ¶
func (tf *TomlConfig) ToInt64() int64
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToInt64()
func (*TomlConfig) ToStr ¶
func (tf *TomlConfig) ToStr() string
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToStr()
func (*TomlConfig) Zone ¶
func (tf *TomlConfig) Zone(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").To()
type YamlConfig ¶
type YamlConfig struct {
// contains filtered or unexported fields
}
func (*YamlConfig) NewYaml ¶
func (yc *YamlConfig) NewYaml(dirname string, filename string) *YamlConfig