wals

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package wals implements the management of WAL files list

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatherReadyWALFilesConfig

type GatherReadyWALFilesConfig struct {
	PgDataPath string
	MaxResults int
	SkipWALs   []string
}

GatherReadyWALFilesConfig is the configuration for GatherReadyWALFiles

type WALList

type WALList struct {

	// points to a wal, example of content: "pg_wal/000000010000000000000001"
	Ready []string
	// points to a wal, example of content: "pg_wal/000000010000000000000001"
	Done           []string
	HasMoreResults bool
	// contains filtered or unexported fields
}

WALList is a structure that contains the list of WAL files that are ready to be archived

func GatherReadyWALFiles

func GatherReadyWALFiles(
	ctx context.Context,
	config GatherReadyWALFilesConfig,
) *WALList

GatherReadyWALFiles reads from the archived status the list of WAL files that can be archived.

func (*WALList) MarkAsDone

func (w *WALList) MarkAsDone(ctx context.Context, walName string) error

MarkAsDone moves a WAL file from the list of ready WAL files to the list of done WAL files

func (*WALList) ReadyItemsToSlice

func (w *WALList) ReadyItemsToSlice() []string

ReadyItemsToSlice returns the list of ready WAL files as a slice

func (*WALList) RemoveReadyItem

func (w *WALList) RemoveReadyItem(walName string)

RemoveReadyItem removes a WAL file from the list of ready WAL files

Jump to

Keyboard shortcuts

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