reflectutil

package
v0.85.0-pre.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerefType

func DerefType(t reflect.Type) (reflect.Type, bool)

func IsFloatKind

func IsFloatKind(kind reflect.Kind) bool

func IsNilLikeExceptNone

func IsNilLikeExceptNone(v any) bool

func IsNumericKind

func IsNumericKind(kind reflect.Kind) bool

func IsScalarType

func IsScalarType(t reflect.Type) bool

func IsSignedIntKind

func IsSignedIntKind(kind reflect.Kind) bool

func IsUnsignedIntKind

func IsUnsignedIntKind(kind reflect.Kind) bool

func NewValueWithAnonymousPointerFields

func NewValueWithAnonymousPointerFields(t reflect.Type) reflect.Value

func TypeImplements

func TypeImplements(t reflect.Type, iface reflect.Type) bool

Types

type StructField

type StructField struct {
	Field                    reflect.StructField
	FieldName                string
	PublicName               string
	Type                     reflect.Type
	DerefType                reflect.Type
	Index                    []int
	TypeWasPointer           bool
	OptionalInPublicShape    bool
	OmitEmpty                bool
	OmitZero                 bool
	Inline                   bool
	Unknown                  bool
	ViaOptionalEmbeddedField bool
}

func PublicStructFields

func PublicStructFields(t reflect.Type) ([]StructField, error)

func (StructField) DerefStructType

func (field StructField) DerefStructType() (reflect.Type, bool)

func (StructField) SettableCompositeValue

func (field StructField) SettableCompositeValue(
	v reflect.Value,
) (reflect.Value, bool)

func (StructField) SettableValue

func (field StructField) SettableValue(v reflect.Value) (reflect.Value, bool)

type StructShape

type StructShape struct {
	Fields   []StructField
	Inlined  []StructField
	Unknowns []StructField
}

func PublicStructShape

func PublicStructShape(t reflect.Type) (StructShape, error)

type Value

type Value struct {
	V reflect.Value
}

func (Value) BoolBase

func (value Value) BoolBase() (reflect.Value, bool)

func (Value) DeleteMapValue

func (value Value) DeleteMapValue(key reflect.Value)

func (Value) Deref

func (value Value) Deref() reflect.Value

func (Value) EnsureDeref

func (value Value) EnsureDeref() (reflect.Value, bool)

func (Value) EnsureMap

func (value Value) EnsureMap() bool

func (Value) EnsurePointerElem

func (value Value) EnsurePointerElem() (reflect.Value, bool)

func (Value) FloatBase

func (value Value) FloatBase() (reflect.Value, bool)

func (Value) FormatKey

func (value Value) FormatKey() string

func (Value) InterfaceImpl

func (value Value) InterfaceImpl(iface reflect.Type) (reflect.Value, bool)

func (Value) MakeSlice

func (value Value) MakeSlice(length int) reflect.Value

func (Value) MapBase

func (value Value) MapBase() (reflect.Value, bool)

func (Value) MapValueCopy

func (value Value) MapValueCopy(key reflect.Value) (reflect.Value, bool)

func (Value) NewElemValue

func (value Value) NewElemValue() reflect.Value

func (Value) PointsToNil

func (value Value) PointsToNil() bool

func (Value) ResolveField

func (value Value) ResolveField(
	name string,
) (val reflect.Value, exists bool, write_back func(reflect.Value))

func (Value) SetEmptySlice

func (value Value) SetEmptySlice() bool

func (Value) SetMapValue

func (value Value) SetMapValue(key, val reflect.Value)

func (Value) SetScalarFromString

func (value Value) SetScalarFromString(raw string) error

func (Value) SetZero

func (value Value) SetZero()

func (Value) SettableCopy

func (value Value) SettableCopy() reflect.Value

func (Value) SignedIntBase

func (value Value) SignedIntBase() (reflect.Value, bool)

func (Value) SliceOrArrayBase

func (value Value) SliceOrArrayBase() (reflect.Value, bool)

func (Value) SortedMapKeys

func (value Value) SortedMapKeys() []reflect.Value

func (Value) StringBase

func (value Value) StringBase() (reflect.Value, bool)

func (Value) UnsignedIntBase

func (value Value) UnsignedIntBase() (reflect.Value, bool)

func (Value) WriteBool

func (value Value) WriteBool(base reflect.Value, b bool)

func (Value) WriteFloat

func (value Value) WriteFloat(base reflect.Value, f float64)

func (Value) WriteInt

func (value Value) WriteInt(base reflect.Value, n int64)

func (Value) WriteString

func (value Value) WriteString(base reflect.Value, s string)

func (Value) WriteUint

func (value Value) WriteUint(base reflect.Value, n uint64)

Jump to

Keyboard shortcuts

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