Documentation
¶
Index ¶
- func GetUnexportedField(field reflect.Value) reflect.Value
- func SetUnexportedField(field reflect.Value, value reflect.Value)
- type FlatStruct
- func (th FlatStruct) BackFill(origin interface{}) reflect.Value
- func (th FlatStruct) BackFillInterface(origin interface{}) interface{}
- func (th FlatStruct) BackFillJson(origin interface{}) ([]byte, error)
- func (th FlatStruct) BackFillTable(origin interface{}) (data [][]string)
- func (th FlatStruct) BackFillTableInterface(origin interface{}) (data [][]interface{})
- func (th FlatStruct) PrintStruct()
- type MakeLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUnexportedField ¶
GetUnexportedField 获取结构中未导出的字段
Types ¶
type FlatStruct ¶
type FlatStruct struct { StructField []reflect.StructField // contains filtered or unexported fields }
FlatStruct flat struct
func (FlatStruct) BackFill ¶
func (th FlatStruct) BackFill(origin interface{}) reflect.Value
BackFill create new reflect.Value BackFill origin data
func (FlatStruct) BackFillInterface ¶
func (th FlatStruct) BackFillInterface(origin interface{}) interface{}
BackFillInterface BackFill interface
func (FlatStruct) BackFillJson ¶
func (th FlatStruct) BackFillJson(origin interface{}) ([]byte, error)
BackFillJson BackFill json
func (FlatStruct) BackFillTable ¶
func (th FlatStruct) BackFillTable(origin interface{}) (data [][]string)
BackFillTable BackFill table
func (FlatStruct) BackFillTableInterface ¶
func (th FlatStruct) BackFillTableInterface(origin interface{}) (data [][]interface{})
BackFillTableInterface BackFill interface table
type MakeLevel ¶
type MakeLevel struct {
// contains filtered or unexported fields
}
MakeLevel 结构体找平参数
func NewMakeLevel ¶
NewMakeLevel new make level tool
ml := NewMakeLevel("header") lf := ml.MakeLevelStruct(slice) fmt.Println(lf.BackFillJson(slice))
func (*MakeLevel) MakeLevelStruct ¶
func (th *MakeLevel) MakeLevelStruct(s interface{}) (lf FlatStruct)
MakeLevelStruct 找平结构体,只支持[]struct{} & struct{}
func (*MakeLevel) ReadStruct ¶
func (th *MakeLevel) ReadStruct(st interface{}) (sf []reflect.StructField, structRelation map[string][]string)
Click to show internal directories.
Click to hide internal directories.