Documentation
¶
Index ¶
- func ExpandEnv(s string) string
- func InstanceIDFromTags(tags []string) string
- func PlanFromTags(tags []string) string
- func TagForInstance(instanceId string) string
- func TagForPlan(planId string) string
- type RepoOrchestrator
- func (r *RepoOrchestrator) AddTags(ctx context.Context, snapshotIDs []string, tags []string) error
- func (r *RepoOrchestrator) Backup(ctx context.Context, plan *v1.Plan, ...) (*restic.BackupProgressEntry, error)
- func (r *RepoOrchestrator) Check(ctx context.Context, output io.Writer) error
- func (r *RepoOrchestrator) Config() *v1.Repo
- func (r *RepoOrchestrator) Forget(ctx context.Context, plan *v1.Plan, tags []string) ([]*v1.ResticSnapshot, error)
- func (r *RepoOrchestrator) ForgetSnapshot(ctx context.Context, snapshotId string) error
- func (r *RepoOrchestrator) Init(ctx context.Context) error
- func (r *RepoOrchestrator) ListSnapshotFiles(ctx context.Context, snapshotId string, path string) ([]*v1.LsEntry, error)
- func (r *RepoOrchestrator) Prune(ctx context.Context, output io.Writer) error
- func (r *RepoOrchestrator) Restore(ctx context.Context, snapshotId string, snapshotPath string, target string, ...) (*v1.RestoreProgressEntry, error)
- func (r *RepoOrchestrator) RunCommand(ctx context.Context, command string, writer io.Writer) error
- func (r *RepoOrchestrator) Snapshots(ctx context.Context) ([]*restic.Snapshot, error)
- func (r *RepoOrchestrator) SnapshotsForPlan(ctx context.Context, plan *v1.Plan) ([]*restic.Snapshot, error)
- func (r *RepoOrchestrator) Stats(ctx context.Context) (*v1.RepoStats, error)
- func (r *RepoOrchestrator) Unlock(ctx context.Context) error
- func (r *RepoOrchestrator) UnlockIfAutoEnabled(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstanceIDFromTags ¶
InstanceIDFromTags returns the instance ID from the tags, or an empty string if not found.
func PlanFromTags ¶
PlanFromTags returns the plan ID from the tags, or an empty string if not found.
func TagForInstance ¶
TagForInstance returns a tag for the instance.
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) Backup ¶
func (r *RepoOrchestrator) Backup(ctx context.Context, plan *v1.Plan, progressCallback func(event *restic.BackupProgressEntry)) (*restic.BackupProgressEntry, 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) ListSnapshotFiles ¶
func (*RepoOrchestrator) Restore ¶
func (r *RepoOrchestrator) Restore(ctx context.Context, snapshotId string, snapshotPath string, target string, progressCallback func(event *v1.RestoreProgressEntry)) (*v1.RestoreProgressEntry, error)
func (*RepoOrchestrator) RunCommand ¶
RunCommand runs a command in the repo's environment. NOTE: this function does not lock the repo.
func (*RepoOrchestrator) SnapshotsForPlan ¶
func (*RepoOrchestrator) UnlockIfAutoEnabled ¶
func (r *RepoOrchestrator) UnlockIfAutoEnabled(ctx context.Context) error
UnlockIfAutoEnabled unlocks the repo if the auto unlock feature is enabled.
Click to show internal directories.
Click to hide internal directories.