registry

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 4 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[C any] struct {
	// contains filtered or unexported fields
}

Registry stores a mapping of provider names to constructors for a capability.

func New

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

New allocates a registry for provider constructors.

func (*Registry[C]) Get

func (r *Registry[C]) Get(name string) (C, bool)

Get fetches a provider constructor by name.

func (*Registry[C]) Names

func (r *Registry[C]) Names() []string

Names returns the sorted provider keys registered for this capability.

func (*Registry[C]) Register

func (r *Registry[C]) Register(name string, constructor C) error

Register adds a provider constructor by name. Names are case-insensitive.

Jump to

Keyboard shortcuts

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