factory

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry[F any] interface {
	Get(name string) (F, bool)
	Register(name string, factory F)
	RegisteredFactories() map[string]F
	Reset()
}

Registry defines the interface for managing factory functions. It allows for registering and retrieving factory functions by name.

func New

func New[F any]() Registry[F]

New creates and returns a new instance of the registry. This is the entry point for creating a registry for factory functions.

Jump to

Keyboard shortcuts

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