Documentation
¶
Overview ¶
Package stubprovider supplies a minimal in-process interfaces.IaCProvider for use in integration tests and the scenario-92 demo stack.
The Provider does NOT make real cloud API calls. Every lifecycle method returns a deterministic, non-error result:
- Plan: compares desired vs current by name; emits "create" for resources absent from current and "delete" for resources absent from desired.
- ResourceDriver: returns a stub driver whose Create/Update/Delete all succeed, enabling wfctlhelpers.ApplyPlanWithHooks to run end-to-end without any external plugin subprocess.
- Destroy: returns all supplied refs as Destroyed names (no-op).
- DetectDrift: returns Drifted:false for every ref.
This package imports only interfaces — no new import cycles.
Index ¶
- type Provider
- func (p *Provider) BootstrapStateBackend(_ context.Context, _ map[string]any) (*interfaces.BootstrapResult, error)
- func (p *Provider) Capabilities() []interfaces.IaCCapabilityDeclaration
- func (p *Provider) Close() error
- func (p *Provider) Destroy(_ context.Context, refs []interfaces.ResourceRef) (*interfaces.DestroyResult, error)
- func (p *Provider) DetectDrift(_ context.Context, refs []interfaces.ResourceRef) ([]interfaces.DriftResult, error)
- func (p *Provider) Import(_ context.Context, _ string, _ string) (*interfaces.ResourceState, error)
- func (p *Provider) Initialize(_ context.Context, _ map[string]any) error
- func (p *Provider) Name() string
- func (p *Provider) Plan(_ context.Context, desired []interfaces.ResourceSpec, ...) (*interfaces.IaCPlan, error)
- func (p *Provider) ResolveSizing(_ string, _ interfaces.Size, _ *interfaces.ResourceHints) (*interfaces.ProviderSizing, error)
- func (p *Provider) ResourceDriver(_ string) (interfaces.ResourceDriver, error)
- func (p *Provider) Status(_ context.Context, _ []interfaces.ResourceRef) ([]interfaces.ResourceStatus, error)
- func (p *Provider) SupportedCanonicalKeys() []string
- func (p *Provider) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct{}
Provider is the exported stub IaCProvider. Use New() to obtain an instance.
func (*Provider) BootstrapStateBackend ¶
func (p *Provider) BootstrapStateBackend(_ context.Context, _ map[string]any) (*interfaces.BootstrapResult, error)
BootstrapStateBackend returns nil — the stub does not manage state backends.
func (*Provider) Capabilities ¶
func (p *Provider) Capabilities() []interfaces.IaCCapabilityDeclaration
Capabilities returns nil — the stub does not declare optional capabilities.
func (*Provider) Destroy ¶
func (p *Provider) Destroy(_ context.Context, refs []interfaces.ResourceRef) (*interfaces.DestroyResult, error)
Destroy returns all supplied refs as Destroyed names.
func (*Provider) DetectDrift ¶
func (p *Provider) DetectDrift(_ context.Context, refs []interfaces.ResourceRef) ([]interfaces.DriftResult, error)
DetectDrift returns Drifted:false with DriftClassInSync for every ref.
func (*Provider) Import ¶
func (p *Provider) Import(_ context.Context, _ string, _ string) (*interfaces.ResourceState, error)
Import returns nil — the stub does not support resource import.
func (*Provider) Initialize ¶
Initialize is a no-op for the stub.
func (*Provider) Plan ¶
func (p *Provider) Plan(_ context.Context, desired []interfaces.ResourceSpec, current []interfaces.ResourceState) (*interfaces.IaCPlan, error)
Plan compares desired specs against current state by name and returns a plan with "create" for each new resource and "delete" for each resource present in current but absent from desired. Resources present in both are returned as "update" actions (no-op at apply time; the stub driver's Update returns success).
func (*Provider) ResolveSizing ¶
func (p *Provider) ResolveSizing(_ string, _ interfaces.Size, _ *interfaces.ResourceHints) (*interfaces.ProviderSizing, error)
ResolveSizing returns nil — the stub does not resolve sizing.
func (*Provider) ResourceDriver ¶
func (p *Provider) ResourceDriver(_ string) (interfaces.ResourceDriver, error)
ResourceDriver returns a stub driver for any resource type.
func (*Provider) Status ¶
func (p *Provider) Status(_ context.Context, _ []interfaces.ResourceRef) ([]interfaces.ResourceStatus, error)
Status returns nil — the stub does not probe live cloud status.
func (*Provider) SupportedCanonicalKeys ¶
SupportedCanonicalKeys returns nil.