Documentation
¶
Overview ¶
Package snapshot names, labels and groups snapshots: copies of a stack's named volumes, kept as Docker volumes. Everything here is a pure function; copying happens through a helper container (see internal/docker).
Index ¶
Constants ¶
const ( LabelName = "dev.siding.snapshot" LabelVolume = "dev.siding.snapshot-volume" LabelCreated = "dev.siding.snapshot-created" )
Labels of a snapshot volume.
const ( // DefaultName is the snapshot a first up seeds from without --seed (spec seeding). DefaultName = "default" // ReservedName is not a snapshot name: --seed none means no snapshot. ReservedName = "none" )
const Image = "busybox:1.37.0"
Image is the helper image that copies volumes; the devcontainer's SIDING_BUSYBOX_IMAGE is the same.
Variables ¶
This section is empty.
Functions ¶
func CopyHelper ¶
CopyHelper copies the volume from into the volume to.
func ExistsError ¶
ExistsError is the error of saving a snapshot whose name is taken.
func ValidName ¶
ValidName fails with InvalidArguments unless name is lowercase letters, digits and single dashes, at most 40 characters.
func VolumeName ¶
VolumeName is the volume holding one volume of a snapshot. The parts are separated by "_", which neither slugs nor snapshot names contain, so two snapshots never share a volume.
Types ¶
type Snapshot ¶
type Snapshot struct {
Name string
Repo string
Created string
// Volumes maps the stack's volume key to the snapshot volume.
Volumes map[string]string
// Size is the sum of the volumes' sizes, -1 when Docker does not know one of them.
Size int64
}
Snapshot is one snapshot with its volumes.