Documentation ¶
Index ¶
- func GenericInstanceByT[T any]() T
- func GetAllRegisteredTypes() map[string][]reflect.Type
- func GetBaseReflectType(value interface{}) reflect.Type
- func GetBaseType(value interface{}) interface{}
- func GetFullTypeName(input interface{}) string
- func GetFullTypeNameByType(typ reflect.Type) string
- func GetImplementInterfaceTypes[T any]() map[string][]reflect.Type
- func GetNonPointerTypeName(input interface{}) string
- func GetReflectType(value interface{}) reflect.Type
- func GetTypeFromGeneric[T interface{}]() reflect.Type
- func GetTypeName(input interface{}) string
- func GetTypeNameByT[T any]() string
- func GetTypeNameByType(typ reflect.Type) string
- func InstanceByPackageName(pkgPath string, name string) interface{}
- func InstanceByType(typ reflect.Type) interface{}
- func InstanceByTypeName(name string) interface{}
- func InstanceByTypeNameAndImplementedInterface[TInterface interface{}](name string) interface{}
- func InstancePointerByTypeName(name string) interface{}
- func RegisterType(typ reflect.Type)
- func RegisterTypeWithKey(key string, typ reflect.Type)
- func TypeByName(typeName string) reflect.Type
- func TypeByNameAndImplementedInterface[TInterface interface{}](typeName string) reflect.Type
- func TypeByPackageName(pkgPath string, name string) reflect.Type
- func TypesByName(typeName string) []reflect.Type
- func TypesByPackageName(pkgPath string, name string) []reflect.Type
- func TypesImplementedInterface[TInterface interface{}]() []reflect.Type
- func TypesImplementedInterfaceWithFilterTypes[TInterface interface{}](types []reflect.Type) []reflect.Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenericInstanceByT ¶
func GenericInstanceByT[T any]() T
func GetAllRegisteredTypes ¶
func GetBaseReflectType ¶
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 GetNonPointerTypeName ¶
func GetNonPointerTypeName(input interface{}) string
func GetReflectType ¶
func GetTypeFromGeneric ¶
func GetTypeName ¶
func GetTypeName(input interface{}) string
GetTypeName returns the name of the type without its package name
func GetTypeNameByT ¶
func GetTypeNameByType ¶
func InstanceByPackageName ¶
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 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 RegisterTypeWithKey ¶
func TypeByName ¶
TypeByName return the type by its name
func TypeByPackageName ¶
TypeByPackageName return the type by its package and name
func TypesByName ¶
Types ¶
This section is empty.