snapshotting

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snapshot

type Snapshot struct {
	ContainerSnapName string

	Image string
	// contains filtered or unexported fields
}

Snapshot identified by revision Only capitalized fields are serialised / deserialised

func NewSnapshot

func NewSnapshot(id, baseFolder, image string) *Snapshot

func (*Snapshot) Cleanup

func (snp *Snapshot) Cleanup() error

func (*Snapshot) CreateSnapDir

func (snp *Snapshot) CreateSnapDir() error

func (*Snapshot) GetContainerSnapName

func (snp *Snapshot) GetContainerSnapName() string

func (*Snapshot) GetId

func (snp *Snapshot) GetId() string

func (*Snapshot) GetImage

func (snp *Snapshot) GetImage() string

func (*Snapshot) GetInfoFilePath

func (snp *Snapshot) GetInfoFilePath() string

func (*Snapshot) GetMemFilePath

func (snp *Snapshot) GetMemFilePath() string

func (*Snapshot) GetPatchFilePath

func (snp *Snapshot) GetPatchFilePath() string

func (*Snapshot) GetSnapshotFilePath

func (snp *Snapshot) GetSnapshotFilePath() string

func (*Snapshot) LoadSnapInfo

func (snp *Snapshot) LoadSnapInfo(infoPath string) error

LoadSnapInfo loads the snapshot info from a file. This can be useful for remote snapshots.

func (*Snapshot) SerializeSnapInfo

func (snp *Snapshot) SerializeSnapInfo() error

SerializeSnapInfo serializes the snapshot info using gob. This can be useful for remote snapshots

type SnapshotManager

type SnapshotManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SnapshotManager manages snapshots stored on the node.

func NewSnapshotManager

func NewSnapshotManager(baseFolder string) *SnapshotManager

func (*SnapshotManager) AcquireSnapshot

func (mgr *SnapshotManager) AcquireSnapshot(revision string) (*Snapshot, error)

AcquireSnapshot returns a snapshot for the specified revision if it is available.

func (*SnapshotManager) CommitSnapshot

func (mgr *SnapshotManager) CommitSnapshot(revision string) error

CommitSnapshot finalizes the snapshot creation and makes it available for use.

func (*SnapshotManager) InitSnapshot

func (mgr *SnapshotManager) InitSnapshot(revision, image string) (*Snapshot, error)

InitSnapshot initializes a snapshot by adding its metadata to the SnapshotManager. Once the snapshot has been created, CommitSnapshot must be run to finalize the snapshot creation and make the snapshot available for use.

Jump to

Keyboard shortcuts

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