providers

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriftDifference

type DriftDifference struct {
	Property     string
	CurrentValue interface{}
	DesiredValue interface{}
	DriftType    DriftType
}

DriftDifference represents a difference between current and desired state

type DriftResult

type DriftResult struct {
	HasDrift     bool
	Changes      []string // Human-readable list of changes
	Differences  map[string]DriftDifference
	CurrentState map[string]interface{}
	DesiredState map[string]interface{}
}

DriftResult represents the result of drift detection

type DriftType

type DriftType string

DriftType represents the type of drift

const (
	DriftTypeAdded    DriftType = "added"
	DriftTypeRemoved  DriftType = "removed"
	DriftTypeModified DriftType = "modified"
)

type Provider

type Provider interface {
	// Initialize sets up the provider with configuration
	Initialize(ctx context.Context, config map[string]interface{}) error

	// Create creates a new resource
	Create(ctx context.Context, instance config.ResourceInstance) error

	// Update updates an existing resource
	Update(ctx context.Context, instance config.ResourceInstance, currentState map[string]interface{}) error

	// Delete deletes a resource
	Delete(ctx context.Context, instance config.ResourceInstance) error

	// GetCurrentState retrieves the current state of a resource
	GetCurrentState(ctx context.Context, instance config.ResourceInstance) (map[string]interface{}, error)

	// ValidateResource validates a resource configuration
	ValidateResource(instance config.ResourceInstance) error

	// GetSupportedResourceTypes returns the resource types supported by this provider
	GetSupportedResourceTypes() []string
}

Provider defines the interface for cloud providers

type ProviderRegistry

type ProviderRegistry struct {
	// contains filtered or unexported fields
}

ProviderRegistry manages available providers

func NewProviderRegistry

func NewProviderRegistry() *ProviderRegistry

NewProviderRegistry creates a new provider registry

func NewRegistry

func NewRegistry() *ProviderRegistry

NewRegistry creates a new provider registry (alias for NewProviderRegistry)

func (*ProviderRegistry) Get

func (r *ProviderRegistry) Get(name string) (Provider, bool)

Get retrieves a provider by name

func (*ProviderRegistry) GetAll

func (r *ProviderRegistry) GetAll() map[string]Provider

GetAll returns all registered providers

func (*ProviderRegistry) Register

func (r *ProviderRegistry) Register(name string, provider Provider)

Register registers a provider

type ResourceState

type ResourceState struct {
	ID         string
	Kind       string
	Name       string
	Properties map[string]interface{}
	Exists     bool
	Metadata   map[string]interface{}
}

ResourceState represents the current state of a resource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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