registry

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToTypeName

func ToTypeName[T any](sample T) string

Types

type Registry

type Registry[T any] struct {
	Types map[string]reflect.Type
}

func New

func New[T any]() *Registry[T]

func (*Registry[T]) ListTypeNames

func (r *Registry[T]) ListTypeNames() []string

func (*Registry[T]) NewByTypeName

func (r *Registry[T]) NewByTypeName(typeName string) T

func (*Registry[T]) RegisterType

func (r *Registry[T]) RegisterType(sample T)

Jump to

Keyboard shortcuts

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