Documentation
¶
Index ¶
- func CheckDockerInstalled() error
- func CheckFlyctlInstalled() error
- func GetDockerVersion() (string, error)
- func GetFlyctlVersion() (string, error)
- type DockerClient
- func (d *DockerClient) Build(appDir string) error
- func (d *DockerClient) Destroy() error
- func (d *DockerClient) Exec(command ...string) (string, error)
- func (d *DockerClient) GetContainerURL() string
- func (d *DockerClient) InspectFilesystem() (map[string]string, error)
- func (d *DockerClient) Logs(lines int) (string, error)
- func (d *DockerClient) Remove() error
- func (d *DockerClient) RemoveImage() error
- func (d *DockerClient) Run() error
- func (d *DockerClient) Status() (*DockerContainerStatus, error)
- func (d *DockerClient) Stop() error
- func (d *DockerClient) WaitForReady(timeout time.Duration) error
- type DockerContainerStatus
- type FlyAppStatus
- type FlyClient
- func (f *FlyClient) CreateVolume(appName, region string, sizeGB int) (string, error)
- func (f *FlyClient) Deploy(appName, appDir string, region string) error
- func (f *FlyClient) Destroy(appName string) error
- func (f *FlyClient) GetAppURL(appName string) (string, error)
- func (f *FlyClient) Launch(appName, region string) error
- func (f *FlyClient) ListApps() ([]string, error)
- func (f *FlyClient) Status(appName string) (*FlyAppStatus, error)
- func (f *FlyClient) WaitForAppReady(appName string, timeout time.Duration) error
- type MockAppStatus
- type MockFlyClient
- func (m *MockFlyClient) CreateVolume(appName, region string, sizeGB int) (string, error)
- func (m *MockFlyClient) Deploy(appName, appDir string) error
- func (m *MockFlyClient) Destroy(appName string) error
- func (m *MockFlyClient) GetAppURL(appName string) (string, error)
- func (m *MockFlyClient) Launch(appName, region string) error
- func (m *MockFlyClient) ListApps() []*MockAppStatus
- func (m *MockFlyClient) ListVolumes() []*MockVolume
- func (m *MockFlyClient) Reset()
- func (m *MockFlyClient) Status(appName string) (*MockAppStatus, error)
- func (m *MockFlyClient) WaitForAppReady(appName string, timeout time.Duration) error
- type MockVolume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDockerInstalled ¶
func CheckDockerInstalled() error
CheckDockerInstalled verifies that docker is installed and accessible
func CheckFlyctlInstalled ¶
func CheckFlyctlInstalled() error
CheckFlyctlInstalled verifies that flyctl is installed and accessible
func GetDockerVersion ¶
GetDockerVersion returns the installed docker version
func GetFlyctlVersion ¶
GetFlyctlVersion returns the installed flyctl version
Types ¶
type DockerClient ¶
DockerClient wraps docker CLI commands for local Docker deployments
func NewDockerClient ¶
func NewDockerClient(containerName string, port int) *DockerClient
NewDockerClient creates a new Docker client
func (*DockerClient) Build ¶
func (d *DockerClient) Build(appDir string) error
Build builds a Docker image from the app directory with caching enabled
func (*DockerClient) Destroy ¶
func (d *DockerClient) Destroy() error
Destroy removes the container and optionally the image Set DOCKER_CLEANUP_IMAGES=1 to remove images (default: keep for caching)
func (*DockerClient) Exec ¶
func (d *DockerClient) Exec(command ...string) (string, error)
Exec runs a command inside the running container
func (*DockerClient) GetContainerURL ¶
func (d *DockerClient) GetContainerURL() string
GetContainerURL returns the URL to access the container
func (*DockerClient) InspectFilesystem ¶
func (d *DockerClient) InspectFilesystem() (map[string]string, error)
InspectFilesystem logs the container's filesystem for debugging
func (*DockerClient) Logs ¶
func (d *DockerClient) Logs(lines int) (string, error)
Logs retrieves the last N lines of logs from the container
func (*DockerClient) Remove ¶
func (d *DockerClient) Remove() error
Remove removes the Docker container
func (*DockerClient) RemoveImage ¶
func (d *DockerClient) RemoveImage() error
RemoveImage removes the Docker image
func (*DockerClient) Run ¶
func (d *DockerClient) Run() error
Run starts a Docker container from the built image
func (*DockerClient) Status ¶
func (d *DockerClient) Status() (*DockerContainerStatus, error)
Status returns the status of the Docker container
func (*DockerClient) WaitForReady ¶
func (d *DockerClient) WaitForReady(timeout time.Duration) error
WaitForReady waits for the container to be ready and responding to HTTP requests
type DockerContainerStatus ¶
DockerContainerStatus represents the status of a Docker container
type FlyAppStatus ¶
type FlyAppStatus struct {
Name string
Status string
Hostname string
Version int
Deployed bool
Allocation string
}
FlyAppStatus represents the status of a Fly.io app
type FlyClient ¶
FlyClient wraps flyctl CLI commands for Fly.io deployments
func NewFlyClient ¶
NewFlyClient creates a new Fly.io client
func (*FlyClient) CreateVolume ¶
CreateVolume creates a volume for a Fly.io app
type MockAppStatus ¶
type MockAppStatus struct {
Name string
Status string // "running", "stopped", "deploying"
URL string
Region string
CreatedAt time.Time
Deployed bool
}
MockAppStatus represents the status of a mock app
type MockFlyClient ¶
type MockFlyClient struct {
// Simulated state
Apps map[string]*MockAppStatus
Volumes map[string]*MockVolume
// Configuration
SimulateDelay bool // If true, adds realistic delays
SimulateFailures bool // If true, randomly fails operations
FailureRate float64 // Probability of failure (0.0 - 1.0)
DeployDuration time.Duration // How long to simulate deployment
}
MockFlyClient simulates Fly.io API calls for fast testing without actual deployments
func NewMockFlyClient ¶
func NewMockFlyClient() *MockFlyClient
NewMockFlyClient creates a new mock Fly.io client
func (*MockFlyClient) CreateVolume ¶
func (m *MockFlyClient) CreateVolume(appName, region string, sizeGB int) (string, error)
CreateVolume creates a mock volume
func (*MockFlyClient) Deploy ¶
func (m *MockFlyClient) Deploy(appName, appDir string) error
Deploy simulates deploying an app
func (*MockFlyClient) Destroy ¶
func (m *MockFlyClient) Destroy(appName string) error
Destroy removes a mock app and its volumes
func (*MockFlyClient) GetAppURL ¶
func (m *MockFlyClient) GetAppURL(appName string) (string, error)
GetAppURL returns the mock URL for an app
func (*MockFlyClient) Launch ¶
func (m *MockFlyClient) Launch(appName, region string) error
Launch creates a new mock app
func (*MockFlyClient) ListApps ¶
func (m *MockFlyClient) ListApps() []*MockAppStatus
ListApps returns all mock apps
func (*MockFlyClient) ListVolumes ¶
func (m *MockFlyClient) ListVolumes() []*MockVolume
ListVolumes returns all mock volumes
func (*MockFlyClient) Status ¶
func (m *MockFlyClient) Status(appName string) (*MockAppStatus, error)
Status returns the status of a mock app
func (*MockFlyClient) WaitForAppReady ¶
func (m *MockFlyClient) WaitForAppReady(appName string, timeout time.Duration) error
WaitForAppReady simulates waiting for app to be ready