instance

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package instance contains the client capable of querying the HTTP instances endpoints

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.24.0

type Client 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(context.Context, *corev1.Pod) (string, error)
}

Client a http client capable of querying the instance HTTP endpoints

func NewStatusClient

func NewStatusClient() Client

NewStatusClient returns a client capable of querying the instance HTTP endpoints

type HTTPScheme added in v1.24.0

type HTTPScheme string

HTTPScheme identifies a valid scheme: http, https

func GetStatusSchemeFromPod added in v1.24.0

func GetStatusSchemeFromPod(pod *corev1.Pod) HTTPScheme

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

func (HTTPScheme) IsHTTPS added in v1.24.0

func (h HTTPScheme) IsHTTPS() bool

IsHTTPS returns true if schemeHTTPS

func (HTTPScheme) ToString added in v1.24.0

func (h HTTPScheme) ToString() string

ToString returns the scheme as a string value

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