snapshot

package
v0.0.0-...-1708d6c Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, backupID, path, password string) error

Delete deletes Kopia snapshot with given manifest ID

func MarshalKopiaSnapshot

func MarshalKopiaSnapshot(snapInfo *SnapshotInfo) (string, error)

MarshalKopiaSnapshot encodes kopia SnapshotInfo struct into a string

func Read

func Read(ctx context.Context, target io.Writer, backupID, path, password string) error

Read reads a kopia snapshot with the given ID and copies it to the given target

func ReadFile

func ReadFile(ctx context.Context, backupID, target, password string) error

ReadFile restores a kopia snapshot with the given ID to the given target

func SnapshotSource

func SnapshotSource(
	ctx context.Context,
	rep repo.RepositoryWriter,
	u *snapshotfs.Uploader,
	sourceInfo snapshot.SourceInfo,
	rootDir fs.Entry,
	description string,
) (string, int64, error)

SnapshotSource creates and uploads a kopia snapshot to the given repository

Types

type SnapshotInfo

type SnapshotInfo struct {
	// ID is the snapshot ID produced by kopia snapshot operation
	ID string `json:"id"`
	// LogicalSize is the sum of cached and hashed file size in bytes
	LogicalSize int64 `json:"logicalSize"`
	// PhysicalSize is the uploaded size in bytes
	PhysicalSize int64 `json:"physicalSize"`
}

SnapshotInfo tracks kopia snapshot information produced by a kando command in a phase

func UnmarshalKopiaSnapshot

func UnmarshalKopiaSnapshot(snapInfoJSON string) (SnapshotInfo, error)

UnmarshalKopiaSnapshot decodes a kopia snapshot JSON string into SnapshotInfo struct

func Write

func Write(ctx context.Context, source io.ReadCloser, path, password string) (*SnapshotInfo, error)

Write creates a kopia snapshot from the given reader A virtual directory tree rooted at filepath.Dir(path) is created with a kopia streaming file with filepath.Base(path) as name

func WriteFile

func WriteFile(ctx context.Context, path, sourcePath, password string) (*SnapshotInfo, error)

WriteFile creates a kopia snapshot from the given source file

func (*SnapshotInfo) Validate

func (si *SnapshotInfo) Validate() error

Validate validates SnapshotInfo field values

Jump to

Keyboard shortcuts

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