postgres

package
v0.76.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Namespace = "postgres-operator"

Variables

This section is empty.

Functions

This section is empty.

Types

type PatroniCluster added in v0.39.0

type PatroniCluster struct {
	Members []PatroniMember `json:"members"`
}

type PatroniMember added in v0.39.0

type PatroniMember struct {
	Name     string      `json:"name"`
	Host     string      `json:"host"`
	Port     int         `json:"port"`
	Role     string      `json:"role"`
	State    string      `json:"state"`
	URL      string      `json:"api_url"`
	Timeline int         `json:"timeline"`
	Lag      interface{} `json:"lag"`
}

type PostgresDB

type PostgresDB struct {
	Name      string
	Namespace string
	Superuser string
	Secret    string
	// contains filtered or unexported fields
}

nolint: revive

func GetPostgresDB

func GetPostgresDB(client *kommons.Client, name string, resticEnabled bool) (*PostgresDB, error)

func (*PostgresDB) GetClusterName added in v0.39.0

func (db *PostgresDB) GetClusterName() string

func (*PostgresDB) GetPatroniClient added in v0.39.0

func (db *PostgresDB) GetPatroniClient() (*http.Client, error)

func (*PostgresDB) OpenDB added in v0.39.0

func (db *PostgresDB) OpenDB(database string) (*pgx.Conn, error)

func (*PostgresDB) String

func (db *PostgresDB) String() string

func (*PostgresDB) Terminate added in v0.39.0

func (db *PostgresDB) Terminate() error

func (*PostgresDB) TriggerBackup added in v0.39.0

func (db *PostgresDB) TriggerBackup(timeout time.Duration) error

func (*PostgresDB) WaitFor added in v0.39.0

func (db *PostgresDB) WaitFor(timeout time.Duration) error

func (*PostgresDB) WithConnection added in v0.39.0

func (db *PostgresDB) WithConnection(database string, fn func(*pgx.Conn) error) error

type PostgresqlDB added in v0.46.0

type PostgresqlDB struct {
	*PostgresDB
	Restic       bool
	BackupBucket string
	// contains filtered or unexported fields
}

func GetPostgresqlDB added in v0.46.0

func GetPostgresqlDB(p *platform.Platform, name string) (*PostgresqlDB, error)

func (*PostgresqlDB) Backup added in v0.46.0

func (db *PostgresqlDB) Backup() error

func (*PostgresqlDB) GenerateBackupJob added in v0.46.0

func (db *PostgresqlDB) GenerateBackupJob() *kommons.DeploymentBuilder

func (*PostgresqlDB) ListBackups added in v0.46.0

func (db *PostgresqlDB) ListBackups(limit int, quiet bool) ([]string, error)

func (*PostgresqlDB) ListResticBackups added in v0.46.0

func (db *PostgresqlDB) ListResticBackups(limit int, quiet bool) ([]string, error)

func (*PostgresqlDB) ListS3Backups added in v0.46.0

func (db *PostgresqlDB) ListS3Backups(limit int, quiet bool) ([]string, error)

func (*PostgresqlDB) Restore added in v0.46.0

func (db *PostgresqlDB) Restore(fullBackupPath string, trace bool) error

Restore executes a job to retrieve the logical backup specified and then applies it to the database if trace is true, restore commands are printed to stdout

func (*PostgresqlDB) RestoreRestic added in v0.46.0

func (db *PostgresqlDB) RestoreRestic(fullBackupPath string, trace bool) error

func (*PostgresqlDB) RestoreS3 added in v0.46.0

func (db *PostgresqlDB) RestoreS3(backup string, trace bool) error

type ResticSnapshot added in v0.35.0

type ResticSnapshot struct {
	Time    time.Time
	Paths   []string
	Tags    []string
	ID      string
	ShortID string `json:"short_id"`
}

Jump to

Keyboard shortcuts

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