providerset

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Overview

Package providerset bundles every framework Provider into a single value passed to Plugin Factories. Plugins take what they need; the bundle stays small and out-of-tree extensions don't have to know about the host's construction order.

The package lives in its own sub-tree (NOT inside pkg/framework) so that the core framework package — which Providers themselves import for framework.Handle — does not in turn depend on every Provider type. This breaks the import cycle that would otherwise appear if `framework.Handle` exposed Provider accessors directly.

Add a new Provider here in three places:

  1. Add a field to Set.
  2. Return its Noop from Empty.
  3. Plumb the host's instance into Set wherever buildPlugins is called.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set struct {
	// Quota exposes quota information (read-only). Always non-nil — Noop is
	// returned when no quota backend is configured.
	Quota quota.Provider

	// InstanceType exposes the InstanceType catalog (read-only). Always
	// non-nil — Noop is returned when no catalog backend is configured.
	InstanceType instancetype.Provider
}

Set is the read-only bundle of Providers a Plugin can consume at construction time. The host populates this once during bootstrap and passes the same value to every Plugin Factory.

Plugins must NOT retain a pointer to fields they don't need — Providers are interfaces, not goroutine-safe in any specific way beyond the implementation guarantees.

func Empty

func Empty() Set

Empty returns a Set populated entirely with Noop Providers. Useful in tests that construct a Plugin without exercising any Provider, and as the fallback when a Provider field is left nil at registration time.

func (Set) Normalize

func (s Set) Normalize() Set

Normalize replaces any nil field in s with the Noop variant. Callers should run this before handing the Set to a Plugin Factory so plugins can safely dereference any field without a nil check.

Jump to

Keyboard shortcuts

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