postgres

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 18 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: golint

func GetPostgresDB

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

func (*PostgresDB) Backup

func (db *PostgresDB) Backup() error

func (*PostgresDB) GenerateBackupJob

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

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) ListBackups

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

func (*PostgresDB) OpenDB added in v0.39.0

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

func (*PostgresDB) Restore

func (db *PostgresDB) 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 (*PostgresDB) ScheduleBackup

func (db *PostgresDB) ScheduleBackup(schedule string) 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 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