docker

package
v1.0.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValidationFailed           = errors.New("deployment configuration validation failed")
	ErrPortAllocationFailed       = errors.New("failed to allocate port range")
	ErrPortConflictDetected       = errors.New("allocated ports conflict with host services")
	ErrImagePullFailed            = errors.New("failed to pull Docker image")
	ErrCustomBuildFailed          = errors.New("failed to build custom Docker image")
	ErrContainerStartFailed       = errors.New("failed to start container")
	ErrHealthCheckTimeout         = errors.New("container health check timeout")
	ErrPartialDeployment          = errors.New("partial deployment (some containers failed)")
	ErrOrchestratorRollbackFailed = errors.New("rollback encountered errors")
)

Orchestrator errors

View Source
var (
	ErrDockerDaemonUnavailable = errors.New("docker daemon not accessible")
	ErrInvalidDevnetName       = errors.New("devnet name contains invalid characters")
	ErrNoAvailableSubnets      = errors.New("no available subnets in 172.x.0.0/16 range")
	ErrNetworkCreationFailed   = errors.New("docker network create command failed")
	ErrNetworkNotFound         = errors.New("docker network not found")
	ErrNetworkHasContainers    = errors.New("network has attached containers, cannot delete")
	ErrNetworkDeletionFailed   = errors.New("docker network rm command failed")
)

NetworkManager errors

Functions

This section is empty.

Types

type MultiError

type MultiError struct {
	Errors []error
}

MultiError represents multiple errors

func (*MultiError) Error

func (m *MultiError) Error() string

type NetworkManagerImpl

type NetworkManagerImpl struct{}

NetworkManagerImpl implements the NetworkManager interface

func NewNetworkManager

func NewNetworkManager() *NetworkManagerImpl

NewNetworkManager creates a new network manager

func (*NetworkManagerImpl) CreateNetwork

func (m *NetworkManagerImpl) CreateNetwork(ctx context.Context, devnetName string) (string, string, error)

CreateNetwork creates an isolated bridge network for a devnet

func (*NetworkManagerImpl) DeleteNetwork

func (m *NetworkManagerImpl) DeleteNetwork(ctx context.Context, networkID string) error

DeleteNetwork removes a Docker network

func (*NetworkManagerImpl) GetNetworkSubnet

func (m *NetworkManagerImpl) GetNetworkSubnet(ctx context.Context, networkID string) (string, error)

GetNetworkSubnet retrieves the subnet CIDR for a network

func (*NetworkManagerImpl) ListDevnetNetworks

func (m *NetworkManagerImpl) ListDevnetNetworks(ctx context.Context) ([]ports.NetworkInfo, error)

ListDevnetNetworks returns all networks created by devnet-builder

func (*NetworkManagerImpl) NetworkExists

func (m *NetworkManagerImpl) NetworkExists(ctx context.Context, networkID string) (bool, error)

NetworkExists checks if a network with given ID exists

type OrchestratorImpl

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

OrchestratorImpl implements the DeploymentOrchestrator interface

func NewOrchestrator

func NewOrchestrator(
	networkManager ports.NetworkManager,
	portAllocator ports.PortAllocator,
	dockerManager *node.DockerManager,
	logger *output.Logger,
) *OrchestratorImpl

NewOrchestrator creates a new deployment orchestrator

func (*OrchestratorImpl) Deploy

Deploy orchestrates complete devnet deployment

func (*OrchestratorImpl) GetState

func (o *OrchestratorImpl) GetState(ctx context.Context, devnetName string) (*ports.DeploymentState, error)

GetState retrieves current deployment state for a devnet

func (*OrchestratorImpl) Rollback

func (o *OrchestratorImpl) Rollback(ctx context.Context, state *ports.DeploymentState) error

Rollback manually triggers rollback of a deployment

type PortAllocatorImpl

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

PortAllocatorImpl implements the PortAllocator interface

func NewPortAllocator

func NewPortAllocator(homeDir string) *PortAllocatorImpl

NewPortAllocator creates a new port allocator

func (*PortAllocatorImpl) AllocateRange

func (p *PortAllocatorImpl) AllocateRange(ctx context.Context, devnetName string, validatorCount int) (*ports.PortAllocation, error)

AllocateRange reserves a contiguous port range for a devnet

func (*PortAllocatorImpl) GetAllocation

func (p *PortAllocatorImpl) GetAllocation(ctx context.Context, devnetName string) (*ports.PortAllocation, error)

GetAllocation retrieves allocation details for a devnet

func (*PortAllocatorImpl) ListAllocations

func (p *PortAllocatorImpl) ListAllocations(ctx context.Context) ([]*ports.PortAllocation, error)

ListAllocations returns all active port allocations

func (*PortAllocatorImpl) ReleaseRange

func (p *PortAllocatorImpl) ReleaseRange(ctx context.Context, devnetName string) error

ReleaseRange frees a previously allocated port range

func (*PortAllocatorImpl) ValidatePortAvailability

func (p *PortAllocatorImpl) ValidatePortAvailability(ctx context.Context, allocation *ports.PortAllocation) ([]int, error)

ValidatePortAvailability checks if allocated ports conflict with host services

Jump to

Keyboard shortcuts

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