Help us shape the future of Go! Take the 2026 Go Developer Survey

registry

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 7 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
	Clientset kubernetes.Interface
	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