reflect

package
v1.2.9-beta4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call added in v1.2.3

func Call(data any, method string, args ...any) error

func Field added in v1.2.1

func Field(data any, field string) any

Field reflect value via field name field must exist

func IsImplements added in v1.2.3

func IsImplements(data any, i any) bool

func IsNil added in v1.2.5

func IsNil(v any) bool

func IsPtr added in v1.2.5

func IsPtr(typ Kind) bool

func IsSlice added in v1.2.4

func IsSlice(typ Kind) bool

func IsStruct

func IsStruct(typ Kind) bool

func IsZero

func IsZero(v any) bool

func Name

func Name(v any) string

Name return struct string name

func New

func New(v any) any

New returns a Value representing a pointer to a new zero value

func NewArray

func NewArray(v any) any

NewArray returns a []Value representing a pointer to a new zero value

func Path

func Path(typ reflect.Type, path ...string) string

func Set added in v1.2.1

func Set(data any, field string, value any)

Set data field value field type must the same as value can set basic or ptr value

func SetByIndex added in v1.2.4

func SetByIndex(data any, index int, value any)

SetByIndex data field index value type and field must same

func SetT added in v1.2.3

func SetT(data any, field string, value string)

SetT data field value type and field must same

func ToSlice

func ToSlice(slice any) []any

ToSlice arr must array data array struct data to []interface

func TrueField added in v1.2.1

func TrueField(data any, field string) any

TrueField return Field true value, eg: Ptr value

func TrueType

func TrueType(typ reflect.Type) reflect.Type

func TrueTypeof

func TrueTypeof(v any) reflect.Type

func TrueTypeofValue

func TrueTypeofValue(v any) (typ reflect.Type, i any)

func TrueValue

func TrueValue(typ reflect.Value) reflect.Value

func TrueValueOf

func TrueValueOf(v any) reflect.Value

Types

type Kind

type Kind interface {
	Kind() reflect.Kind
}

Jump to

Keyboard shortcuts

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