Documentation
¶
Overview ¶
Package catalog is the implementation of a backup catalog
Index ¶
- Constants
- type Catalog
- func (catalog *Catalog) FindBackupInfo(recoveryTarget recoveryTargetAdapter) (*PgbackrestBackup, error)
- func (catalog *Catalog) FirstRecoverabilityPoint() *time.Time
- func (catalog *Catalog) GetBackupIDs() []string
- func (catalog *Catalog) GetBackupIdFromAnnotatedName(backupName string) string
- func (catalog Catalog) GetBackupMethod() string
- func (catalog *Catalog) GetFirstRecoverabilityPoint() *time.Time
- func (catalog *Catalog) GetLastSuccessfulBackupTime() *time.Time
- func (catalog *Catalog) LatestBackupInfo() *PgbackrestBackup
- type PgbackrestBackup
- type PgbackrestBackupDatabase
- type PgbackrestBackupLSN
- type PgbackrestBackupTime
- type PgbackrestBackupWALArchive
- type PgbackrestWALArchive
Constants ¶
const BackupNameAnnotation = "cnpg-backup-name"
const LatestTimelineId = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
Archive []PgbackrestWALArchive `json:"archive"`
Backups []PgbackrestBackup `json:"backup"`
Stanza string `json:"name"`
Databases []PgbackrestBackupDatabase `json:"db"`
Encryption string `json:"cipher"`
}
func NewCatalogFromPgbackrestInfo ¶
NewCatalogFromPgbackrestInfo parses the output of pgbackrest info
func NewSingleBackupCatalogFromPgbackrestInfo ¶
NewSingleBackupCatalogFromPgbackrestInfo parses the output of pgbackrest info targeting a single backup via "--set". While structure is the same as for the full backups list there is only a single backup in the list but with additional fields included.
func (*Catalog) FindBackupInfo ¶
func (catalog *Catalog) FindBackupInfo( recoveryTarget recoveryTargetAdapter, ) (*PgbackrestBackup, 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) GetBackupIdFromAnnotatedName ¶
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() *PgbackrestBackup
LatestBackupInfo gets the information about the latest successful backup
type PgbackrestBackup ¶
type PgbackrestBackup struct {
Annotations map[string]string `json:"annotation,omitempty"`
Time PgbackrestBackupTime `json:"timestamp"`
WAL PgbackrestBackupWALArchive `json:"archive"`
LSN PgbackrestBackupLSN `json:"lsn"`
// The ID of the backup - reusing pgbackrest's label
ID string `json:"label"`
// The ID of the previous backup for incremental and differential backups
Prior string `json:"prior,omitempty"`
// Backup type
Type string `json:"type"`
}
PgbackrestBackup represent a backup as created by pgbackrest
type PgbackrestBackupLSN ¶
type PgbackrestBackupTime ¶
type PgbackrestWALArchive ¶
type PgbackrestWALArchive struct {
ID string `json:"id"`
// First WAL in the archive
Min string `json:"min"`
// Last WAL in the archive
Max string `json:"max"`
Database PgbackrestBackupDatabase `json:"database"`
}