reflection

package
v2.16.9 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reflection added in v2.16.1

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

func New added in v2.16.8

func New(obj any) *Reflection

New 实例化:反射帮助

func (*Reflection) CallMethodByName added in v2.16.1

func (r *Reflection) CallMethodByName(methodName string, values ...reflect.Value) []reflect.Value

CallMethodByName 通过名称调用方法

func (*Reflection) GetReflectionType added in v2.16.9

func (r *Reflection) GetReflectionType() ReflectionType

GetReflectionType 获取Reflection类型

func (*Reflection) GetType added in v2.16.1

func (r *Reflection) GetType() reflect.Type

GetType 获取reflect.Type

func (*Reflection) GetValue added in v2.16.1

func (r *Reflection) GetValue() reflect.Value

GetValue 获取reflect.Value

func (*Reflection) IsSame added in v2.16.2

func (r *Reflection) IsSame(value any) bool

IsSame 判断两个类型是否相等

func (*Reflection) IsSameDeepEqual added in v2.16.6

func (r *Reflection) IsSameDeepEqual(value any) bool

IsSameDeepEqual 判断两个值是否相等

func (*Reflection) IsZero added in v2.16.6

func (r *Reflection) IsZero() bool

IsZero 判断是否为零值

type ReflectionType added in v2.16.9

type ReflectionType string
const (
	Int      ReflectionType = "INT"
	Int8     ReflectionType = "INT8"
	Int16    ReflectionType = "INT16"
	Int32    ReflectionType = "INT32"
	Int64    ReflectionType = "INT64"
	Uint     ReflectionType = "UINT"
	Uint8    ReflectionType = "UINT8"
	Uint16   ReflectionType = "UINT16"
	Uint32   ReflectionType = "UINT32"
	Uint64   ReflectionType = "UINT64"
	String   ReflectionType = "STRING"
	Float    ReflectionType = "FLOAT"
	Float32  ReflectionType = "FLOAT32"
	Float64  ReflectionType = "FLOAT64"
	Datetime ReflectionType = "DATETIME"
	Bool     ReflectionType = "BOOL"
	Array    ReflectionType = "ARRAY"
	Dict     ReflectionType = "DICT"
	Nil      ReflectionType = "NIL"
)

Jump to

Keyboard shortcuts

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