Documentation ¶
Index ¶
- Constants
- func Marshal(a interface{}) (data []byte, err error)
- func Unmarshal(data []byte, v interface{}) error
- type FormatError
- type InvalidNodeTypeError
- type Node
- func (n *Node) Bool() (b bool, err error)
- func (n *Node) Child(name string) (child *Node, ok bool)
- func (n *Node) ChildBool(name string) bool
- func (n *Node) ChildBoolOrDefault(name string, defaultValue bool) bool
- func (n *Node) ChildFloat(name string) float64
- func (n *Node) ChildFloatOrDefault(name string, defaultValue float64) float64
- func (n *Node) ChildFold(name string) (child *Node, ok bool)
- func (n *Node) ChildInt(name string) int64
- func (n *Node) ChildIntOrDefault(name string, defaultValue int64) int64
- func (n *Node) ChildString(name string) string
- func (n *Node) ChildStringOrDefault(name string, defaultValue string) string
- func (n *Node) ChildUint(name string) uint64
- func (n *Node) ChildUintOrDefault(name string, defaultValue uint64) uint64
- func (n *Node) Dump() string
- func (n *Node) Float() (f float64, err error)
- func (n *Node) Int() (i int64, err error)
- func (n *Node) Map() (data map[string]string, err error)
- func (n *Node) MustChild(name string) *Node
- func (n *Node) Query(path string) (child *Node, ok bool)
- func (n *Node) Slice() (data []string, err error)
- func (n *Node) String() (s string, err error)
- func (n *Node) Uint() (i uint64, err error)
- func (n *Node) Value(a interface{}) (err error)
- type NodeNotExistsError
Constants ¶
View Source
const ( NodeNone = iota NodeLiteral NodeHash NodeList )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FormatError ¶
type FormatError struct {
Message string
}
func (*FormatError) Error ¶
func (e *FormatError) Error() string
type InvalidNodeTypeError ¶
type InvalidNodeTypeError struct {
NodeType int
}
func (*InvalidNodeTypeError) Error ¶
func (e *InvalidNodeTypeError) Error() string
type Node ¶
Node
func ParseFile ¶
ParseFile parse a file, remove any line start with #(comments), add {\} auto at begin and end
func (*Node) ChildBoolOrDefault ¶
ChildBoolOrDefault return child value as bool, return defaultValue if child doesn't exist
func (*Node) ChildFloat ¶
ChildFloat return child value as float64
func (*Node) ChildFloatOrDefault ¶
ChildFloatOrDefault return child value as float64, return defaultValue if child doesn't exist
func (*Node) ChildIntOrDefault ¶
ChildIntOrDefault return child value as int64, return defaultValue if child doesn't exist
func (*Node) ChildString ¶
ChildString return child value as string
func (*Node) ChildStringOrDefault ¶
ChildStringOrDefault return child value as string, return defaultValue if child doesn't exist
func (*Node) ChildUintOrDefault ¶
ChildUintOrDefault return child value as uint64, return defaultValue if child doesn't exist
type NodeNotExistsError ¶
type NodeNotExistsError struct {
Name string
}
func (*NodeNotExistsError) Error ¶
func (e *NodeNotExistsError) Error() string
Click to show internal directories.
Click to hide internal directories.