postgres

package
v0.0.0-...-53183f7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCronJobFailed = errors.New("cron job failed")
View Source
var ErrInvalidMemberCount = errors.New("the number of members don't match intention")
View Source
var ErrInvalidMemberList = errors.New("failed to parse member list")
View Source
var ErrLeaderNotRunning = errors.New("leader is not running")
View Source
var ErrLeaderNumber = errors.New("there is not exactly one Leader")
View Source
var ErrMembersOutOfSync = errors.New("members are out of sync (not the same TL)")
View Source
var ErrMultipleCronJobs = errors.New("multiple dump cron jobs found")
View Source
var ErrNoCronJob = errors.New("no dump cron job found")
View Source
var ErrPositivLag = errors.New("replica lag is not 0")
View Source
var ErrReplicaNotStreaming = errors.New("replica is not streaming")
View Source
var ErrSwitchoverFailed = errors.New("failed to switchover")
View Source
var ErrUnknownLag = errors.New("unknown lag")
View Source
var ErrUnknownRole = errors.New("the member is in an unkown role")
View Source
var GroupVersionResource = schema.GroupVersionResource{
	Group:    "acid.zalan.do",
	Version:  "v1",
	Resource: "postgresqls",
}

Functions

This section is empty.

Types

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func For

func For(ctx context.Context, restConfig *rest.Config, resource unstructured.Unstructured) *Postgres

func (*Postgres) Backup

func (pg *Postgres) Backup() (string, error)

func (*Postgres) DeclaredInstances

func (pg *Postgres) DeclaredInstances() int64

func (*Postgres) DestroyReplicas

func (pg *Postgres) DestroyReplicas() error

func (*Postgres) Execute

func (pg *Postgres) Execute(pod corev1.Pod, command []string, stdout io.Writer) error

func (*Postgres) GetCronJob

func (pg *Postgres) GetCronJob() (batchv1beta1.CronJob, error)

func (*Postgres) GetMasterPod

func (pg *Postgres) GetMasterPod() (corev1.Pod, error)

func (*Postgres) GetName

func (pg *Postgres) GetName() string

func (*Postgres) GetNamespace

func (pg *Postgres) GetNamespace() string

func (*Postgres) GetNamespaceName

func (pg *Postgres) GetNamespaceName() string

func (*Postgres) GetPods

func (pg *Postgres) GetPods(role Role) ([]corev1.Pod, error)

func (*Postgres) IsHealthy

func (pg *Postgres) IsHealthy() error

func (*Postgres) LogicalBackup

func (pg *Postgres) LogicalBackup() error

func (*Postgres) Switchover

func (pg *Postgres) Switchover() error

func (*Postgres) WaitHealthy

func (pg *Postgres) WaitHealthy(timeout time.Duration) error

func (*Postgres) WrapError

func (pg *Postgres) WrapError(err error) error

type Role

type Role string
var (
	MasterRole  Role = "master"
	ReplicaRole Role = "replica"
)

Jump to

Keyboard shortcuts

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