state

package
v0.27.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckpointsDir

func CheckpointsDir() string

CheckpointsDir returns the directory where state checkpoints are stored.

func CreateCheckpoint

func CreateCheckpoint(providerName, name string) error

CreateCheckpoint snapshots all running devx-managed containers using podman's CRIU integration.

func DeleteCheckpoint

func DeleteCheckpoint(name string) error

DeleteCheckpoint completely removes a checkpoint and its archives.

func GenerateJSON

func GenerateJSON(r *DumpReport) string

GenerateJSON stringifies the report.

func GenerateMarkdown

func GenerateMarkdown(r *DumpReport) string

GenerateMarkdown converts the diagnostic dump into a readable markdown string.

func RestoreCheckpoint

func RestoreCheckpoint(providerName, name string) error

RestoreCheckpoint restores all containers associated with the named checkpoint. Restores are performed sequentially to avoid port-binding races when CRIU re-binds the original network sockets.

Types

type CheckpointInfo

type CheckpointInfo struct {
	Name           string `json:"name"`
	ContainerCount int    `json:"container_count"`
	SizeBytes      int64  `json:"size_bytes"`
	CreatedAt      string `json:"created_at"`
}

CheckpointInfo holds metadata about a stored checkpoint.

func ListCheckpoints

func ListCheckpoints() ([]CheckpointInfo, error)

ListCheckpoints returns metadata for all existing checkpoints.

type ContainerDiagnostic

type ContainerDiagnostic struct {
	Name  string `json:"name"`
	Image string `json:"image,omitempty"`
	State string `json:"state"`
	Logs  string `json:"logs,omitempty"`
}

type DumpReport

type DumpReport struct {
	DoctorReport *doctor.Report     `json:"doctor_report"`
	VM           VMStatus           `json:"vm_status"`
	Topology     TopologyStatus     `json:"topology"`
	Tunnels      []TunnelDiagnostic `json:"tunnels"`
	Config       RedactedConfig     `json:"redacted_config"`
}

DumpReport represents the full topological and contextual state of the devx environment.

func GenerateDump

func GenerateDump(cfg *config.Config, vmProviderName string, vmState string, tsStatus string) (*DumpReport, error)

GenerateDump orchestrates the collection of state for all sub-systems.

type RedactedConfig

type RedactedConfig struct {
	YamlContent string `json:"yaml_content,omitempty"`
	EnvContent  string `json:"env_content,omitempty"`
}

type TopologyStatus

type TopologyStatus struct {
	DevxManagedContainers []ContainerDiagnostic `json:"devx_managed_containers"`
}

type TunnelDiagnostic

type TunnelDiagnostic struct {
	Name   string `json:"name"`
	Domain string `json:"domain"`
}

type VMStatus

type VMStatus struct {
	Name      string `json:"name"`
	Provider  string `json:"provider"`
	State     string `json:"state"`
	Tailscale string `json:"tailscale"`
}

Jump to

Keyboard shortcuts

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