reflect

package
v0.0.0-...-e88353a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReflectCache

type ReflectCache struct {
	// contains filtered or unexported fields
}

ReflectCache caches the types for faster look up times.

func NewReflectCache

func NewReflectCache() *ReflectCache

NewReflectCache creates a new ReflectCache that caches the types for faster look up times.

func (*ReflectCache) Reflect

func (r *ReflectCache) Reflect(value interface{}) (ReflectInfo, error)

Reflect will return a Reflectstruct of a given type.

type ReflectField

type ReflectField struct {
	Name  string
	Tag   ReflectTag
	Value reflect.Value
}

type ReflectInfo

type ReflectInfo interface {
	Kind() reflect.Kind
}

func Reflect

func Reflect(value reflect.Value) (ReflectInfo, error)

Reflect parses a reflect.Value returning a ReflectInfo of fields and tags for the reflect value.

type ReflectStruct

type ReflectStruct struct {
	Name   string
	Fields map[string]ReflectField
	Value  reflect.Value
}

func (ReflectStruct) FieldNames

func (r ReflectStruct) FieldNames() []string

FieldNames returns the field names for a given type.

func (ReflectStruct) Kind

func (r ReflectStruct) Kind() reflect.Kind

type ReflectTag

type ReflectTag struct {
	Name      string
	OmitEmpty bool
}

type ReflectValue

type ReflectValue struct {
	Value reflect.Value
}

func (ReflectValue) Kind

func (r ReflectValue) Kind() reflect.Kind

Jump to

Keyboard shortcuts

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