typeMapper

package
v0.0.0-...-52d9df3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericInstanceByT

func GenericInstanceByT[T any]() T

func GetAllRegisteredTypes

func GetAllRegisteredTypes() map[string][]reflect.Type

func GetBaseReflectType

func GetBaseReflectType(value interface{}) reflect.Type

func GetBaseType

func GetBaseType(value interface{}) interface{}

func GetFullTypeName

func GetFullTypeName(input interface{}) string

GetFullTypeName returns the full name of the type by its package name

func GetFullTypeNameByType

func GetFullTypeNameByType(typ reflect.Type) string

func GetImplementInterfaceTypes

func GetImplementInterfaceTypes[T any]() map[string][]reflect.Type

func GetNonPointerTypeName

func GetNonPointerTypeName(input interface{}) string

func GetReflectType

func GetReflectType(value interface{}) reflect.Type

func GetTypeFromGeneric

func GetTypeFromGeneric[T interface{}]() reflect.Type

func GetTypeName

func GetTypeName(input interface{}) string

GetTypeName returns the name of the type without its package name

func GetTypeNameByT

func GetTypeNameByT[T any]() string

func GetTypeNameByType

func GetTypeNameByType(typ reflect.Type) string

func InstanceByPackageName

func InstanceByPackageName(pkgPath string, name string) interface{}

InstanceByPackageName return an empty instance of the type by its name and package name If the type is a pointer type, it will return a pointer instance of the type and if the type is a struct type, it will return an empty struct

func InstanceByType

func InstanceByType(typ reflect.Type) interface{}

func InstanceByTypeName

func InstanceByTypeName(name string) interface{}

InstanceByTypeName return an empty instance of the type by its name If the type is a pointer type, it will return a pointer instance of the type and if the type is a struct type, it will return an empty struct

func InstanceByTypeNameAndImplementedInterface

func InstanceByTypeNameAndImplementedInterface[TInterface interface{}](name string) interface{}

func InstancePointerByTypeName

func InstancePointerByTypeName(name string) interface{}

InstancePointerByTypeName return an empty pointer instance of the type by its name If the type is a pointer type, it will return a pointer instance of the type and if the type is a struct type, it will return a pointer to the struct

func RegisterType

func RegisterType(typ reflect.Type)

func RegisterTypeWithKey

func RegisterTypeWithKey(key string, typ reflect.Type)

func TypeByName

func TypeByName(typeName string) reflect.Type

TypeByName return the type by its name

func TypeByNameAndImplementedInterface

func TypeByNameAndImplementedInterface[TInterface interface{}](typeName string) reflect.Type

func TypeByPackageName

func TypeByPackageName(pkgPath string, name string) reflect.Type

TypeByPackageName return the type by its package and name

func TypesByName

func TypesByName(typeName string) []reflect.Type

func TypesByPackageName

func TypesByPackageName(pkgPath string, name string) []reflect.Type

func TypesImplementedInterface

func TypesImplementedInterface[TInterface interface{}]() []reflect.Type

func TypesImplementedInterfaceWithFilterTypes

func TypesImplementedInterfaceWithFilterTypes[TInterface interface{}](
	types []reflect.Type,
) []reflect.Type

Types

This section is empty.

Jump to

Keyboard shortcuts

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