Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExported ¶
func IsExported(rField *reflect.StructField) bool
IsExported checks whether field is exported..
func IsIgnored ¶
func IsIgnored(rField *reflect.StructField, tagName string) bool
IsIgnored checks whether field is ignored..
func IsSupportedType ¶
IsSupportedType checks whether type is supported.
Types ¶
type EncoderOption ¶
EncoderOption defines option for encoder.
type FlattenMap ¶
type FlattenMap interface {
Value(key string) (value string, ok bool)
ChildrenByPrefix(prefix string) []string
}
FlattenMap provides data to fill a node.
type Node ¶
type Node struct {
Key string
Name string
Description string
FiledName string
Value reflect.Value
Children []*Node
}
Node defines struct for a field in struct.
func New ¶
func New(element interface{}, option EncoderOption) (*Node, error)
New encodes element into node.
func (*Node) FillNode ¶
func (node *Node) FillNode(flattenMap FlattenMap) error
FillNode fills data into node.
func (*Node) SerializeValue ¶
SerializeValue serializes node's value.
func (*Node) Walk ¶
func (node *Node) Walk(callback WalkCallback) error
Walk walks through node and all children.
type WalkCallback ¶
WalkCallback defines function called when walk.
Click to show internal directories.
Click to hide internal directories.