catalog

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package catalog is the implementation of a backup catalog

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BarmanBackup

type BarmanBackup struct {
	// The backup name, can be used as a way to identify a backup.
	// Populated only if the backup was executed with barman 3.3.0+.
	BackupName string `json:"backup_name,omitempty"`

	// The backup label
	Label string `json:"backup_label"`

	// The moment where the backup started
	BeginTimeString string `json:"begin_time"`

	// The moment where the backup ended
	EndTimeString string `json:"end_time"`

	// The moment where the backup ended
	BeginTime time.Time

	// The moment where the backup ended
	EndTime time.Time

	// The WAL where the backup started
	BeginWal string `json:"begin_wal"`

	// The WAL where the backup ended
	EndWal string `json:"end_wal"`

	// The LSN where the backup started
	BeginLSN string `json:"begin_xlog"`

	// The LSN where the backup ended
	EndLSN string `json:"end_xlog"`

	// The systemID of the cluster
	SystemID string `json:"systemid"`

	// The ID of the backup
	ID string `json:"backup_id"`

	// The error output if present
	Error string `json:"error"`

	// The TimeLine
	TimeLine int `json:"timeline"`
}

BarmanBackup represent a backup as created by Barman

func NewBackupFromBarmanCloudBackupShow added in v1.18.3

func NewBackupFromBarmanCloudBackupShow(rawJSON string) (*BarmanBackup, error)

NewBackupFromBarmanCloudBackupShow parses the output of barman-cloud-backup-show

type Catalog

type Catalog struct {
	// The list of backups
	List []BarmanBackup `json:"backups_list"`
}

Catalog is a list of backup infos belonging to the same server

func NewCatalog

func NewCatalog(list []BarmanBackup) *Catalog

NewCatalog creates a new sorted backup catalog, given a list of backup infos belonging to the same server.

func NewCatalogFromBarmanCloudBackupList added in v1.18.3

func NewCatalogFromBarmanCloudBackupList(rawJSON string) (*Catalog, error)

NewCatalogFromBarmanCloudBackupList parses the output of barman-cloud-backup-list

func (*Catalog) FindBackupInfo added in v1.15.2

func (catalog *Catalog) FindBackupInfo(recoveryTarget *v1.RecoveryTarget) (*BarmanBackup, error)

FindBackupInfo finds the backup info that should be used to file a PITR request via target parameters specified within `RecoveryTarget`

func (*Catalog) FirstRecoverabilityPoint

func (catalog *Catalog) FirstRecoverabilityPoint() *time.Time

FirstRecoverabilityPoint gets the start time of the first backup in the catalog

func (*Catalog) LatestBackupInfo

func (catalog *Catalog) LatestBackupInfo() *BarmanBackup

LatestBackupInfo gets the information about the latest successful backup

func (*Catalog) Len

func (catalog *Catalog) Len() int

Len implements sort.Interface

func (*Catalog) Less

func (catalog *Catalog) Less(i, j int) bool

Less implements sort.Interface

func (*Catalog) Swap

func (catalog *Catalog) Swap(i, j int)

Swap implements sort.Interface

Jump to

Keyboard shortcuts

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