Documentation
¶
Index ¶
- func GetDefault[T any](types map[any]T, key RegKey[reflect.Type], kindKey RegKey[reflect.Kind]) (obj T, found bool)
- func GetKind[T any](types map[any]T, _ RegKey[reflect.Type], kindKey RegKey[reflect.Kind]) (obj T, found bool)
- func GetKindDst[T any](types map[any]T, _ RegKey[reflect.Type], kindKey RegKey[reflect.Kind]) (obj T, found bool)
- func GetKindSrc[T any](types map[any]T, _ RegKey[reflect.Type], kindKey RegKey[reflect.Kind]) (obj T, found bool)
- func GetType[T any](types map[any]T, key RegKey[reflect.Type], _ RegKey[reflect.Kind]) (obj T, found bool)
- func GetTypeDst[T any](types map[any]T, key RegKey[reflect.Type], _ RegKey[reflect.Kind]) (obj T, found bool)
- func GetTypeSrc[T any](types map[any]T, key RegKey[reflect.Type], _ RegKey[reflect.Kind]) (obj T, found bool)
- type Getter
- type RegKey
- type TypeRegistry
- func (reg *TypeRegistry[T]) Clear() int
- func (reg *TypeRegistry[T]) Get(dstTyp reflect.Type, srcTyp reflect.Type) (obj T, found bool)
- func (reg *TypeRegistry[T]) InterfaceRegister(iface reflect.Type, scan T) (overwrite bool)
- func (reg *TypeRegistry[T]) Register(dstType reflect.Type, srcOrT ...any) (overwrite bool)
- func (reg *TypeRegistry[T]) RegisterKind(dstKind, srcKind reflect.Kind, checker T) (overwrite bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefault ¶
func GetKindDst ¶
func GetKindSrc ¶
func GetTypeDst ¶
Types ¶
type TypeRegistry ¶
type TypeRegistry[T any] struct { // contains filtered or unexported fields }
func NewTypeRegistry ¶
func NewTypeRegistry[T any](get func(dst, src reflect.Type) []Getter[T]) *TypeRegistry[T]
func (*TypeRegistry[T]) Clear ¶
func (reg *TypeRegistry[T]) Clear() int
func (*TypeRegistry[T]) InterfaceRegister ¶
func (reg *TypeRegistry[T]) InterfaceRegister(iface reflect.Type, scan T) (overwrite bool)
func (*TypeRegistry[T]) Register ¶
func (reg *TypeRegistry[T]) Register(dstType reflect.Type, srcOrT ...any) (overwrite bool)
func (*TypeRegistry[T]) RegisterKind ¶
func (reg *TypeRegistry[T]) RegisterKind(dstKind, srcKind reflect.Kind, checker T) (overwrite bool)
Click to show internal directories.
Click to hide internal directories.