providers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectProviders

func DetectProviders() []string

DetectProviders detects available cloud providers based on environment and credentials

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError checks if an error is a NotFoundError

func NewAWSProvider

func NewAWSProvider(region string) *aws.AWSProvider

NewAWSProvider creates a new AWS provider with the specified region

func NewAzureProviderComplete

func NewAzureProviderComplete(subscriptionID, resourceGroup, tenantID, clientID, clientSecret, region string) *azure.AzureProviderComplete

NewAzureProviderComplete creates a new Azure provider with full API implementation

func NewDigitalOceanProvider added in v1.1.0

func NewDigitalOceanProvider(region string) *digitalocean.DigitalOceanProvider

NewDigitalOceanProvider creates a new DigitalOcean provider with the specified region

func NewGCPProviderComplete

func NewGCPProviderComplete(projectID, region, credentialsPath string) *gcp.GCPProviderComplete

NewGCPProviderComplete creates a new GCP provider with full API implementation

func ValidateProviderCredentials

func ValidateProviderCredentials(providerName string) error

ValidateProviderCredentials validates that necessary credentials exist for a provider

Types

type CloudProvider

type CloudProvider interface {
	// Name returns the provider name (e.g., "aws", "azure", "gcp")
	Name() string

	// DiscoverResources discovers resources in the specified region
	DiscoverResources(ctx context.Context, region string) ([]models.Resource, error)

	// GetResource retrieves a specific resource by ID
	GetResource(ctx context.Context, resourceID string) (*models.Resource, error)

	// ValidateCredentials checks if the provider credentials are valid
	ValidateCredentials(ctx context.Context) error

	// ListRegions returns available regions for the provider
	ListRegions(ctx context.Context) ([]string, error)

	// SupportedResourceTypes returns the list of supported resource types
	SupportedResourceTypes() []string
}

CloudProvider defines the interface for cloud providers

func NewProvider

func NewProvider(providerName string, config map[string]interface{}) (CloudProvider, error)

NewProvider creates a new provider based on the provider name

type NotFoundError

type NotFoundError struct {
	Provider   string
	ResourceID string
	Region     string
	Message    string
}

NotFoundError represents an error when a resource is not found

func NewNotFoundError

func NewNotFoundError(provider, resourceID, region string) *NotFoundError

NewNotFoundError creates a new NotFoundError

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface

func (*NotFoundError) IsNotFound

func (e *NotFoundError) IsNotFound() bool

IsNotFound returns true if the error is a NotFoundError

type ProviderConfig

type ProviderConfig struct {
	// Provider name
	Name string

	// Credentials
	Credentials map[string]string

	// Region to operate in
	Region string

	// Additional provider-specific options
	Options map[string]interface{}
}

ProviderConfig contains configuration for a provider

type ProviderFactory

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

ProviderFactory creates cloud providers based on configuration

func NewProviderFactory

func NewProviderFactory(config map[string]interface{}) *ProviderFactory

NewProviderFactory creates a new provider factory

func (*ProviderFactory) CreateProvider

func (pf *ProviderFactory) CreateProvider(providerName string) (CloudProvider, error)

CreateProvider creates a cloud provider by name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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