Documentation ¶
Index ¶
- func AppendStructFiledSlice(data interface{}, field string, val interface{}) error
- func BuildTree(data []interface{}) ([]interface{}, error)
- func BuildTreeProcess(data []interface{}, curLevel []interface{}) error
- func BuildTreeWithRoot(data []interface{}, rootNode interface{}, mode int) ([]interface{}, error)
- func GetStructField(data interface{}, field string) interface{}
- func SetStructField(data interface{}, field string, val interface{}) error
- type BasicTree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendStructFiledSlice ¶
func BuildTreeProcess ¶
func BuildTreeProcess(data []interface{}, curLevel []interface{}) error
func BuildTreeWithRoot ¶
data 必须为指针数组 rootNode 必须为指针 mode:
1 : 自动增加根节点, 并且是一棵树. 即跟节点之外的节点都是跟节点的孩子 2 : 自动增加根节点, 但是多棵树, 跟节点下没有孩子,默认跟第一级同级
func GetStructField ¶
func GetStructField(data interface{}, field string) interface{}
func SetStructField ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.