reflectutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Unlicense Imports: 2 Imported by: 0

Documentation

Overview

Package reflectutil contains various utilities that are useful when working with reflection

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoPointerNewFromType added in v0.5.1

func AutoPointerNewFromType(typ reflect.Type) interface{}

func AutoPointerNewFromValue added in v0.5.1

func AutoPointerNewFromValue(val reflect.Value) interface{}

func EnsureSinglePointer added in v0.5.1

func EnsureSinglePointer(obj interface{}) interface{}

func EnsureSinglePointerType added in v0.5.1

func EnsureSinglePointerType(typ reflect.Type) reflect.Type

func EnsureSinglePointerValue added in v0.5.1

func EnsureSinglePointerValue(val reflect.Value) reflect.Value

func GetModelName

func GetModelName(model interface{}) string

func NewFromModel added in v0.5.1

func NewFromModel(model interface{}) interface{}

func NewFromType

func NewFromType(modelType reflect.Type) interface{}

func NewPtrValueFromType added in v0.5.1

func NewPtrValueFromType(modelType reflect.Type) reflect.Value

func NewSlice added in v0.5.1

func NewSlice(model interface{}) interface{}

func NewSliceOfType added in v0.6.0

func NewSliceOfType(typ reflect.Type) interface{}

func NewSliceOfTypeWithSize added in v0.6.0

func NewSliceOfTypeWithSize(typ reflect.Type, len int, cap int) interface{}

func NewSliceWithSize added in v0.6.0

func NewSliceWithSize(model interface{}, len int, cap int) interface{}

func PurifyToType added in v0.6.0

func PurifyToType(model interface{}) reflect.Type

func PurifyType added in v0.6.0

func PurifyType(typ reflect.Type) reflect.Type

func SetSlice

func SetSlice(valueSlice []interface{}, fieldValue reflect.Value)

func Unwrap added in v0.4.0

func Unwrap(obj interface{}) interface{}

func UnwrapType added in v0.3.1

func UnwrapType(typ reflect.Type) (unwrapped reflect.Type)

func UnwrapValue added in v0.3.1

func UnwrapValue(typ reflect.Value) (unwrapped reflect.Value)

func Wrap added in v0.4.0

func Wrap(obj interface{}) interface{}

func WrapValue added in v0.4.0

func WrapValue(val reflect.Value) reflect.Value

Types

This section is empty.

Jump to

Keyboard shortcuts

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