backup

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintAll

func PrintAll(ctx context.Context, bs []*Backup)

PrintAll writes the slice of Backups to StdOut, in the format requested by the caller.

Types

type Backup

type Backup struct {
	model.BaseModel
	CreationTime time.Time `json:"creationTime"`

	// SnapshotID is the kopia snapshot ID
	SnapshotID string `json:"snapshotID"`

	// Reference to the details and fault errors storage location.
	// Used to read backup.Details and fault.Errors from the streamstore.
	StreamStoreID string `json:"streamStoreID"`

	// Status of the operation, eg: completed, failed, etc
	Status string `json:"status"`

	// Selector used in this operation
	Selector selectors.Selector `json:"selectors"`

	// TODO: in process of gaining support, most cases will still use
	// ResourceOwner and ResourceOwnerName.
	ProtectedResourceID   string `json:"protectedResourceID,omitempty"`
	ProtectedResourceName string `json:"protectedResourceName,omitempty"`

	// Version represents the version of the backup format
	Version int `json:"version"`

	FailFast bool `json:"failFast"`

	// the quantity of errors, both hard failure and recoverable.
	ErrorCount int `json:"errorCount"`

	// the non-recoverable failure message, only populated if one occurred.
	Failure string `json:"failure"`

	// stats are embedded so that the values appear as top-level properties
	stats.ReadWrites
	stats.StartAndEndTime
	stats.SkippedCounts

	// **Deprecated**
	// Reference to the backup details storage location.
	// Used to read backup.Details from the streamstore.
	DetailsID string `json:"detailsID"`

	// prefer protectedResource
	ResourceOwnerID   string `json:"resourceOwnerID,omitempty"`
	ResourceOwnerName string `json:"resourceOwnerName,omitempty"`
}

Backup represents the result of a backup operation

func New

func New(
	snapshotID, streamStoreID, status string,
	backupVersion int,
	id model.StableID,
	selector selectors.Selector,
	ownerID, ownerName string,
	rw stats.ReadWrites,
	se stats.StartAndEndTime,
	fe *fault.Errors,
	tags map[string]string,
) *Backup

func (Backup) Headers

func (b Backup) Headers(skipID bool) []string

Headers returns the human-readable names of properties in a Backup for printing out to a terminal in a columnar display.

func (Backup) MinimumPrintable

func (b Backup) MinimumPrintable() any

MinimumPrintable reduces the Backup to its minimally printable details.

func (Backup) Print

func (b Backup) Print(ctx context.Context)

Print writes the Backup to StdOut, in the format requested by the caller.

func (Backup) PrintProperties

func (b Backup) PrintProperties(ctx context.Context)

PrintProperties writes the Backup to StdOut, in the format requested by the caller. Unlike Print, it skips the ID of the Backup

func (Backup) ToPrintable

func (b Backup) ToPrintable() Printable

ToPrintable reduces the Backup to its minimally printable details.

func (Backup) Type

func (b Backup) Type() string

Type returns the type of the backup according to the value stored in the Backup's tags. Backup type is used during base finding to determine if a given backup is eligible to be used for the upcoming incremental backup.

func (Backup) Values

func (b Backup) Values(skipID bool) []string

Values returns the values matching the Headers list for printing out to a terminal in a columnar display.

type Printable

type Printable struct {
	ID                    model.StableID `json:"id"`
	Status                string         `json:"status"`
	Version               string         `json:"version"`
	ProtectedResourceID   string         `json:"protectedResourceID,omitempty"`
	ProtectedResourceName string         `json:"protectedResourceName,omitempty"`
	Owner                 string         `json:"owner,omitempty"`
	Stats                 backupStats    `json:"stats"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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