walarchive

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 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 walarchive provides support for WAL archive upload

Index

Constants

View Source
const (
	// ArchiveCommand defines the pgBackRest command for WAL archive upload
	ArchiveCommand = "archive-push"
	// PgbackrestExecutable defines the name of the pgBackRest binary
	PgbackrestExecutable = "pgbackrest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PgbackrestArchiver

type PgbackrestArchiver struct {
	Env                 []string
	Touch               func(walFile string) error
	EmptyWalArchivePath string
}

PgbackrestArchiver implements a WAL archiver based on pgbackrest

func (*PgbackrestArchiver) Archive

func (archiver *PgbackrestArchiver) Archive(
	ctx context.Context,
	walName string,
	baseOptions []string,
) error

Archive archives a certain WAL file using pgbackrest archive-push. See archiveWALFileList for the meaning of the parameters

func (*PgbackrestArchiver) ArchiveList

func (archiver *PgbackrestArchiver) ArchiveList(
	ctx context.Context,
	walNames []string,
	options []string,
) (result []WALArchiverResult)

ArchiveList archives a list of WAL files in parallel

type WALArchiverResult

type WALArchiverResult struct {
	// The WAL that have been archived
	WalName string

	// If not nil, this is the error that has been detected
	Err error

	// The time when we started pgbackrest archive-push
	StartTime time.Time

	// The time when pgbackrest archive-push ended
	EndTime time.Time
}

WALArchiverResult contains the result of the archival of one WAL

Jump to

Keyboard shortcuts

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