Documentation
¶
Overview ¶
Package snapshotmode defines the user-visible mode of a snapshot artifact.
A mode describes what a snapshot contains, never how a sandbox behaves after it has been started: pause/resume always carry memory and have no mode.
Index ¶
Constants ¶
const ( ErrFilesystemOnlyUnsupported = "snapshot_filesystem_only_unsupported_node" ErrFilesystemOnlyNodeUnknown = "snapshot_filesystem_only_node_capability_unknown" ErrFilesystemOnlyNotReady = "snapshot_filesystem_only_not_ready" ErrFilesystemOnlyRollback = "snapshot_filesystem_only_rollback_unsupported" ErrFilesystemOnlyCatalog = "snapshot_filesystem_only_catalog_missing" ErrFilesystemOnlyGuestRuntime = "snapshot_filesystem_only_guest_runtime_mismatch" ErrFilesystemOnlyFreezeUnsupported = "snapshot_filesystem_only_freeze_unsupported" ErrFilesystemOnlyFreezeFailed = "snapshot_filesystem_only_freeze_failed" ErrFilesystemOnlyThawFailed = "snapshot_filesystem_only_thaw_failed" ErrFilesystemOnlyRootfsUnsupported = "snapshot_filesystem_only_rootfs_unsupported" ErrFilesystemOnlyMultiContainer = "snapshot_filesystem_only_multi_container_unsupported" ErrFilesystemOnlyRestoreFailed = "snapshot_filesystem_only_restore_failed" ErrSnapshotMemoryMissing = "snapshot_memory_missing" ErrSnapshotModeInvalid = "snapshot_mode_invalid" ErrSnapshotModeConflict = "snapshot_mode_conflict" )
Stable error identifiers shared by CubeMaster and Cubelet. They describe the filesystem-only feature, not a mode literal, so the names are intentionally independent of the canonical "fs-only" wire value.
const AliasFilesystem = "filesystem"
AliasFilesystem is the E2B 2.55 wire value accepted at API boundaries only. It is normalized to FsOnly and must never be written to a response, the database, a catalog entry, or a log field that describes a stored artifact.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
Kind classifies a failure that carries one of the stable identifiers above.
const ( // KindOther means the message carries no stable identifier; callers keep // their existing default classification. KindOther Kind = iota // KindClientError means the request itself is invalid (HTTP 400). KindClientError // KindPrecondition means the request is valid but the cluster or the // artifact cannot satisfy it (HTTP 409). KindPrecondition // arrived yet; the caller may retry (HTTP 503). KindUnavailable )
func Classify ¶
Classify reports how a failure that carries a stable identifier should be surfaced.
Identifiers travel inside larger messages: Cubelet wraps them ("failed to capture sandbox snapshot: <id>: ...") and Master stores that text in the job's error_message, so the match is by containment. Callers must not depend on the identifier being the first token.
type Mode ¶
type Mode string
Mode is the canonical snapshot artifact mode.
func Normalize ¶
Normalize maps stored or internal values to a canonical mode. Empty means full: the mode column was added after full snapshots already existed. Values that were never written by this build also fall back to full, because the only historical rows are full rows. Client input must go through Parse so an unknown value is rejected instead of silently becoming full.
func Parse ¶
Parse accepts canonical values and the E2B compatibility alias. An empty string is not a mode: callers that treat "missing" as the default must use Normalize instead. The returned value is always canonical.