makelevel

package
v0.0.0-...-2b20d3d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUnexportedField

func GetUnexportedField(field reflect.Value) reflect.Value

GetUnexportedField 获取结构中未导出的字段

func SetUnexportedField

func SetUnexportedField(field reflect.Value, value reflect.Value)

SetUnexportedField 设置结构中未导出的字段

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

func (FlatStruct) PrintStruct

func (th FlatStruct) PrintStruct()

PrintStruct print struct desc

type MakeLevel

type MakeLevel struct {
	// contains filtered or unexported fields
}

MakeLevel 结构体找平参数

func NewMakeLevel

func NewMakeLevel(tagName string) *MakeLevel

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL