snapper

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnapshotsPath = ".snapshots"
	Installer     = "/usr/lib/snapper/installation-helper"
)

Variables

This section is empty.

Functions

func ConfigName

func ConfigName(path string) string

Types

type Metadata

type Metadata map[string]string

func (Metadata) String

func (m Metadata) String() string

type Snapper

type Snapper struct {
	// contains filtered or unexported fields
}

func New

func New(s *sys.System) *Snapper

func (Snapper) Cleanup

func (sn Snapper) Cleanup(root string, maxSnaps int) error

func (Snapper) ConfigureRoot

func (sn Snapper) ConfigureRoot(snapshotPath string, maxSnapshots int) error

ConfigureRoot sets the 'root' configuration for snapper

func (Snapper) CreateConfig

func (sn Snapper) CreateConfig(root, volumePath string) error

func (Snapper) CreateSnapshot

func (sn Snapper) CreateSnapshot(root string, config string, base int, rw bool, description string, metadata Metadata) (int, error)

CreateSnapshot creates a new snapper snapshot by calling "snapper create"

func (Snapper) DeleteByPath

func (sn Snapper) DeleteByPath(path string) error

DeleteByPath removes the given snapshot path including any nested RO subvolume

func (Snapper) FirstRootSnapshot

func (sn Snapper) FirstRootSnapshot(root string, metadata Metadata) (int, error)

func (Snapper) InitRootVolumes

func (sn Snapper) InitRootVolumes(root string) error

func (Snapper) ListSnapshots

func (sn Snapper) ListSnapshots(root string, config string) (Snapshots, error)

func (Snapper) SetDefault

func (sn Snapper) SetDefault(root string, id int, metadata Metadata) error

func (Snapper) SetPermissions

func (sn Snapper) SetPermissions(root string, id int, rw bool) error

func (Snapper) Status

func (sn Snapper) Status(root, config, output string, num1, num2 int) error

type Snapshot

type Snapshot struct {
	Number   int      `json:"number"`
	Default  bool     `json:"default"`
	Active   bool     `json:"active"`
	UserData Metadata `json:"userdata,omitempty"`
}

type Snapshots

type Snapshots []*Snapshot

func (Snapshots) GetActive

func (s Snapshots) GetActive() int

func (Snapshots) GetDefault

func (s Snapshots) GetDefault() int

func (Snapshots) GetWithUserdata

func (s Snapshots) GetWithUserdata(key, value string) []int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL