backup

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ID

func ID(shard, alias string, ts time.Time) string

ID is the function that used to generate the ID of the backup runner

Types

type Retention

type Retention string
const (
	Retention90d Retention = "90d"
	Retention7d  Retention = "7d"
	Retention24h Retention = "24h"
)

type Runner

type Runner struct {
	Instance           client.Object
	ShardName          string
	Server             *sharded.RedisServer
	ScheduledFor       time.Time
	Timestamp          time.Time
	Timeout            time.Duration
	PollInterval       time.Duration
	RedisDBFile        string
	SSHUser            string
	SSHKey             string
	SSHPort            uint32
	SSHSudo            bool
	S3Bucket           string
	S3Path             string
	AWSAccessKeyID     string
	AWSSecretAccessKey string
	AWSRegion          string
	AWSS3Endpoint      *string
	// contains filtered or unexported fields
}

func (*Runner) BackgroundSave

func (br *Runner) BackgroundSave(ctx context.Context) error

func (*Runner) BackupFile

func (br *Runner) BackupFile() string

BackupFile returns the backup file as "redis-backup-<shard>-<server>-<timestamp>.rdb"

func (*Runner) BackupFileBaseName

func (br *Runner) BackupFileBaseName() string

func (*Runner) BackupFileBaseNameWithTimeSuffix

func (br *Runner) BackupFileBaseNameWithTimeSuffix(timeSuffix string) string

func (*Runner) BackupFileCompressed

func (br *Runner) BackupFileCompressed() string

func (*Runner) BackupFileS3Path

func (br *Runner) BackupFileS3Path() string

func (*Runner) CanBeDeleted

func (br *Runner) CanBeDeleted() bool

CanBeDeleted reports the reconciler if this backup runner key can be deleted from the map of threads

func (*Runner) CheckBackup

func (br *Runner) CheckBackup(ctx context.Context) error

func (*Runner) GetID

func (br *Runner) GetID() string

GetID returns the ID of this backup runner

func (*Runner) IsStarted

func (br *Runner) IsStarted() bool

IsStarted returns whether the backup runner is started or not

func (*Runner) SetChannel

func (br *Runner) SetChannel(ch chan event.GenericEvent)

SetChannel created the communication channel for this backup runner

func (*Runner) Start

func (br *Runner) Start(parentCtx context.Context, l logr.Logger) error

Start starts the backup runner

func (*Runner) Status

func (br *Runner) Status() RunnerStatus

Status returns the RunnerStatus struct for this backup runner

func (*Runner) Stop

func (br *Runner) Stop()

Stop stops the sentinel event watcher

func (*Runner) UploadBackup

func (br *Runner) UploadBackup(ctx context.Context) error

type RunnerStatus

type RunnerStatus struct {
	Started    bool
	Finished   bool
	Error      error
	BackupFile string
	BackupSize int64
	FinishedAt time.Time
}

Jump to

Keyboard shortcuts

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