backup

package
v0.0.0-...-1b4be3e Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksumStatus

type ChecksumStatus struct {
	Checksums map[string]int64 `yaml:"checksums"`
}

ChecksumStatus backup checksum struct

type Health

type Health struct {
	sync.Mutex
	Ready bool
}

Health backup health status

type Manager

type Manager struct {
	Db database.Database

	Storage *storage.Manager

	Health *Health
	// contains filtered or unexported fields
}

Manager that handles the backup cycle

func NewManager

func NewManager(s *storage.Manager, db database.Database, k *k8s.Database, c config.Config) (m *Manager, err error)

NewManager returns a manager instance

func (*Manager) CreateIncBackup

func (m *Manager) CreateIncBackup() (err error)

CreateIncBackup creates inc backups

func (*Manager) GetBackupActive

func (m *Manager) GetBackupActive() bool

GetBackupActive returns if a backup is currently active

func (*Manager) GetConfig

func (m *Manager) GetConfig() config.Config

GetConfig returns the config

func (*Manager) GetHealthStatus

func (m *Manager) GetHealthStatus() *UpdateStatus

GetHealthStatus returns the current backup health status

func (*Manager) Restore

func (m *Manager) Restore(p string) (err error)

Restore triggers a restore

func (*Manager) Start

func (m *Manager) Start() (err error)

Start a backup cycle

func (*Manager) Stop

func (m *Manager) Stop() (ctx context.Context)

Stop the backup cycle

type MetricsCollector

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

MetricsCollector collects metrics fort the backup and verification status

func NewMetricsCollector

func NewMetricsCollector(u *UpdateStatus) *MetricsCollector

NewMetricsCollector create a prometheus collector instance

func (*MetricsCollector) Collect

func (c *MetricsCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the exporter interface function

func (*MetricsCollector) Describe

func (c *MetricsCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the exporter interface function

type UpdateStatus

type UpdateStatus struct {
	sync.RWMutex `yaml:"-"`
	IncBackup    map[string]int
	FullBackup   map[string]int
	Restarts     prometheus.Counter
}

UpdateStatus holds current status of backups

func NewUpdateStatus

func NewUpdateStatus() UpdateStatus

NewUpdateStatus returns a UpdateStatus with an intialized counter metric

Jump to

Keyboard shortcuts

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