infra

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package infra provides infrastructure provider abstraction and factory.

Index

Constants

View Source
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

View Source
var IsUnhealthy = provider.IsUnhealthy

Re-export helper functions

Functions

func NewProvider

func NewProvider(config provider.ProviderConfig, logger *slog.Logger) (provider.Provider, error)

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

type HighestProviderIDFunc func(ctx context.Context) (int64, error)

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 Provider

type Provider = provider.Provider

Re-export commonly used types and interfaces for convenience

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.

Jump to

Keyboard shortcuts

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