factory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package factory implements the functions, types, and interfaces for the module.

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
}

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