Help us shape the future of Go! Take the 2026 Go Developer Survey

provider

package
v0.86.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudProvider

type CloudProvider interface {
	plugin.NativePlugin

	// Deployment
	Deploy(ctx context.Context, req DeployRequest) (*DeployResult, error)
	GetDeploymentStatus(ctx context.Context, deployID string) (*DeployStatus, error)
	Rollback(ctx context.Context, deployID string) error

	// Container Registry
	PushImage(ctx context.Context, image string, auth RegistryAuth) error
	PullImage(ctx context.Context, image string, auth RegistryAuth) error
	ListImages(ctx context.Context, repo string) ([]ImageTag, error)

	// Connectivity
	TestConnection(ctx context.Context, config map[string]any) (*ConnectionResult, error)

	// Monitoring
	GetMetrics(ctx context.Context, deployID string, window time.Duration) (*Metrics, error)
}

CloudProvider extends NativePlugin with deployment, container registry, connectivity testing, and monitoring capabilities for a cloud platform.

type ConnectionResult

type ConnectionResult struct {
	Success bool           `json:"success"`
	Message string         `json:"message"`
	Latency time.Duration  `json:"latency"`
	Details map[string]any `json:"details"`
}

ConnectionResult describes the outcome of a connectivity test.

type DeployRequest

type DeployRequest struct {
	Environment string            `json:"environment"`
	Strategy    string            `json:"strategy"` // "rolling", "blue-green", "canary"
	Image       string            `json:"image"`
	Config      map[string]any    `json:"config"`
	HealthCheck HealthCheckConfig `json:"health_check"`
}

DeployRequest describes a deployment to execute on a cloud provider.

type DeployResult

type DeployResult struct {
	DeployID    string    `json:"deploy_id"`
	Status      string    `json:"status"` // "pending", "in_progress", "succeeded", "failed"
	Message     string    `json:"message"`
	StartedAt   time.Time `json:"started_at"`
	CompletedAt time.Time `json:"completed_at,omitempty"`
}

DeployResult captures the outcome of initiating a deployment.

type DeployStatus

type DeployStatus struct {
	DeployID  string           `json:"deploy_id"`
	Status    string           `json:"status"`
	Progress  int              `json:"progress"` // 0-100
	Message   string           `json:"message"`
	Instances []InstanceStatus `json:"instances"`
}

DeployStatus describes the current state of an in-progress or completed deployment.

type HealthCheckConfig

type HealthCheckConfig struct {
	Path               string        `json:"path"`
	Interval           time.Duration `json:"interval"`
	Timeout            time.Duration `json:"timeout"`
	HealthyThreshold   int           `json:"healthy_threshold"`
	UnhealthyThreshold int           `json:"unhealthy_threshold"`
}

HealthCheckConfig defines health check parameters for a deployment.

type ImageTag

type ImageTag struct {
	Repository string    `json:"repository"`
	Tag        string    `json:"tag"`
	Digest     string    `json:"digest"`
	Size       int64     `json:"size"`
	PushedAt   time.Time `json:"pushed_at"`
}

ImageTag describes a container image in a registry.

type InstanceStatus

type InstanceStatus struct {
	ID      string `json:"id"`
	Status  string `json:"status"` // "running", "pending", "stopped", "failed"
	Health  string `json:"health"` // "healthy", "unhealthy", "unknown"
	Address string `json:"address"`
}

InstanceStatus describes the state of an individual instance within a deployment.

type Metrics

type Metrics struct {
	CPU           float64        `json:"cpu"`
	Memory        float64        `json:"memory"`
	RequestCount  int64          `json:"request_count"`
	ErrorRate     float64        `json:"error_rate"`
	Latency       time.Duration  `json:"latency"`
	CustomMetrics map[string]any `json:"custom_metrics"`
}

Metrics holds resource and request metrics for a deployment.

type RegistryAuth

type RegistryAuth struct {
	Username      string `json:"username"`
	Password      string `json:"password"` //nolint:gosec // G117: registry auth config field
	Token         string `json:"token"`
	ServerAddress string `json:"server_address"`
}

RegistryAuth holds credentials for authenticating with a container registry.

Jump to

Keyboard shortcuts

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