snapshotter

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSnapshotter

func NewSnapshotter(cfg types.Config, snapCfg types.SnapshotterConfig, bootloader types.Bootloader) (types.Snapshotter, error)

Types

type Btrfs

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

func (*Btrfs) CloseTransaction

func (b *Btrfs) CloseTransaction(snapshot *types.Snapshot) (err error)

func (*Btrfs) CloseTransactionOnError

func (b *Btrfs) CloseTransactionOnError(snapshot *types.Snapshot) (err error)

func (*Btrfs) DeleteSnapshot

func (b *Btrfs) DeleteSnapshot(id int) error

func (*Btrfs) GetSnapshots

func (b *Btrfs) GetSnapshots() ([]int, error)

func (*Btrfs) InitSnapshotter

func (b *Btrfs) InitSnapshotter(state *types.Partition, efiDir string) error

func (*Btrfs) SnapshotToImageSource

func (b *Btrfs) SnapshotToImageSource(snap *types.Snapshot) (*types.ImageSource, error)

SnapshotImageToSource converts the given snapshot into an ImageSource. This is useful to deploy a system from a given snapshot, for instance setting the recovery image from a snapshot.

func (*Btrfs) StartTransaction

func (b *Btrfs) StartTransaction() (*types.Snapshot, error)

type Date

type Date time.Time

func (Date) MarshalXML

func (d Date) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Date) UnmarshalXML

func (d *Date) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

type LoopDevice

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

func (*LoopDevice) CloseTransaction

func (l *LoopDevice) CloseTransaction(snapshot *types.Snapshot) (err error)

CloseTransaction closes the transaction for the given snapshot. This is the responsible of setting new active and passive snapshots.

func (*LoopDevice) CloseTransactionOnError

func (l *LoopDevice) CloseTransactionOnError(snapshot *types.Snapshot) error

CloseTransactionOnError is a destructor method to clean the given initated snapshot. Useful in case of an error once the transaction has already started.

func (*LoopDevice) DeleteSnapshot

func (l *LoopDevice) DeleteSnapshot(id int) error

DeleteSnapshot deletes the snapshot of the given ID. It cannot delete an snapshot that is actually booted.

func (*LoopDevice) GetSnapshots

func (l *LoopDevice) GetSnapshots() ([]int, error)

GetSnapshots returns a list of the available snapshots IDs.

func (*LoopDevice) InitSnapshotter

func (l *LoopDevice) InitSnapshotter(state *types.Partition, efiDir string) error

InitSnapshotter initiates the snapshotter to the given root directory. More over this method includes logic to migrate from older elemental-toolkit versions.

func (*LoopDevice) SnapshotToImageSource

func (l *LoopDevice) SnapshotToImageSource(snap *types.Snapshot) (*types.ImageSource, error)

SnapshotImageToSource converts the given snapshot into an ImageSource. This is useful to deploy a system from a given snapshot, for instance setting the recovery image from a snapshot.

func (*LoopDevice) StartTransaction

func (l *LoopDevice) StartTransaction() (*types.Snapshot, error)

StartTransaction starts a transaction for this snapshotter instance and returns the work in progress snapshot object.

type SnapperSnapshotXML

type SnapperSnapshotXML struct {
	XMLName     xml.Name `xml:"snapshot"`
	Type        string   `xml:"type"`
	Num         int      `xml:"num"`
	Date        Date     `xml:"date"`
	Cleanup     string   `xml:"cleanup"`
	Description string   `xml:"description"`
}

Jump to

Keyboard shortcuts

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