reflection

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldInfo

type FieldInfo struct {
	reflect.StructField
	Tags map[string]*TagInfo
}

FieldInfo contains information concerning a single field on a struct

type TagInfo

type TagInfo struct {
	Raw       string
	Name      string
	Modifiers []string
}

TagInfo contains information concerning a tag on a field

type TypeInfo

type TypeInfo struct {
	Name   string
	Path   string
	Fields []*FieldInfo
}

func GetTypeInfo

func GetTypeInfo[T any]() *TypeInfo

GetTypeInfo retrieves information on the type submitted to the function. A list of FieldInfo objects will be returned, where each contains the SructField for the associated field along with a mapping of tag names to their values. This list will be ordered in the same way as the fields. Additionally, the field into will be cached so that subsequent accesses do not incur additional costs

Jump to

Keyboard shortcuts

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