instance

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 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 StatusClient

type StatusClient struct {
	*http.Client
}

StatusClient a http client capable of querying the instance HTTP endpoints

func NewStatusClient

func NewStatusClient() *StatusClient

NewStatusClient returns a client capable of querying the instance HTTP endpoints

func (*StatusClient) GetPgControlDataFromInstance

func (r *StatusClient) GetPgControlDataFromInstance(
	ctx context.Context,
	pod *corev1.Pod,
) (string, error)

GetPgControlDataFromInstance obtains the pg_controldata from the instance HTTP endpoint

func (*StatusClient) GetStatusFromInstances

func (r *StatusClient) GetStatusFromInstances(
	ctx context.Context,
	pods corev1.PodList,
) postgres.PostgresqlStatusList

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

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