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 ¶
- type BarmanBackup
- type Catalog
- func (catalog *Catalog) FindBackupInfo(recoveryTarget recoveryTargetAdapter) (*BarmanBackup, error)
- func (catalog *Catalog) FirstRecoverabilityPoint() *time.Time
- func (catalog *Catalog) GetBackupIDs() []string
- func (catalog Catalog) GetBackupMethod() string
- func (catalog *Catalog) GetFirstRecoverabilityPoint() *time.Time
- func (catalog *Catalog) GetLastSuccessfulBackupTime() *time.Time
- func (catalog *Catalog) LatestBackupInfo() *BarmanBackup
- func (catalog *Catalog) Len() int
- func (catalog *Catalog) Less(i, j int) bool
- func (catalog *Catalog) Swap(i, j int)
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 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 ¶
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 ¶
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 ¶
FirstRecoverabilityPoint gets the start time of the first backup in the catalog
func (*Catalog) GetBackupIDs ¶
GetBackupIDs returns the list of backup IDs in the catalog
func (Catalog) GetBackupMethod ¶
GetBackupMethod returns the backup method
func (*Catalog) GetFirstRecoverabilityPoint ¶
GetFirstRecoverabilityPoint see FirstRecoverabilityPoint. This is needed to adhere to the common backup interface.
func (*Catalog) GetLastSuccessfulBackupTime ¶
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