pgbackrest

package
v0.0.0-...-86c6960 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupPath        = "backup"
	BackupInfoIni     = "backup.info"
	BackupManifestIni = "backup.manifest"
	WalArchivePath    = "archive"
	ArchiveInfo       = "archive.info"

	BackupFolderName    = "backup"
	BackupDataDirectory = "pg_data"
)

Variables

This section is empty.

Functions

func GetArchiveName

func GetArchiveName(folder storage.Folder, stanza string) (*string, error)

func GetBackupList

func GetBackupList(backupsFolder storage.Folder, stanza string) ([]internal.BackupTime, error)

func HandleBackupList

func HandleBackupList(folder storage.Folder, stanza string, detailed bool, pretty bool, json bool) error

func HandlePgbackrestBackupFetch

func HandlePgbackrestBackupFetch(folder storage.Folder, stanza string, destinationDirectory string,
	backupSelector internal.BackupSelector) error

func HandleWalFetch

func HandleWalFetch(folder storage.Folder, stanza string, walFileName string, location string) error

func HandleWalShow

func HandleWalShow(rootFolder storage.Folder, stanza string, outputWriter postgres.WalShowOutputWriter) error

func NewBackupSelector

func NewBackupSelector(backupName string, stanza string) internal.BackupSelector

Types

type ArchiveSettings

type ArchiveSettings struct {
	DatabaseID      int64  `ini:"db-id"`
	DatabaseVersion string `ini:"db-version"`
}

type BackrestSection

type BackrestSection struct {
	BackrestFormant string `ini:"backrest-format"`
	BackrestVersion string `ini:"backrest-version"`
}

type BackupDatabaseSection

type BackupDatabaseSection struct {
	CatalogVersion uint64 `ini:"db-catalog-version"`
	ControlVersion uint64 `ini:"db-control-version"`
	ID             uint64 `ini:"db-id"`
	SystemID       uint64 `ini:"db-system-id"`
	Version        string `ini:"db-version"`
}

type BackupDetails

type BackupDetails struct {
	BackupName           string
	ModifiedTime         time.Time
	WalFileName          string
	Type                 string
	StartTime            time.Time
	FinishTime           time.Time
	PgVersion            string
	StartLsn             postgres.LSN
	FinishLsn            postgres.LSN
	SystemIdentifier     uint64
	DirectoryPaths       []string
	DefaultFileMode      int
	DefaultDirectoryMode int
}

func GetBackupDetails

func GetBackupDetails(backupsFolder storage.Folder, stanza string, backupName string) (*BackupDetails, error)

type BackupSection

type BackupSection struct {
	BackupArchiveStart       string `ini:"backup-archive-start"`
	BackupArchiveStop        string `ini:"backup-archive-stop"`
	BackupLabel              string `ini:"backup-label"`
	BackupLabelPrior         string `ini:"backup-prior"`
	BackupLsnStart           string `ini:"backup-lsn-start"`
	BackupLsnStop            string `ini:"backup-lsn-stop"`
	BackupTimestampCopyStart int64  `ini:"backup-timestamp-copy-start"`
	BackupTimestampStart     int64  `ini:"backup-timestamp-start"`
	BackupTimestampStop      int64  `ini:"backup-timestamp-stop"`
	BackupType               string `ini:"backup-type"`
}

type BackupSettings

type BackupSettings struct {
	Name                    string
	BackrestFormat          int    `json:"backrest-format"`
	BackrestVersion         string `json:"backrest-version"`
	BackupInfoRepoSize      int64  `json:"backup-info-repo-size"`
	BackupInfoRepoSizeDelta int64  `json:"backup-info-repo-size-delta"`
	BackupInfoSize          int64  `json:"backup-info-size"`
	BackupInfoSizeDelta     int64  `json:"backup-info-size-delta"`
	BackupPgID              int    `json:"db-id"`

	BackupTimestampStart int64  `json:"backup-timestamp-start"`
	BackupTimestampStop  int64  `json:"backup-timestamp-stop"`
	BackupType           string `json:"backup-type"`

	BackupArchiveStart string   `json:"backup-archive-start"`
	BackupArchiveStop  string   `json:"backup-archive-stop"`
	BackupPrior        string   `json:"backup-prior"`
	BackupReference    []string `json:"backup-reference"`

	OptionArchiveCheck  bool `json:"option-archive-check"`
	OptionArchiveCopy   bool `json:"option-archive-copy"`
	OptionBackupStandby bool `json:"option-backup-standby"`
	OptionChecksumPage  bool `json:"option-checksum-page"`
	OptionCompress      bool `json:"option-compress"`
	OptionHardlink      bool `json:"option-hardlink"`
	OptionOnline        bool `json:"option-online"`
}

func LoadBackupsSettings

func LoadBackupsSettings(folder storage.Folder, stanza string) ([]BackupSettings, error)

type BackupTargetSection

type BackupTargetSection struct {
	PgdataPath string
}

type DefaultFileSection

type DefaultFileSection struct {
	Group  string `ini:"group"`
	Master bool   `ini:"master"`
	Mode   string `ini:"mode"`
	User   string `ini:"user"`
}

type DefaultPathSection

type DefaultPathSection struct {
	Group string `ini:"group"`
	Mode  string `ini:"mode"`
	User  string `ini:"user"`
}

type LatestBackupSelector

type LatestBackupSelector struct {
	Stanza string
}

func (LatestBackupSelector) Select

func (selector LatestBackupSelector) Select(folder storage.Folder) (string, error)

type ManifestSettings

type ManifestSettings struct {
	BackrestSection       BackrestSection       `ini:"backrest"`
	BackupSection         BackupSection         `ini:"backup"`
	BackupTargetSection   BackupTargetSection   `ini:"backup:target"`
	BackupDatabaseSection BackupDatabaseSection `ini:"backup:db"`
	PathSection           PathSection
	DefaultFileSection    DefaultFileSection `ini:"target:file:default"`
	DefaultPathSection    DefaultPathSection `ini:"target:path:default"`
}

func LoadManifest

func LoadManifest(folder storage.Folder, stanza string, backupName string) (*ManifestSettings, error)

type NamedBackupSelector

type NamedBackupSelector struct {
	BackupName string
	Stanza     string
}

func (NamedBackupSelector) Select

func (selector NamedBackupSelector) Select(folder storage.Folder) (string, error)

type PathSection

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

type PgData

type PgData struct {
	Path     string `json:"path"`
	PathType string `json:"type"`
}

Jump to

Keyboard shortcuts

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