repo

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandEnv

func ExpandEnv(s string) string

ExpandEnv expands environment variables of the form ${VAR} in a string.

func InstanceIDFromTags

func InstanceIDFromTags(tags []string) string

InstanceIDFromTags returns the instance ID from the tags, or an empty string if not found.

func PlanFromTags

func PlanFromTags(tags []string) string

PlanFromTags returns the plan ID from the tags, or an empty string if not found.

func TagForInstance

func TagForInstance(instanceId string) string

TagForInstance returns a tag for the instance.

func TagForPlan

func TagForPlan(planId string) string

TagForPlan returns a tag for the plan.

Types

type RepoOrchestrator

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

RepoOrchestrator implements higher level repository operations on top of the restic package. It can be thought of as a controller for a repo.

func NewRepoOrchestrator

func NewRepoOrchestrator(config *v1.Config, repoConfig *v1.Repo, resticPath string) (*RepoOrchestrator, error)

NewRepoOrchestrator accepts a config and a repo that is configured with the properties of that config object.

func (*RepoOrchestrator) AddTags

func (r *RepoOrchestrator) AddTags(ctx context.Context, snapshotIDs []string, tags []string) error

func (*RepoOrchestrator) Backup

func (r *RepoOrchestrator) Backup(ctx context.Context, plan *v1.Plan, progressCallback func(event *restic.BackupProgressEntry)) (*restic.BackupProgressEntry, error)

func (*RepoOrchestrator) Check added in v1.1.0

func (r *RepoOrchestrator) Check(ctx context.Context, output io.Writer) error

func (*RepoOrchestrator) Config

func (r *RepoOrchestrator) Config() *v1.Repo

func (*RepoOrchestrator) Forget

func (r *RepoOrchestrator) Forget(ctx context.Context, plan *v1.Plan, tags []string) ([]*v1.ResticSnapshot, error)

func (*RepoOrchestrator) ForgetSnapshot

func (r *RepoOrchestrator) ForgetSnapshot(ctx context.Context, snapshotId string) error

func (*RepoOrchestrator) Init

func (r *RepoOrchestrator) Init(ctx context.Context) error

func (*RepoOrchestrator) ListSnapshotFiles

func (r *RepoOrchestrator) ListSnapshotFiles(ctx context.Context, snapshotId string, path string) ([]*v1.LsEntry, error)

func (*RepoOrchestrator) Prune

func (r *RepoOrchestrator) Prune(ctx context.Context, output io.Writer) error

func (*RepoOrchestrator) Restore

func (r *RepoOrchestrator) Restore(ctx context.Context, snapshotId string, path string, target string, progressCallback func(event *v1.RestoreProgressEntry)) (*v1.RestoreProgressEntry, error)

func (*RepoOrchestrator) RunCommand

func (r *RepoOrchestrator) RunCommand(ctx context.Context, command string, onProgress func([]byte)) error

RunCommand runs a command in the repo's environment. Output is buffered and sent to the onProgress callback in batches.

func (*RepoOrchestrator) Snapshots

func (r *RepoOrchestrator) Snapshots(ctx context.Context) ([]*restic.Snapshot, error)

func (*RepoOrchestrator) SnapshotsForPlan

func (r *RepoOrchestrator) SnapshotsForPlan(ctx context.Context, plan *v1.Plan) ([]*restic.Snapshot, error)

func (*RepoOrchestrator) Stats

func (r *RepoOrchestrator) Stats(ctx context.Context) (*v1.RepoStats, error)

func (*RepoOrchestrator) Unlock

func (r *RepoOrchestrator) Unlock(ctx context.Context) error

func (*RepoOrchestrator) UnlockIfAutoEnabled

func (r *RepoOrchestrator) UnlockIfAutoEnabled(ctx context.Context) error

UnlockIfAutoEnabled unlocks the repo if the auto unlock feature is enabled.

Jump to

Keyboard shortcuts

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