yreflect

package
v0.29.9 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIntoOrderedMap

func AppendIntoOrderedMap(orderedMap goOrderedMap, value any) error

AppendIntoOrderedMap appends a populated value into the ordered map.

There must not exist an existing element with the same key.

func GetOrderedMapElement added in v0.29.2

func GetOrderedMapElement(om goOrderedMap, k reflect.Value) (reflect.Value, bool, error)

GetOrderedMapElement calls the given ordered map's Get function given the key value.

- reflect.Value is the retrieved value at the key. - bool is whether the value exists. - error is whether an unexpected condition was detected.

func MethodByName

func MethodByName(v reflect.Value, name string) (reflect.Value, error)

MethodByName returns a valid method for the given value, or an error if the method is not valid for use.

func OrderedMapElementType

func OrderedMapElementType(om goOrderedMap) (reflect.Type, error)

OrderedMapElementType returns the list element type of the ordered map.

func OrderedMapKeyType

func OrderedMapKeyType(om goOrderedMap) (reflect.Type, error)

OrderedMapKeyType returns the key type of the ordered map, which will be a struct type for a multi-keyed list.

func OrderedMapKeys

func OrderedMapKeys(om goOrderedMap) ([]reflect.Value, error)

OrderedMapKeys returns the keys of the ordered map in a slice analogous to reflect's Value.MapKeys() method although it returns an error.

func RangeOrderedMap

func RangeOrderedMap(orderedMap goOrderedMap, visit func(k reflect.Value, v reflect.Value) bool) error

RangeOrderedMap calls a visitor function over each key-value pair in order.

The for loop break when either the visit function returns false or an error is encountered due to the ordered map not being well-formed.

func UnaryMethodArgType

func UnaryMethodArgType(t reflect.Type, methodName string) (reflect.Type, error)

UnaryMethodArgType returns the argument type of the input type's specified unary method.

Types

This section is empty.

Jump to

Keyboard shortcuts

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