Documentation ¶
Index ¶
- Constants
- func CmdEnv(backupLocation *velerov1api.BackupStorageLocation, ...) ([]string, error)
- func GetInsecureSkipTLSVerifyFromBSL(backupLocation *velerov1api.BackupStorageLocation, logger logrus.FieldLogger) string
- func GetSnapshotID(snapshotIdCmd *Command) (string, error)
- func RunBackup(backupCmd *Command, log logrus.FieldLogger, updater uploader.ProgressUpdater) (string, string, error)
- func RunRestore(restoreCmd *Command, log logrus.FieldLogger, updater uploader.ProgressUpdater) (string, string, error)
- func TempCACertFile(caCert []byte, bsl string, fs filesystem.Interface) (string, error)
- type Command
- func BackupCommand(repoIdentifier, passwordFile, path string, tags map[string]string) *Command
- func ForgetCommand(repoIdentifier, snapshotID string) *Command
- func GetSnapshotCommand(repoIdentifier, passwordFile string, tags map[string]string) *Command
- func InitCommand(repoIdentifier string) *Command
- func PruneCommand(repoIdentifier string) *Command
- func RestoreCommand(repoIdentifier, passwordFile, snapshotID, target string) *Command
- func SnapshotsCommand(repoIdentifier string) *Command
- func StatsCommand(repoIdentifier, passwordFile, snapshotID string) *Command
- func UnlockCommand(repoIdentifier string) *Command
Constants ¶
const ( // DefaultMaintenanceFrequency is the default time interval // at which restic prune is run. DefaultMaintenanceFrequency = 7 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func CmdEnv ¶ added in v1.6.0
func CmdEnv(backupLocation *velerov1api.BackupStorageLocation, credentialFileStore credentials.FileStore) ([]string, error)
CmdEnv returns a list of environment variables (in the format var=val) that should be used when running a restic command for a particular backend provider. This list is the current environment, plus any provider-specific variables restic needs.
func GetInsecureSkipTLSVerifyFromBSL ¶ added in v1.9.0
func GetInsecureSkipTLSVerifyFromBSL(backupLocation *velerov1api.BackupStorageLocation, logger logrus.FieldLogger) string
GetInsecureSkipTLSVerifyFromBSL get insecureSkipTLSVerify flag from BSL configuration, Then return --insecure-tls flag with boolean value as result.
func GetSnapshotID ¶
GetSnapshotID runs provided 'restic snapshots' command to get the ID of a snapshot and an error if a unique snapshot cannot be identified.
func RunBackup ¶ added in v1.2.0
func RunBackup(backupCmd *Command, log logrus.FieldLogger, updater uploader.ProgressUpdater) (string, string, error)
RunBackup runs a `restic backup` command and watches the output to provide progress updates to the caller.
func RunRestore ¶ added in v1.2.0
func RunRestore(restoreCmd *Command, log logrus.FieldLogger, updater uploader.ProgressUpdater) (string, string, error)
RunRestore runs a `restic restore` command and monitors the volume size to provide progress updates to the caller.
func TempCACertFile ¶ added in v1.4.0
TempCACertFile creates a temp file containing a CA bundle and returns its path. The caller should generally call os.Remove() to remove the file when done with it.
Types ¶
type Command ¶
type Command struct { Command string RepoIdentifier string PasswordFile string CACertFile string Dir string Args []string ExtraFlags []string Env []string }
Command represents a restic command.
func BackupCommand ¶
BackupCommand returns a Command for running a restic backup.
func ForgetCommand ¶
func GetSnapshotCommand ¶
GetSnapshotCommand returns a Command for running a restic (get) snapshots.
func InitCommand ¶
func PruneCommand ¶
func RestoreCommand ¶
RestoreCommand returns a Command for running a restic restore.
func SnapshotsCommand ¶ added in v1.0.0
func StatsCommand ¶ added in v0.10.2
func UnlockCommand ¶ added in v1.0.1
func (*Command) StringSlice ¶
StringSlice returns the command as a slice of strings.