Documentation
¶
Overview ¶
Package infra provides infrastructure provider abstraction and factory.
Index ¶
- Constants
- Variables
- func NewProvider(config provider.ProviderConfig, logger *slog.Logger) (provider.Provider, error)
- func NewProviderWithOptions(opts ProviderOptions) (provider.Provider, error)
- func ValidateLoadBalancers(ctx context.Context, cfg *config.Config, localDB *localdb.DB, ...) error
- type CreateInstanceRequest
- type CreateInstanceResponse
- type DeregisterLBRequest
- type HighestProviderIDFunc
- type InstanceStatus
- type LeaderNetwork
- type ListInstancesRequest
- type ListInstancesResponse
- type ListLBInstancesRequest
- type LoadBalancerConfig
- type Provider
- type ProviderConfig
- type ProviderOptions
- type RegisterLBRequest
Constants ¶
const ( StatusPending = provider.StatusPending StatusRunning = provider.StatusRunning StatusStopping = provider.StatusStopping StatusStopped = provider.StatusStopped StatusSuspending = provider.StatusSuspending StatusSuspended = provider.StatusSuspended StatusDeleting = provider.StatusDeleting StatusDeleted = provider.StatusDeleted StatusRepairing = provider.StatusRepairing StatusUnknown = provider.StatusUnknown )
Re-export status constants
Variables ¶
var IsUnhealthy = provider.IsUnhealthy
Re-export helper functions
Functions ¶
func NewProvider ¶
NewProvider creates a Provider based on the configuration
func NewProviderWithOptions ¶
func NewProviderWithOptions(opts ProviderOptions) (provider.Provider, error)
NewProviderWithOptions creates a Provider with full options
func ValidateLoadBalancers ¶
func ValidateLoadBalancers(ctx context.Context, cfg *config.Config, localDB *localdb.DB, provider Provider, logger *slog.Logger) error
ValidateLoadBalancers validates all configured load balancers on leader election It queries each LB group via provider APIs and warms the SQLite cache with existing associations
Types ¶
type CreateInstanceRequest ¶
type CreateInstanceRequest = provider.CreateInstanceRequest
type CreateInstanceResponse ¶
type CreateInstanceResponse = provider.CreateInstanceResponse
type DeregisterLBRequest ¶
type DeregisterLBRequest = provider.DeregisterLBRequest
type HighestProviderIDFunc ¶
HighestProviderIDFunc returns the highest known numeric provider instance ID from an external source (e.g. the local database). Used by providers that allocate numeric instance IDs to avoid reusing recently freed values.
type InstanceStatus ¶
type InstanceStatus = provider.InstanceStatus
type LeaderNetwork ¶
type LeaderNetwork = provider.LeaderNetwork
type ListInstancesRequest ¶
type ListInstancesRequest = provider.ListInstancesRequest
type ListInstancesResponse ¶
type ListInstancesResponse = provider.ListInstancesResponse
type ListLBInstancesRequest ¶
type ListLBInstancesRequest = provider.ListLBInstancesRequest
type LoadBalancerConfig ¶
type LoadBalancerConfig = provider.LoadBalancerConfig
type ProviderConfig ¶
type ProviderConfig = provider.ProviderConfig
type ProviderOptions ¶
type ProviderOptions struct {
Config provider.ProviderConfig
Logger *slog.Logger
Shard string // Shard ID (used by dev provider for tmux session naming)
DevK8sDir string // Only used by dev provider - directory where dev-k8s stores resources
RegistrationAddr string // Only used by dev provider - server registration address for agents
AgentAddr string // Only used by dev provider - server agent RPC address for agents
HighestProviderID HighestProviderIDFunc // Optional callback for providers that allocate numeric instance IDs
}
ProviderOptions contains options for creating a provider
type RegisterLBRequest ¶
type RegisterLBRequest = provider.RegisterLBRequest
Directories
¶
| Path | Synopsis |
|---|---|
|
Package aws provides AWS EC2 and load balancer implementation of the infrastructure provider interface.
|
Package aws provides AWS EC2 and load balancer implementation of the infrastructure provider interface. |
|
Package gcp provides Google Cloud Compute Engine implementation of the infrastructure provider interface.
|
Package gcp provides Google Cloud Compute Engine implementation of the infrastructure provider interface. |
|
Package mock provides a test mock implementation of the infrastructure provider interface.
|
Package mock provides a test mock implementation of the infrastructure provider interface. |
|
Package provider defines the infrastructure provider interface for instance and load balancer operations.
|
Package provider defines the infrastructure provider interface for instance and load balancer operations. |
|
Package proxmox implements the Nstance provider interface for Proxmox VE.
|
Package proxmox implements the Nstance provider interface for Proxmox VE. |
|
Package tmux provides local development implementation of the infrastructure provider interface using tmux.
|
Package tmux provides local development implementation of the infrastructure provider interface using tmux. |