engine

package
v0.0.0-...-160a1fa Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	DefaultArgs []string
	Output      map[string]utils.OutputFormat
}

Engine stores informations to use Restic backup engine

func (*Engine) Backup

func (r *Engine) Backup(backupPath, hostname string, force bool) string

Backup performs the backup of the passed volume

func (*Engine) GetBackupDates

func (r *Engine) GetBackupDates() (latestSnapshotDate, oldestSnapshotDate time.Time, err error)

GetBackupDates runs a Restic command locally to retrieve latest snapshot date

func (*Engine) GetName

func (*Engine) GetName() string

GetName returns the engine name

func (*Engine) RawCommand

func (r *Engine) RawCommand(cmd []string) (err error)

RawCommand runs a custom Restic command locally

func (*Engine) Restore

func (r *Engine) Restore(
	backupPath,
	hostname string,
	force bool,
	snapshotName string,
) string

Restore performs the restore of the passed volume

type Snapshot

type Snapshot struct {
	Time     time.Time `json:"time"`
	Parent   string    `json:"parent"`
	Tree     string    `json:"tree"`
	Path     []string  `json:"path"`
	Hostname string    `json:"hostname"`
	ID       string    `json:"id"`
	ShortID  string    `json:"short_id"`
}

Snapshot is a struct returned by the function snapshots()

Jump to

Keyboard shortcuts

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