backup

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupHandler

type BackupHandler interface {
	// RunBackup creates a backup of all events in the store
	RunBackup(context.Context) (*BackupResult, error)
	// RunRestore restores all events stored in the backup with the given identifier
	RunRestore(context.Context, string) (*RestoreResult, error)
	// RunPurge cleans up backups according to the retention set
	RunPurge(context.Context) (*PurgeResult, error)
}

type BackupResult

type BackupResult struct {
	ProcessedEvents  uint64
	ProcessedBytes   uint64
	BackupIdentifier string
}

type MetricsPublisher

type MetricsPublisher interface {
	// Start sets a timestamp for start of a backup
	Start()
	// Finished sets the duration an backup has taken and the completion time to now
	Finished()
	// SetSuccessTime adds the success timestamp to the pushed metrics and sets the time to now
	SetSuccessTime()
	// SetFailTime adds a failed timestamp to the pushed metrics and sets the time to now
	SetFailTime()
	// SetEventCount sets the events processed during an backup
	SetEventCount(eventCount float64)
	// SetBytes sets the bytes written to backup
	SetBytes(sizeInBytes float64)
	// CloseAndPush sends the metrics to the prometheus push gateway
	CloseAndPush() error
}

func NewMetricsPublisher

func NewMetricsPublisher(pushGatewayUrl string) (MetricsPublisher, error)

NewMetricsPublisher creates a new backup.MetricsPublisher publishing metrics to a prometheus pushgateway

func NewNoopMetricsPublisher

func NewNoopMetricsPublisher() MetricsPublisher

NewNoopMetricsPublisher returns a noop metrics publisher which does nothing

type PurgeResult

type PurgeResult struct {
	PurgedBackups int
	BackupsLeft   int
}

type RestoreResult

type RestoreResult struct {
	ProcessedEvents uint64
	ProcessedBytes  uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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