Documentation
¶
Index ¶
- func CheckpointsDir() string
- func CleanupShareDir(bundleID string)
- func CreateCheckpoint(providerName, name string, rt provider.ContainerRuntime) error
- func DecryptFile(inputPath, outputPath, passphrase string) error
- func DeleteCheckpoint(name string) error
- func DownloadFromGCS(gsURI, outputPath string) error
- func DownloadFromS3(s3URI, outputPath string) error
- func EncryptFile(inputPath, outputPath, passphrase string) error
- func GenerateJSON(r *DumpReport) string
- func GenerateMarkdown(r *DumpReport) string
- func GeneratePassphrase() string
- func ParseRelay(relayConfig string) (backend string, uri string, err error)
- func RestoreCheckpoint(providerName, name string, rt provider.ContainerRuntime) error
- func ShareDir() string
- func UploadToGCS(filePath, gsURI string) error
- func UploadToS3(filePath, s3URI string) error
- type BundleManifest
- type BundleResult
- type CheckpointInfo
- type ContainerDiagnostic
- type DumpReport
- type RedactedConfig
- type TopologyStatus
- type TunnelDiagnostic
- type VMStatus
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 CleanupShareDir ¶ added in v0.38.0
func CleanupShareDir(bundleID string)
CleanupShareDir removes artifacts in the share directory for a specific ID.
func CreateCheckpoint ¶
func CreateCheckpoint(providerName, name string, rt provider.ContainerRuntime) error
CreateCheckpoint snapshots all running devx-managed containers using podman's CRIU integration.
func DecryptFile ¶ added in v0.38.0
DecryptFile decrypts a file using AES-256-GCM.
func DeleteCheckpoint ¶
DeleteCheckpoint completely removes a checkpoint and its archives.
func DownloadFromGCS ¶ added in v0.38.0
DownloadFromGCS downloads a file using the Google Cloud CLI.
func DownloadFromS3 ¶ added in v0.38.0
DownloadFromS3 downloads a file using the AWS CLI.
func EncryptFile ¶ added in v0.38.0
EncryptFile encrypts a file using AES-256-GCM. The output file format is: [Salt(32 bytes)] + [Nonce(12 bytes)] + [Ciphertext + Tag]
func GenerateMarkdown ¶
func GenerateMarkdown(r *DumpReport) string
GenerateMarkdown converts the diagnostic dump into a readable markdown string.
func GeneratePassphrase ¶ added in v0.38.0
func GeneratePassphrase() string
GeneratePassphrase generates a 4-word mnemonic passphrase from a 2048-word BIP-39 English subset. Each word provides ~11 bits of entropy; 4 words = ~44 bits. Combined with PBKDF2 key stretching (600k iterations), this provides strong protection for ephemeral state bundles.
func ParseRelay ¶ added in v0.38.0
ParseRelay determines the backend type and normalized URI from a config string. Currently supports s3:// and gs:// prefixes. TODO(Idea 56): Implement HTTP relay support (e.g., https://transfer.sh) as a fallback for users without cloud credentials.
func RestoreCheckpoint ¶
func RestoreCheckpoint(providerName, name string, rt provider.ContainerRuntime) 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.
func ShareDir ¶ added in v0.38.0
func ShareDir() string
ShareDir returns the base directory for state sharing operations.
func UploadToGCS ¶ added in v0.38.0
UploadToGCS uploads a file using the Google Cloud CLI.
func UploadToS3 ¶ added in v0.38.0
UploadToS3 uploads a file using the AWS CLI.
Types ¶
type BundleManifest ¶ added in v0.38.0
type BundleManifest struct {
ID string `json:"id"`
Mode string `json:"mode"` // "full" or "db-only"
CheckpointName string `json:"checkpoint_name"`
Containers []string `json:"containers,omitempty"` // Filenames of CRIU archives
Databases []database.SnapshotMeta `json:"databases,omitempty"`
SizeBytes int64 `json:"size_bytes"`
}
BundleManifest describes the contents of a state replication bundle.
func UnbundleState ¶ added in v0.38.0
func UnbundleState(archivePath, extractDir string) (*BundleManifest, error)
UnbundleState extracts a bundle archive to a temporary directory and parses its manifest.
type BundleResult ¶ added in v0.38.0
type BundleResult struct {
ArchivePath string
Manifest BundleManifest
}
BundleResult holds the result of a bundling operation.
func BundleState ¶ added in v0.38.0
func BundleState(checkpointName, bundleID string, dbSnapshots []database.SnapshotMeta, fullMode bool) (*BundleResult, error)
BundleState bundles CRIU checkpoints and database snapshots into a single tar.gz archive.
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 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, prov *provider.Provider, vmState string, tsStatus string) (*DumpReport, error)
GenerateDump orchestrates the collection of state for all sub-systems.
type RedactedConfig ¶
type TopologyStatus ¶
type TopologyStatus struct {
DevxManagedContainers []ContainerDiagnostic `json:"devx_managed_containers"`
}