Documentation ¶
Index ¶
- func BottomUpWalk(node Node, f func(curr Node, children []Node))
- type BoolNode
- type FloatNode
- type Int64Node
- type IntNode
- type MapNode
- type Node
- type NodeType
- type PtrNode
- type SliceNode
- type StringNode
- func (n *StringNode) Comment() string
- func (n *StringNode) Compress() Node
- func (n *StringNode) Extra() *interface{}
- func (n *StringNode) Name() string
- func (n *StringNode) String() string
- func (n *StringNode) Tag() reflect.StructTag
- func (*StringNode) Type() NodeType
- func (n *StringNode) TypeName() string
- type StructNode
- func (n *StructNode) Comment() string
- func (n *StructNode) Compress() Node
- func (n *StructNode) Extra() *interface{}
- func (n *StructNode) Name() string
- func (n *StructNode) String() string
- func (n *StructNode) Tag() reflect.StructTag
- func (*StructNode) Type() NodeType
- func (n *StructNode) TypeName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BottomUpWalk ¶
BottomUpWalk 自底向上遍历 `node`
Types ¶
type BoolNode ¶
type BoolNode struct {
// contains filtered or unexported fields
}
BoolNode bool node
type FloatNode ¶
type FloatNode struct {
// contains filtered or unexported fields
}
FloatNode float node
type Int64Node ¶
type Int64Node struct {
// contains filtered or unexported fields
}
Int64Node int64 node
type Node ¶
type Node interface { // Name node 的 field name Name() string // Comment node 的 field comment Comment() string // Type node 所属 NodeType Type() NodeType // TypeName node 类型名,e.g. int, time.Time TypeName() string // Tag node 的 field tag Tag() reflect.StructTag // String impl fmt.Stringer String() string // Extra node 中用于放置额外信息的地方,可以用于 Walk 时存放信息 Extra() *interface{} // Compress 压缩 node 中的 Ptr, // e.g. // ptr(ptr(int)) -> int Compress() Node // contains filtered or unexported methods }
Node 所有 Node struct 的公共方法
type PtrNode ¶
type PtrNode struct {
// contains filtered or unexported fields
}
PtrNode pointer node
type SliceNode ¶
type SliceNode struct {
// contains filtered or unexported fields
}
SliceNode slice node, include slice & array
type StringNode ¶
type StringNode struct {
// contains filtered or unexported fields
}
StringNode string node
func (*StringNode) Compress ¶
func (n *StringNode) Compress() Node
func (*StringNode) String ¶
func (n *StringNode) String() string
func (*StringNode) Type ¶
func (*StringNode) Type() NodeType
type StructNode ¶
type StructNode struct {
// contains filtered or unexported fields
}
StructNode struct node
func (*StructNode) Compress ¶
func (n *StructNode) Compress() Node
Compress struct compress 如果 field 是 anonymous 的,且其类型为 struct ,那么将这个 field 的子 fields , 扩展到当前 struct
func (*StructNode) String ¶
func (n *StructNode) String() string
func (*StructNode) Type ¶
func (*StructNode) Type() NodeType
Click to show internal directories.
Click to hide internal directories.