registry

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Client client.Client
	Scheme *runtime.Scheme
	Logger logr.Logger
}

Deps holds universal dependencies passed to provider factories.

type Provider

type Provider[T any] struct {
	Create      func(deps Deps) (T, error)
	Description string
}

Provider describes a named provider factory.

type Registry

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

Registry is a thread-safe, named-factory store for a single provider kind.

func New

func New[T any](kind string) *Registry[T]

func (*Registry[T]) Create

func (r *Registry[T]) Create(name string, deps Deps) (T, error)

func (*Registry[T]) Describe

func (r *Registry[T]) Describe() map[string]string

func (*Registry[T]) Has added in v0.3.0

func (r *Registry[T]) Has(name string) bool

func (*Registry[T]) List

func (r *Registry[T]) List() []string

func (*Registry[T]) Register

func (r *Registry[T]) Register(name string, p Provider[T])

Jump to

Keyboard shortcuts

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