reflection

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package reflection implements the functions, types, and interfaces for the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldPointByType

func FieldPointByType[T any](obj T) (*T, error)

FieldPointByType returns the first field pointer in the struct that matches the target type

func FieldValueByType

func FieldValueByType[T any](obj T) (T, error)

func NewFieldNotFoundError

func NewFieldNotFoundError(target, strct reflect.Type) error

func NewInvalidStructError

func NewInvalidStructError(v interface{}) error

func NewTypeMismatchError

func NewTypeMismatchError(actual, expected reflect.Type) error

Types

type FieldNotFoundError

type FieldNotFoundError struct {
	TargetType, StructType reflect.Type
}

func (*FieldNotFoundError) Error

func (e *FieldNotFoundError) Error() string

type InvalidStructError

type InvalidStructError struct {
	Type reflect.Type
}

func (*InvalidStructError) Error

func (e *InvalidStructError) Error() string

type TypeMismatchError

type TypeMismatchError struct {
	Actual, Expected reflect.Type
}

func (*TypeMismatchError) Error

func (e *TypeMismatchError) Error() string

Jump to

Keyboard shortcuts

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