Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamedLoader ¶
NamedLoader returns a name/loader pair for a component that is used to add to an instance of `Registry`.
func Named ¶
func Named[T, C any](name string, loader Loader[T, C]) NamedLoader[T, C]
Named is a shorthand wrapper around creating a dynamically named component.
type Registry ¶
Registry is a simple map of name to `Loader` so that component loaders can be looked up by name.
func NewRegistry ¶
func NewRegistry[T, C any](namedLoaders ...NamedLoader[T, C]) Registry[T, C]
NewRegistry returns a pre-populated `Registry` based on the provided `namedLoaders`.
func (Registry[T, C]) Register ¶
func (r Registry[T, C]) Register(namedLoaders ...NamedLoader[T, C])
Register adds name/loader pairs to an existing `Registry` by calling each of the `namedLoaders`.
Click to show internal directories.
Click to hide internal directories.