backupcontroller

package
v0.0.0-...-ecdaeff Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DailyBackupsRetention = 24 * 2 * 365 * time.Hour

DailyBackupsRetention controls how long daily backups are kept.

View Source
var HourlyBackupsRetention = 24 * 7 * time.Hour

HourlyBackupsRetention controls how long hourly backups are kept.

Functions

func ParseHumanDuration

func ParseHumanDuration(s string) (time.Duration, error)

ParseHumanDuration parses a go-style duration string, but recognizes additional suffixes: d means "day" and is interpreted as 24 hours; y means "year" and is interpreted as 365 days.

Types

type BackupCleanup

type BackupCleanup struct {
	// contains filtered or unexported fields
}

BackupCleanup encapsulates the logic around periodically removing old backups

func NewBackupCleanup

func NewBackupCleanup(backupStore backup.Store) *BackupCleanup

NewBackupCleanup constructs a BackupCleanup

func (*BackupCleanup) MaybeDoBackupMaintenance

func (m *BackupCleanup) MaybeDoBackupMaintenance(ctx context.Context) error

MaybeDoBackupMaintenance removes old backups, if a suitable interval has passed. It should be called periodically, after every backup for example.

type BackupController

type BackupController struct {
	// contains filtered or unexported fields
}

func NewBackupController

func NewBackupController(backupStore backup.Store, clusterName string, clientUrls []string, etcdClientTLSConfig *tls.Config, dataDir string, backupInterval time.Duration) (*BackupController, error)

func (*BackupController) Run

func (m *BackupController) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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