Documentation ¶
Overview ¶
Package conf implements parse the taf config. Usage: After initialization, use obj.GetXXX("/taf/db<ip>") to get the corresponding data structure.
Index ¶
- Constants
- type Conf
- func (c *Conf) GetBoolWithDef(path string, defVal bool) bool
- func (c *Conf) GetDomain(path string) []string
- func (c *Conf) GetInt(path string) int
- func (c *Conf) GetInt32WithDef(path string, defVal int32) int32
- func (c *Conf) GetIntWithDef(path string, defVal int) int
- func (c *Conf) GetMap(path string) map[string]string
- func (c *Conf) GetString(path string) string
- func (c *Conf) GetStringWithDef(path string, defVal string) string
- func (c *Conf) InitFromBytes(content []byte) error
- func (c *Conf) InitFromFile(fileName string) error
- func (c *Conf) InitFromString(content string) error
- func (c *Conf) ToString() string
Constants ¶
View Source
const ( // Node shows an element is a node Node = iota // Leaf shows an element is a leaf Leaf )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct {
// contains filtered or unexported fields
}
Conf struct for parse xml-like tars config file.
func (*Conf) GetBoolWithDef ¶
GetBoolWithDef get bool value
func (*Conf) GetInt32WithDef ¶
GetInt32WithDef get int32 value
func (*Conf) GetIntWithDef ¶
GetIntWithDef returns the value as an integer for pointed path, or a default value when error happens
func (*Conf) GetStringWithDef ¶
GetStringWithDef returns the value for pointed path, or a default value when error happens
func (*Conf) InitFromBytes ¶
InitFromBytes returns error when init config from bytes
func (*Conf) InitFromFile ¶
InitFromFile returns error when init config from a file
func (*Conf) InitFromString ¶
InitFromString returns error when init config from a string
Click to show internal directories.
Click to hide internal directories.