pool

package
v2.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 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 Factory

type Factory[T any] struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory[T any](new func(name string) (T, error)) *Factory[T]

NewFactory returns a singleton factory that creates objects with new.

func (*Factory[T]) Get

func (f *Factory[T]) Get(name string) (T, error)

Get returns the singleton object registered under name, creating it on first use.

Jump to

Keyboard shortcuts

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