provider

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackupFunc = kopia.Backup

BackupFunc mainly used to make testing more convenient

View Source
var ResticBackupCMDFunc = restic.BackupCommand

mainly used to make testing more convenient

View Source
var ResticRestoreCMDFunc = restic.RestoreCommand
View Source
var RestoreFunc = kopia.Restore

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// RunBackup which will do backup for one specific volume and return snapshotID, isSnapshotEmpty, error
	// updater is used for updating backup progress which implement by third-party
	RunBackup(
		ctx context.Context,
		path string,
		tags map[string]string,
		parentSnapshot string,
		updater uploader.ProgressUpdater) (string, bool, error)
	// RunRestore which will do restore for one specific volume with given snapshot id and return error
	// updater is used for updating backup progress which implement by third-party
	RunRestore(
		ctx context.Context,
		snapshotID string,
		volumePath string,
		updater uploader.ProgressUpdater) error
	// Close which will close related repository
	Close(ctx context.Context) error
}

Provider which is designed for one pod volume to do the backup or restore

func NewKopiaUploaderProvider

func NewKopiaUploaderProvider(
	ctx context.Context,
	credGetter *credentials.CredentialGetter,
	backupRepo *velerov1api.BackupRepository,
	log logrus.FieldLogger,
) (Provider, error)

NewKopiaUploaderProvider initialized with open or create a repository

func NewResticUploaderProvider

func NewResticUploaderProvider(
	repoIdentifier string,
	bsl *velerov1api.BackupStorageLocation,
	credGetter *credentials.CredentialGetter,
	repoKeySelector *v1.SecretKeySelector,
	log logrus.FieldLogger,
) (Provider, error)

func NewUploaderProvider

func NewUploaderProvider(
	ctx context.Context,
	client client.Client,
	uploaderType string,
	repoIdentifier string,
	bsl *velerov1api.BackupStorageLocation,
	backupRepo *velerov1api.BackupRepository,
	credGetter *credentials.CredentialGetter,
	repoKeySelector *v1.SecretKeySelector,
	log logrus.FieldLogger,
) (Provider, error)

NewUploaderProvider initialize provider with specific uploaderType

Jump to

Keyboard shortcuts

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