catalog

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package catalog is the implementation of a backup catalog

Package catalog contains the code to create a backup catalog from an object store.

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 started in ISO format
	BeginTimeISOString string `json:"begin_time_iso"`

	// The moment where the backup ended in ISO format
	EndTimeISOString string `json:"end_time_iso"`

	// The moment where the backup started
	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

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

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

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

func (*Catalog) FindBackupInfo

func (catalog *Catalog) FindBackupInfo(
	recoveryTarget recoveryTargetAdapter,
) (*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) GetBackupIDs

func (catalog *Catalog) GetBackupIDs() []string

GetBackupIDs returns the list of backup IDs in the catalog

func (Catalog) GetBackupMethod

func (catalog Catalog) GetBackupMethod() string

GetBackupMethod returns the backup method

func (*Catalog) GetFirstRecoverabilityPoint

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

GetFirstRecoverabilityPoint see FirstRecoverabilityPoint. This is needed to adhere to the common backup interface.

func (*Catalog) GetLastSuccessfulBackupTime

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

GetLastSuccessfulBackupTime gets the end time of the last successful backup or nil if no backup was successful

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