backup

package
v0.0.0-...-5a493b6 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg config.Config, env Env, opts Opts) error

Run runs the given backup configuration.

Types

type Env

type Env struct {
	Sio     StateIOer
	Clock   clockwork.Clock
	Fs      afero.Fs
	Runner  exec.Runner
	Secrets SecretGetter
}

Env groups together the environment a backup is ran against.

type Info

type Info struct {
	// Since contains how long ago the backup was performed.
	// Zero is a special value meaning "never".
	Since  time.Duration
	Backup config.Backup
}

Info represents the state of a backup.

func ComputeOutdated

func ComputeOutdated(ctx context.Context, cfg config.Config, env Env) ([]Info, error)

ComputeOutdated returns the list of outdated backups.

func (Info) String

func (i Info) String() string

type Opts

type Opts struct {
	DryRun     bool
	AskSecrets bool
}

Opts groups contains backup options.

type SecretGetter

type SecretGetter interface {
	Secret(backup string, s config.Secret) string
}

SecretGetter returns the value of a secret.

type StateIOer

type StateIOer interface {
	Save(buf []byte) error
	Load() ([]byte, error)
}

StateIOer abstracts away lower level save and load functionality for the backup state.

Jump to

Keyboard shortcuts

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