reflector

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package reflector provides type reflection utilities with caching. It extracts and caches type metadata for efficient repeated lookups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypeInfo

type TypeInfo struct {
	Name string       // Fully qualified name: "pkg/path.TypeName"
	Type reflect.Type // The underlying reflect.Type
}

TypeInfo holds metadata about a reflected type.

func TypeInfoFor

func TypeInfoFor[T any]() TypeInfo

TypeInfoFor returns TypeInfo for type parameter T. The result is cached for subsequent lookups.

func TypeInfoForType

func TypeInfoForType(t reflect.Type) TypeInfo

TypeInfoForType returns TypeInfo for the given reflect.Type. For pointer types, returns info about the element type. Results are cached; thread-safe for concurrent use.

func TypeInfoOf

func TypeInfoOf(x any) TypeInfo

TypeInfoOf returns TypeInfo for the dynamic type of x. The result is cached for subsequent lookups.

Jump to

Keyboard shortcuts

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