featurehost

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBindingIDLength = 128

MaxBindingIDLength defines the upper bound for a host binding identifier.

Variables

View Source
var (
	ErrNilBinding       = errors.New("featurehost: registration binding is nil")
	ErrEmptyBindingID   = errors.New("featurehost: host binding ID is empty")
	ErrBindingIDTooLong = errors.New("featurehost: host binding ID exceeds maximum length")
	ErrDuplicateBinding = errors.New("featurehost: duplicate host binding ID")
	ErrInvalidBinding   = errors.New("featurehost: invalid host binding")
)

Sentinels returned by Validate.

Functions

func Validate

func Validate(regs []Registration) error

Validate verifies a slice of host-feature registrations: - returns ErrNilBinding if any registration has a nil binding; - returns ErrEmptyBindingID if HostBindingID is empty or only whitespace; - returns ErrBindingIDTooLong if HostBindingID exceeds MaxBindingIDLength; - returns ErrInvalidBinding wrapping the underlying error if ValidateHostBinding fails; - returns ErrDuplicateBinding if more than one registration shares the same HostBindingID.

Slice validation is defensive and deterministic.

Types

type Binding

type Binding interface {
	HostBindingID() string
	ValidateHostBinding() error
}

Binding is the startup-only interface implemented by trusted host bindings. Concrete implementations must be typed, self-contained, and nil-safe.

type Registration

type Registration struct {
	Binding Binding
}

Registration envelopes a trusted host binding for host-to-feature startup composition.

Jump to

Keyboard shortcuts

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