safe_reflectv3

package
v1.2.44 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MapElemType = "~map_elem_r_type~"

Variables

Functions

func Any

func Any(rv reflect.Value) any

func Anys

func Anys(rv []reflect.Value) []any

func ZeroValue

func ZeroValue() reflect.Value

Types

type ETv

type ETv struct {
	Tv
	*FieldOmit
}

func (*ETv) OmitRead

func (etv *ETv) OmitRead(s ...string) *ETv

func (*ETv) OmitReadByTag2

func (etv *ETv) OmitReadByTag2(tagKey, valKey, valVal string) *ETv

func (*ETv) OmitWrite

func (etv *ETv) OmitWrite(s ...string) *ETv

func (*ETv) StructFields

func (etv *ETv) StructFields() Fields

type FieldOmit

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

func NewFieldOmit

func NewFieldOmit() *FieldOmit

type Fields

type Fields map[string]reflect.StructField

type MapKeyValue

type MapKeyValue struct {
	Key   reflect.Value
	Value reflect.Value
}

type MetaElemCate

type MetaElemCate int8

type T

type T struct {
	reflect.Type
}

func NewT

func NewT(i any) T

func WrapT

func WrapT(rt reflect.Type) T

func (T) ArrayStructFields

func (t T) ArrayStructFields() Fields

func (T) ArrayStructTags

func (t T) ArrayStructTags(tagKey string) Tags

func (T) ArrayStructTypes

func (t T) ArrayStructTypes() Types

func (T) CanElem

func (t T) CanElem() bool

func (T) CanSet

func (t T) CanSet(st reflect.Type) bool

func (T) FieldType

func (t T) FieldType() Types

func (T) Indirect

func (t T) Indirect() T

func (T) MapElemType

func (t T) MapElemType() reflect.Type

func (T) SliceStructFields

func (t T) SliceStructFields() Fields

func (T) SliceStructTags

func (t T) SliceStructTags(tagKey string) Tags

func (T) SliceStructTypes

func (t T) SliceStructTypes() Types

func (T) StructFields

func (t T) StructFields() Fields

func (T) StructTags

func (t T) StructTags(tagKey string) Tags

func (T) StructTypes

func (t T) StructTypes() Types

func (T) Tag1

func (t T) Tag1(tagKey string) map[string]string

func (T) Tag2

func (t T) Tag2(tagKey, valKey string) map[string]string

func (T) Tag2VName

func (t T) Tag2VName(tagKey, valKey string) map[string]string

func (T) Tags

func (t T) Tags(tagKey string) (tags Tags)

type Tag

type Tag map[string]string

type Tags

type Tags map[string]Tag

type Tv

type Tv struct {
	T
	V
}

func Direct

func Direct(i any) Tv

func Indirect

func Indirect(i any) Tv

Indirect if i is-valid; return Indirect T, Indirect V if i is-not-valid; return Direct T, Direct V

func Wrap

func Wrap(rv reflect.Value) Tv

func (Tv) ArrayStructValues

func (tv Tv) ArrayStructValues() []map[string]any

func (Tv) CallMethod

func (tv Tv) CallMethod(name string, args []any) (rets []any, called bool)

func (Tv) ETv

func (tv Tv) ETv() *ETv

func (Tv) FuncCall

func (tv Tv) FuncCall(in []any) (out []any, called bool)

func (Tv) Indirect

func (tv Tv) Indirect() Tv

func (Tv) SliceStructValues

func (tv Tv) SliceStructValues() []map[string]any

func (Tv) StructToMap

func (tv Tv) StructToMap() map[string]any

func (Tv) StructValues

func (tv Tv) StructValues() map[string]any

func (Tv) Values

func (tv Tv) Values() []map[string]any

type Types

type Types map[string]reflect.Type

type V

type V struct {
	reflect.Value
}

func NewV

func NewV(i any) V

func WrapV

func WrapV(rv reflect.Value) V

func (V) ArrayCallMethod

func (v V) ArrayCallMethod(name string, args []any) (rets []any, called bool)

func (V) ArrayStructSetField

func (v V) ArrayStructSetField(index int, nv map[string]any)

func (V) CallMethod

func (v V) CallMethod(name string, args []any) (rets []any, called bool)

func (V) CanElem

func (v V) CanElem() bool

func (V) Indirect

func (v V) Indirect() V

func (V) MapDeleteZero

func (v V) MapDeleteZero()

func (V) MapRange

func (v V) MapRange() []MapKeyValue

func (V) MapSetField

func (v V) MapSetField(nv map[string]any)

func (V) MapValues

func (v V) MapValues() map[string]any

func (V) SetField

func (v V) SetField(nv map[string]any, index ...int)

func (V) SliceCallMethod

func (v V) SliceCallMethod(name string, args []any) (rets []any, called bool)

func (V) SliceStructSetField

func (v V) SliceStructSetField(index int, nv map[string]any)

func (V) StructSet

func (v V) StructSet(nv map[string]any)

type Values

type Values map[string]reflect.Value

Jump to

Keyboard shortcuts

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