remote

package
v1.27.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package remote contains the client capable of querying the webserver remote endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupClient added in v1.25.2

BackupClient is the interface to interact with the backup endpoints

type Client

type Client interface {
	Instance() InstanceClient
	Backup() BackupClient
}

Client is the interface to interact with the remote webserver

func NewClient

func NewClient() Client

NewClient creates a new remote client

type HTTPScheme

type HTTPScheme string

HTTPScheme identifies a valid scheme: http, https

func GetStatusSchemeFromPod

func GetStatusSchemeFromPod(pod *corev1.Pod) HTTPScheme

GetStatusSchemeFromPod detects if a Pod is exposing the status via HTTP or HTTPS

func (HTTPScheme) IsHTTPS

func (h HTTPScheme) IsHTTPS() bool

IsHTTPS returns true if schemeHTTPS

func (HTTPScheme) ToString

func (h HTTPScheme) ToString() string

ToString returns the scheme as a string value

type InstanceClient

type InstanceClient interface {
	// GetStatusFromInstances gets the replication status from the PostgreSQL instances,
	// the returned list is sorted in order to have the primary as the first element
	// and the other instances in their election order
	GetStatusFromInstances(
		ctx context.Context,
		pods corev1.PodList,
	) postgres.PostgresqlStatusList

	// GetPgControlDataFromInstance obtains the pg_controldata from the instance HTTP endpoint
	GetPgControlDataFromInstance(
		ctx context.Context,
		pod *corev1.Pod,
	) (string, error)

	// UpgradeInstanceManager upgrades the instance manager to the passed availableArchitecture
	UpgradeInstanceManager(
		ctx context.Context,
		pod *corev1.Pod,
		availableArchitecture *utils.AvailableArchitecture,
	) error

	// ArchivePartialWAL trigger the archiver for the latest partial WAL
	// file created in a specific Pod
	ArchivePartialWAL(context.Context, *corev1.Pod) (string, error)
}

InstanceClient a http client capable of querying the instance HTTP endpoints

type StatusError

type StatusError struct {
	StatusCode int
	Body       string
}

An StatusError reports an unsuccessful attempt to retrieve an instance status

func (StatusError) Error

func (i StatusError) Error() string

Jump to

Keyboard shortcuts

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