provisioner

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(provider types.ResourceProvisionType, f Factory)

Register adds a provider factory. Intended to be called from a provider package's init(); last writer wins.

Types

type Factory

type Factory func(s store.Store, injector error_injection.Injector) (Provisioner, error)

Factory constructs a Provisioner for a provider.

Providers self-register their factory from init() (see resource_manager/provider/*), so adding a provider requires no edits to this package or the factory — the dependency points provider -> provisioner only, never the reverse.

type Provisioner

type Provisioner interface {
	// Provision allocates resources according to the given specification.
	// It returns a ProvisionResult containing the provision ID and status.
	// The operation should be idempotent - calling with the same IdempotencyKey
	// should return the same result without creating duplicate resources.
	Provision(ctx context.Context, req *types.ResourceProvision) (*types.ProvisionResult, error)

	// Release deallocates resources for the given provision.
	Release(ctx context.Context, provisionID string) error

	// List retrieves provisions matching the given criteria.
	List(ctx context.Context, opts *types.ListOptions) ([]*types.ProvisionResult, error)

	// Type returns the resource provision type
	Type() types.ResourceProvisionType
}

Provisioner is the main interface for resource provisioning. Implementations should support idempotent operations using IdempotencyKey.

func NewProvisioner

func NewProvisioner(provider types.ResourceProvisionType, s store.Store, injector error_injection.Injector) (Provisioner, error)

Jump to

Keyboard shortcuts

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