xreflect

package
v0.0.0-...-cb352a8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallFunction

func CallFunction(fun interface{}, args []interface{}) ([]interface{}, error)

func CallStructFunction

func CallStructFunction(s interface{}, funcName string, args []interface{}) ([]interface{}, error)

func CombineStruct

func CombineStruct(inf []interface{}) map[string]interface{}

func DumpFunction

func DumpFunction(fun interface{}) string

func DumpInterface

func DumpInterface(inf interface{}, comment string)

func FloatToStr

func FloatToStr(f float64, precise ...int) string

func GetFuncByName

func GetFuncByName(st interface{}, name string, funcType interface{}) (reflect.Value, bool)

func GetFuncInfo

func GetFuncInfo(v interface{}) (name string, file string, line int)

func GetFuncName

func GetFuncName(f interface{}) string

func GetStructField

func GetStructField(inf interface{}) []string

func GetStructFieldByName

func GetStructFieldByName(s interface{}, name string) reflect.Value

func GetStructValue

func GetStructValue(s interface{}, name string) (interface{}, error)

func IsNil

func IsNil(i interface{}) bool

func IsSameType

func IsSameType(t1, t2 reflect.Type) bool

func RecoverFunc

func RecoverFunc(file string, line int, errSave ...bool)

func ReflectFillField

func ReflectFillField(field reflect.Value, key interface{}, value interface{}) error

func ReflectFillSlice

func ReflectFillSlice(dest interface{}, source interface{}) error

func ReflectFillStruct

func ReflectFillStruct(dest interface{}, source interface{}) error

func SetStructField

func SetStructField(s interface{}, name string, value interface{})

func SetStructValue

func SetStructValue(s interface{}, name string, value interface{}) (bool, error)

func Struct2Map

func Struct2Map(inf interface{}, m map[string]interface{}) error

Types

type DynamicStruct

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

func NewDynamicStruct

func NewDynamicStruct() *DynamicStruct

func (*DynamicStruct) AddFieldByName

func (s *DynamicStruct) AddFieldByName(name string, valueType string, tag string) error

func (*DynamicStruct) AddFieldByType

func (s *DynamicStruct) AddFieldByType(name string, valueType interface{}, tag string) error

func (*DynamicStruct) AddSliceFieldByType

func (s *DynamicStruct) AddSliceFieldByType(name string, valueType reflect.Type, tag string) error

func (*DynamicStruct) New

func (s *DynamicStruct) New(input interface{}) interface{}

func (*DynamicStruct) NewSlice

func (s *DynamicStruct) NewSlice(pointer bool, input ...interface{}) interface{}

func (*DynamicStruct) Type

func (s *DynamicStruct) Type() reflect.Type

Jump to

Keyboard shortcuts

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