Documentation ¶
Overview ¶
Package domain keeps shared structures, constants and functions.
Index ¶
Constants ¶
View Source
const ( ScriptsDirectoryName = "scripts" SystemdDirectoryName = "systemd" )
Scripts and systemd units path.
View Source
const DeloreanMountPoint = "/run/delorean"
DeloreanMountPoint is a mount point where subvolumes will be mount and where snapshots will be reachable.
View Source
const DeloreanPath = "/usr/local/delorean"
DeloreanPath is a path to delorean config and scripts.
View Source
const RWFileMode = 0o600
View Source
const SnapshotFormat = "2006-01-02_15:04:05"
SnapshotFormat is a format of snapshots names.
View Source
const SnapshotsDirName = ".snapshots"
SnapshotsDirName represents main snapsshots root directory name.
View Source
const Subvol5 = "subvol5"
Subvol5 represents subvolume with id = 5. A top level subvolume.
Variables ¶
View Source
var ErrSnapshotIsNotChosen = errors.New("snapshot is not chosen")
Functions ¶
Types ¶
type Device ¶
type Device struct { UUID string `json:"uuid"` Path string `json:"path"` MountPoint string `json:"mount_point"` }
Device represent LVM device.
type Schedule ¶
type Schedule struct { Monthly int `json:"monthly"` Weekly int `json:"weekly"` Daily int `json:"daily"` Hourly int `json:"hourly"` Boot int `json:"boot"` }
Schedule represents the settings of scheduled snapshots.
type Snapshot ¶
type Snapshot struct { ID uint64 `json:"id"` Path string `json:"path"` Label string `json:"label"` Type SnapshotType `json:"type"` // manual, weekly, daily, etc. Timestamp int64 `json:"timestamp"` Kernel string `json:"kernel"` Volume Volume `json:"volume"` }
Snapshot represents snapshot object, keeps all needed data.
func NewSnapshot ¶
func NewSnapshot(phToSnapshots, kernel string, vol Volume, sType SnapshotType) Snapshot
NewSnapshot creates a new snapshot object.
type SnapshotType ¶
type SnapshotType string
const ( Monthly SnapshotType = "monthly" Weekly SnapshotType = "weekly" Daily SnapshotType = "daily" Hourly SnapshotType = "hourly" Boot SnapshotType = "boot" Manual SnapshotType = "manual" Restore SnapshotType = "restore" )
Snapshots types.
func (SnapshotType) String ¶
func (s SnapshotType) String() string
type SortableSnapshots ¶
type SortableSnapshots []Snapshot
func (SortableSnapshots) Len ¶
func (ss SortableSnapshots) Len() int
func (SortableSnapshots) Less ¶
func (ss SortableSnapshots) Less(i, j int) bool
func (SortableSnapshots) Swap ¶
func (ss SortableSnapshots) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.