pgbackrest

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: PostgreSQL Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteConfig

func WriteConfig(w io.Writer, opts ConfigOptions) error

Types

type ArchiveRange

type ArchiveRange struct {
	Start string `json:"start"`
	Stop  string `json:"stop"`
}

type BackupInfo

type BackupInfo struct {
	Label     string       `json:"label"`
	Type      string       `json:"type"`
	Timestamp BackupTime   `json:"timestamp"`
	Archive   ArchiveRange `json:"archive"`
	Database  DBRef        `json:"database"`
	Info      BackupSize   `json:"info"`
}

type BackupOptions

type BackupOptions struct {
	Type          BackupType        `json:"type"`
	Annotations   map[string]string `json:"annotations,omitempty"`
	BackupOptions map[string]string `json:"backup_options,omitempty"`
}

func (BackupOptions) StringSlice

func (b BackupOptions) StringSlice() []string

type BackupSize

type BackupSize struct {
	Size  int64 `json:"size"`
	Delta int64 `json:"delta"`
}

type BackupTime

type BackupTime struct {
	Start int64 `json:"start"`
	Stop  int64 `json:"stop"`
}

func (BackupTime) StartTime

func (b BackupTime) StartTime() time.Time

func (BackupTime) StopTime

func (b BackupTime) StopTime() time.Time

type BackupType

type BackupType string
const (
	BackupTypeFull         BackupType = "full"
	BackupTypeDifferential BackupType = "diff"
	BackupTypeIncremental  BackupType = "incr"
)

func (BackupType) String

func (b BackupType) String() string

type Cmd

type Cmd struct {
	PgBackrestCmd string
	Config        string
	Stanza        string
	Command       string
	Args          []string
}

func (Cmd) String

func (c Cmd) String() string

func (Cmd) StringSlice

func (c Cmd) StringSlice() []string

type ConfigOptions

type ConfigOptions struct {
	DatabaseID   string
	NodeName     string
	PgDataPath   string
	HostUser     string
	User         string
	SocketPath   string
	Repositories []*Repository
}

type DBRef

type DBRef struct {
	ID int `json:"id"`
}

type Database

type Database struct {
	Version  string `json:"version"`
	SystemID int64  `json:"system-id"`
}

type InfoOutput

type InfoOutput []*StanzaInfo

func ParseInfoOutput

func ParseInfoOutput(output []byte) (InfoOutput, error)

func (InfoOutput) Stanza

func (i InfoOutput) Stanza(name string) *StanzaInfo

type Repository

type Repository struct {
	ID                string            `json:"id"`
	Type              RepositoryType    `json:"type"`
	S3Bucket          string            `json:"s3_bucket,omitempty"`
	S3Region          string            `json:"s3_region,omitempty"`
	S3Endpoint        string            `json:"s3_endpoint,omitempty"`
	S3Key             string            `json:"s3_key,omitempty"`
	S3KeySecret       string            `json:"s3_key_secret,omitempty"`
	GCSBucket         string            `json:"gcs_bucket,omitempty"`
	GCSEndpoint       string            `json:"gcs_endpoint,omitempty"`
	GCSKey            string            `json:"gcs_key,omitempty"`
	AzureAccount      string            `json:"azure_account,omitempty"`
	AzureContainer    string            `json:"azure_container,omitempty"`
	AzureEndpoint     string            `json:"azure_endpoint,omitempty"`
	AzureKey          string            `json:"azure_key,omitempty"`
	RetentionFull     int               `json:"retention_full"`
	RetentionFullType RetentionFullType `json:"retention_full_type"`
	BasePath          string            `json:"base_path,omitempty"`
	CustomOptions     map[string]string `json:"custom_options,omitempty"`
}

func (*Repository) Clone

func (r *Repository) Clone() *Repository

func (*Repository) DefaultOptionalFieldsFrom

func (r *Repository) DefaultOptionalFieldsFrom(other *Repository)

DefaultOptionalFieldsFrom will default this repository's optional fields to the values from the given repository.

func (*Repository) Identifier

func (r *Repository) Identifier() string

Identifier computes a unique identifier for the repository.

func (*Repository) WithDefaults

func (r *Repository) WithDefaults() *Repository

type RepositoryType

type RepositoryType string
const (
	RepositoryTypeS3    RepositoryType = "s3"
	RepositoryTypeGCS   RepositoryType = "gcs"
	RepositoryTypeAzure RepositoryType = "azure"
	RepositoryTypePosix RepositoryType = "posix"
	RepositoryTypeCifs  RepositoryType = "cifs"
)

type RetentionFullType

type RetentionFullType string
const (
	RetentionFullTypeTime  RetentionFullType = "time"
	RetentionFullTypeCount RetentionFullType = "count"
)

type StanzaInfo

type StanzaInfo struct {
	Name   string       `json:"name"`
	Status Status       `json:"status"`
	DB     []Database   `json:"db"`
	Backup []BackupInfo `json:"backup"`
}

type Status

type Status struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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