pkg

package
v0.0.0-...-ddc34c0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: BSD-2-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBackupAction

func CreateBackupAction(
	sentryClient libsentry.Client,
	currentTimeGetter libtime.CurrentTimeGetter,
	kubeConfig string,
	backupRootDirectory Path,
	sshKeyPath SSHPrivateKey,
	namespace k8s.Namespace,
) run.Runnable

func CreateBackupCron

func CreateBackupCron(
	sentryClient libsentry.Client,
	currentTimeGetter libtime.CurrentTimeGetter,
	kubeConfig string,
	backupRootDirectory Path,
	sshKeyPath SSHPrivateKey,
	namespace k8s.Namespace,
	cronExpression string,
) 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

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