Documentation ¶
Overview ¶
Snaputil provides utility functions for working with snapshots.
Index ¶
- func GetSnapshotByName(snapshots []*btrfs.RootInfo, name string) *btrfs.RootInfo
- func ResolveSubvolumeDetails(logger *log.Logger, verbosity int, ...) (*btrfs.RootInfo, error)
- func SnapshotSliceContains(ss []*btrfs.RootInfo, name string) bool
- func SnapshotUUIDExists(snapshots []*btrfs.RootInfo, uu uuid.UUID) bool
- func SortSnapshots(snapshots []*btrfs.RootInfo, order SortOrder)
- type IncrementalSnapshot
- type SortOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSnapshotByName ¶
GetSnapshotByName will return the snapshot with the given name from the given slice of snapshots.
func ResolveSubvolumeDetails ¶
func ResolveSubvolumeDetails(logger *log.Logger, verbosity int, subvolumePath, snapshotDirectory, snapshotName string) (*btrfs.RootInfo, error)
ResolveSubvolumeDetails will lookup the information for a subvolume and all its corresponding snapshots. Snapshots are filtered by the given snapshot directory and name.
func SnapshotSliceContains ¶
SnapshotSliceContains will return true if the given slice of snapshots contains the given snapshot.
func SnapshotUUIDExists ¶
SnapshotUUIDExists will return true if the given UUID exists in the given slice of snapshots.
func SortSnapshots ¶
SortSnapshots will sort the given snapshots by their creation time in the given order.
Types ¶
type IncrementalSnapshot ¶
func MapParents ¶
func MapParents(snapshots []*btrfs.RootInfo) []*IncrementalSnapshot
MapParents will map the given snapshots to their parent snapshots. This method assumes that parenthood corresponds to the order of the given snapshots and it will sort them in ascending order of creation time.