postgres

package
v0.6.0-beta.33 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 5432
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

func NewConfig

func NewConfig(properties map[string]string) (*Config, error)

func (*Config) GetConnectURLWithHost

func (config *Config) GetConnectURLWithHost(host string) string

func (*Config) GetDBPort

func (config *Config) GetDBPort() int

type Manager

type Manager struct {
	component.DBManagerBase
	Pool *pgxpool.Pool
	Proc *process.Process
}
var Mgr *Manager

func NewManager

func NewManager(logger logger.Logger) (*Manager, error)

func (*Manager) AddCurrentMemberToCluster

func (mgr *Manager) AddCurrentMemberToCluster(cluster *dcs.Cluster) error

AddCurrentMemberToCluster postgresql don't need to add member

func (*Manager) CreateRoot

func (mgr *Manager) CreateRoot(ctx context.Context) error

func (*Manager) DeleteMemberFromCluster

func (mgr *Manager) DeleteMemberFromCluster(cluster *dcs.Cluster, host string) error

DeleteMemberFromCluster postgresql don't need to delete member

func (*Manager) Demote

func (mgr *Manager) Demote() error

func (*Manager) Exec

func (mgr *Manager) Exec(ctx context.Context, sql string) (result int64, err error)

func (*Manager) Follow

func (mgr *Manager) Follow(cluster *dcs.Cluster) error

func (*Manager) GetHealthiestMember

func (mgr *Manager) GetHealthiestMember(cluster *dcs.Cluster, candidate string) *dcs.Member

func (*Manager) GetMemberAddrs

func (mgr *Manager) GetMemberAddrs(cluster *dcs.Cluster) []string

func (*Manager) GetMemberStateWithPool

func (mgr *Manager) GetMemberStateWithPool(ctx context.Context, pool *pgxpool.Pool) (string, error)

func (*Manager) GetOtherPoolsWithHosts

func (mgr *Manager) GetOtherPoolsWithHosts(ctx context.Context, hosts []string) ([]*pgxpool.Pool, error)

func (*Manager) HasOtherHealthyLeader

func (mgr *Manager) HasOtherHealthyLeader(ctx context.Context, cluster *dcs.Cluster) *dcs.Member

func (*Manager) HasOtherHealthyMembers

func (mgr *Manager) HasOtherHealthyMembers(ctx context.Context, cluster *dcs.Cluster, leader string) []*dcs.Member

func (*Manager) InitializeCluster

func (mgr *Manager) InitializeCluster(context.Context, *dcs.Cluster) error

func (*Manager) IsClusterHealthy

func (mgr *Manager) IsClusterHealthy(ctx context.Context, cluster *dcs.Cluster) bool

func (*Manager) IsClusterInitialized

func (mgr *Manager) IsClusterInitialized(ctx context.Context, cluster *dcs.Cluster) (bool, error)

func (*Manager) IsCurrentMemberHealthy

func (mgr *Manager) IsCurrentMemberHealthy(ctx context.Context) bool

func (*Manager) IsCurrentMemberInCluster

func (mgr *Manager) IsCurrentMemberInCluster(ctx context.Context, cluster *dcs.Cluster) bool

func (*Manager) IsDBStartupReady

func (mgr *Manager) IsDBStartupReady() bool

func (*Manager) IsLeader

func (mgr *Manager) IsLeader(ctx context.Context, cluster *dcs.Cluster) (bool, error)

func (*Manager) IsLeaderMember

func (mgr *Manager) IsLeaderMember(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) (bool, error)

func (*Manager) IsLeaderWithPool

func (mgr *Manager) IsLeaderWithPool(ctx context.Context, pool *pgxpool.Pool) (bool, error)

func (*Manager) IsMemberHealthy

func (mgr *Manager) IsMemberHealthy(ctx context.Context, cluster *dcs.Cluster, member *dcs.Member) bool

func (*Manager) IsRootCreated

func (mgr *Manager) IsRootCreated(ctx context.Context) (bool, error)

func (*Manager) IsRunning

func (mgr *Manager) IsRunning() bool

func (*Manager) Lock

func (mgr *Manager) Lock(ctx context.Context, reason string) error

func (*Manager) Promote

func (mgr *Manager) Promote() error

func (*Manager) Query

func (mgr *Manager) Query(ctx context.Context, sql string) (result []byte, err error)

func (*Manager) QueryWithPool

func (mgr *Manager) QueryWithPool(ctx context.Context, sql string, pool *pgxpool.Pool) (result []byte, err error)

func (*Manager) Recover

func (mgr *Manager) Recover()

func (*Manager) Start

func (mgr *Manager) Start() error

func (*Manager) Stop

func (mgr *Manager) Stop() error

func (*Manager) Unlock

func (mgr *Manager) Unlock(ctx context.Context) error

type PGStandby

type PGStandby struct {
	Types   string
	Amount  int
	Members mapset.Set
	HasStar bool
}

type PidFile

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

Jump to

Keyboard shortcuts

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