Documentation
¶
Index ¶
- Variables
- func NewBackupAction(sentryClient libsentry.Client, k8sConnector K8sConnector, ...) run.Runnable
- func NewCleanAction(sentryClient libsentry.Client, k8sConnector K8sConnector, ...) run.Runnable
- type Backup
- type BackupCleaner
- type BackupClientset
- type BackupExectuor
- type BackupFinder
- type BackupV1Interface
- type Backups
- type K8sConnector
- type Path
- type Paths
- type RsyncExectuor
- type SSHPrivateKey
- type TargetFinder
- type TargetFinderList
Constants ¶
This section is empty.
Variables ¶
View Source
var BackupAlreadyRunningError = stderrors.New("backup already running")
View Source
var CleanupAlreadyRunningError = stderrors.New("cleanup already running")
View Source
var (
TargetNotFoundError = stderrors.New("target not found")
)
Functions ¶
func NewBackupAction ¶
func NewBackupAction( sentryClient libsentry.Client, k8sConnector K8sConnector, backupExectuor BackupExectuor, ) run.Runnable
func NewCleanAction ¶
func NewCleanAction( sentryClient libsentry.Client, k8sConnector K8sConnector, cleanExectuor BackupCleaner, ) run.Runnable
Types ¶
type Backup ¶
type Backup struct {
Date libtime.Date `json:"date"`
Path Path `json:"path"`
Host v1.BackupHost `json:"host"`
}
type BackupCleaner ¶
type BackupCleaner interface {
Clean(ctx context.Context, backupSpec v1.BackupHost) error
}
func NewBackupCleaner ¶
func NewBackupCleaner( currentTimeGetter libtime.CurrentTimeGetter, backupFinder BackupFinder, backupRootDir Path, backupKeepAmount int, backupCleanEnabled bool, ) BackupCleaner
func NewBackupCleanerOnlyOnce ¶
func NewBackupCleanerOnlyOnce( backupCleaner BackupCleaner, ) BackupCleaner
type BackupClientset ¶
func CreateBackupClientset ¶
func CreateBackupClientset(ctx context.Context, kubeconfig string) (BackupClientset, error)
type BackupExectuor ¶
type BackupExectuor interface {
Backup(ctx context.Context, target v1.BackupSpec) error
}
func NewBackupExectuor ¶
func NewBackupExectuor( currentTimeGetter libtime.CurrentTimeGetter, rsyncExectuor RsyncExectuor, backupRootDirectory Path, sshPrivateKey SSHPrivateKey, ) BackupExectuor
func NewBackupExectuorOnlyOnce ¶
func NewBackupExectuorOnlyOnce( backupExectuor BackupExectuor, ) BackupExectuor
type BackupFinder ¶
type BackupFinder interface {
List(ctx context.Context, host v1.BackupHost) ([]libtime.Date, error)
}
func NewBackupFinder ¶
func NewBackupFinder(backupRootDir Path) BackupFinder
type BackupV1Interface ¶
type BackupV1Interface backupv1.BackupV1Interface
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( backupClientset BackupClientset, apiextensionsInterface libk8s.ApiextensionsInterface, namespace k8s.Namespace, ) K8sConnector
type RsyncExectuor ¶
func NewRsyncExectuor ¶
func NewRsyncExectuor() RsyncExectuor
type SSHPrivateKey ¶
type SSHPrivateKey string
func (SSHPrivateKey) String ¶
func (f SSHPrivateKey) String() string
type TargetFinder ¶
func NewCombinedTargetFinder ¶
func NewCombinedTargetFinder(k8sConnector K8sConnector) TargetFinder
func NewTargetFinder ¶
func NewTargetFinder(k8sConnector K8sConnector) TargetFinder
func NewTargetFinderByHostname ¶
func NewTargetFinderByHostname(k8sConnector K8sConnector) TargetFinder
type TargetFinderList ¶
type TargetFinderList []TargetFinder
Source Files
¶
- action-backup.go
- action-clean.go
- backup-cleaner-only-once.go
- backup-cleaner.go
- backup-executor-only-once.go
- backup-executor.go
- backup-finder.go
- backup.go
- backup_clientset.go
- backup_mocks.go
- k8s-connector.go
- path.go
- rsync-executor.go
- ssh-private-key-path.go
- target-finder-by-hostname.go
- target-finder-by-name.go
- target-finder-combined.go
- target-finder-list.go
- target-finder.go
Click to show internal directories.
Click to hide internal directories.