pkg

package
v0.0.0-...-6489918 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: BSD-2-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlreadyRunningError = stderrors.New("backup already running")

Functions

func CreateBackupAction

func CreateBackupAction(
	sentryClient libsentry.Client,
	backupExectuor BackupExectuor,
	kubeConfig string,
	namespace k8s.Namespace,
) run.Runnable

func CreateBackupCron

func CreateBackupCron(
	sentryClient libsentry.Client,
	backupExectuor BackupExectuor,
	kubeConfig string,
	namespace k8s.Namespace,
	cronExpression libcron.Expression,
) run.Func

func CreateSetupResourceDefinition

func CreateSetupResourceDefinition(
	kubeConfig string,
	namespace k8s.Namespace,
	trigger run.Fire,
) func(ctx context.Context) error

func NewBackupAction

func NewBackupAction(
	sentryClient libsentry.Client,
	k8sConnector K8sConnector,
	backupExectuor BackupExectuor,
) run.Runnable

Types

type BackupExectuor

type BackupExectuor interface {
	Backup(ctx context.Context, target v1.BackupSpec) error
}

func CreateBackupExectuor

func CreateBackupExectuor(
	currentTimeGetter libtime.CurrentTimeGetter,
	backupRootDirectory Path,
	sshPrivateKey SSHPrivateKey,
) BackupExectuor

func NewBackupExectuor

func NewBackupExectuor(
	currentTimeGetter libtime.CurrentTimeGetter,
	rsyncExectuor RsyncExectuor,
	backupRootDirectory Path,
	sshPrivateKey SSHPrivateKey,
) BackupExectuor

func NewBackupExectuorOnlyOnce

func NewBackupExectuorOnlyOnce(
	backupExectuor BackupExectuor,
) BackupExectuor

type K8sConnector

type K8sConnector interface {
	SetupCustomResourceDefinition(ctx context.Context) error
	Listen(ctx context.Context, resourceEventHandler cache.ResourceEventHandler) error
	Targets(ctx context.Context) (backupv1.Targets, error)
	Target(ctx context.Context, name string) (*backupv1.Target, error)
}

func NewK8sConnector

func NewK8sConnector(
	kubeconfig string,
	namespace k8s.Namespace,
) K8sConnector

type Path

type Path string

func (Path) Exists

func (f Path) Exists(ctx context.Context) (bool, error)

func (Path) Join

func (f Path) Join(elem ...string) Path

func (Path) List

func (f Path) List(ctx context.Context) (Paths, error)

func (Path) Remove

func (f Path) Remove(ctx context.Context) error

func (Path) Rename

func (f Path) Rename(ctx context.Context, path Path) error

func (Path) String

func (f Path) String() string

type Paths

type Paths []Path

type RsyncExectuor

type RsyncExectuor interface {
	Rsync(ctx context.Context, args ...string) error
}

func NewRsyncExectuor

func NewRsyncExectuor() RsyncExectuor

type SSHPrivateKey

type SSHPrivateKey string

func (SSHPrivateKey) String

func (f SSHPrivateKey) String() string

Jump to

Keyboard shortcuts

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