reflection

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilPointer   = errors.New("nil pointer")
	ErrInvalidIndex = errors.New("invalid index")
	ErrOutOfRange   = errors.New("index out of range")
	ErrTypeMismatch = errors.New("type mismatch")
	ErrKeyMissing   = errors.New("key missing")
	ErrNotSettable  = errors.New("target is not settable")
)

Functions

func BoolValue added in v0.14.0

func BoolValue(v any) (reflect.Value, bool)

func Compare added in v0.13.0

func Compare(v, target reflect.Value) bool

func Convert added in v0.13.0

func Convert(v reflect.Value, target reflect.Type) (reflect.Value, error)

func Fields added in v0.13.0

func Fields(rv reflect.Value) iter.Seq2[string, reflect.Value]

func FloatValue added in v0.14.0

func FloatValue(v any) (reflect.Value, bool)

func FuncValue added in v0.16.0

func FuncValue(v any) (reflect.Value, bool)

func IndirectValue

func IndirectValue(value any) reflect.Value

func IntValue added in v0.14.0

func IntValue(v any) (reflect.Value, bool)

func IsBool added in v0.13.0

func IsBool(v any) bool

func IsEmpty added in v0.13.0

func IsEmpty(value any) bool

func IsFloat added in v0.14.0

func IsFloat(v any) bool

func IsFunc added in v0.16.0

func IsFunc(v any) bool

func IsInt added in v0.14.0

func IsInt(v any) bool

func IsMap added in v0.13.0

func IsMap(v any) bool

func IsNumber added in v0.13.0

func IsNumber(v any) bool

func IsSlice added in v0.13.0

func IsSlice(v any) bool

func IsString added in v0.14.0

func IsString(v any) bool

func IsStruct added in v0.14.0

func IsStruct(v any) bool

func IsUint added in v0.14.0

func IsUint(v any) bool

func IsZero added in v0.12.0

func IsZero(value any) bool

func Lookup added in v0.9.2

func Lookup(target, key any) (reflect.Value, error)

func MapValue added in v0.13.0

func MapValue(v any) (reflect.Value, bool)

func NumberValue added in v0.14.0

func NumberValue(v any) (reflect.Value, bool)

func ResolveField

func ResolveField(v reflect.Value, key any) (reflect.Value, error)

func ResolveIndex added in v0.13.0

func ResolveIndex(i any) (int64, error)

func ResolveKey

func ResolveKey(m reflect.Value, key any) (reflect.Value, error)

func Set added in v0.13.0

func Set(target, key, value any) error

func SetTarget added in v0.13.0

func SetTarget(target, val reflect.Value) error

func SliceValue added in v0.13.0

func SliceValue(v any) (reflect.Value, bool)

func StringValue added in v0.14.0

func StringValue(v any) (reflect.Value, bool)

func StructValue added in v0.14.0

func StructValue(v any) (reflect.Value, bool)

func UintValue added in v0.14.0

func UintValue(v any) (reflect.Value, bool)

func Unset added in v0.13.0

func Unset(target, key any) error

func Values added in v0.13.0

func Values(v any) iter.Seq2[any, error]

func Zero added in v0.12.0

func Zero(value any) any

Types

This section is empty.

Jump to

Keyboard shortcuts

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