namedservice

package
v0.43.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package namedservice owns immutable named/default selection for service families.

Index

Constants

View Source
const MaxEntries = 128

Variables

This section is empty.

Functions

func Validate

func Validate(name string) error

Types

type Entry

type Entry[N Name, V any] struct {
	Name  N
	Value *V
}

type Name

type Name interface {
	~string
	Validate() error
}

type Registry

type Registry[N Name, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[N Name, V any](selected N, entries []Entry[N, V]) (*Registry[N, V], error)

func (*Registry[N, V]) Default

func (r *Registry[N, V]) Default() (*V, error)

func (*Registry[N, V]) DefaultName

func (r *Registry[N, V]) DefaultName() N

func (*Registry[N, V]) Get

func (r *Registry[N, V]) Get(name N) (*V, error)

func (*Registry[N, V]) Names

func (r *Registry[N, V]) Names() []N

Jump to

Keyboard shortcuts

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