Documentation
¶
Index ¶
- Variables
- func CheckDBStatus(ctx context.Context, connString string) error
- func CreateReplRole(ctx context.Context, connString, replUser, replPassword string) error
- func CreateReplicationSlot(ctx context.Context, connString string, name string) error
- func DropReplicationSlot(ctx context.Context, connString string, name string) error
- func Exec(ctx context.Context, db *sql.DB, query string, args ...interface{}) (sql.Result, error)
- func GetPGMasterLocation(ctx context.Context, connString string) (uint64, error)
- func GetPGState(ctx context.Context, replConnString string) (*cluster.PostgresState, error)
- func GetReplicatinSlots(ctx context.Context, connString string) ([]string, error)
- func GetRole(ctx context.Context, connString string) (common.Role, error)
- func GetTimelinesHistory(ctx context.Context, timeline uint64, replConnString string) (cluster.PostgresTimeLinesHistory, error)
- func IsValidReplSlotName(name string) bool
- func PGLSNToInt(lsn string) (uint64, error)
- func ParseConnString(name string) (connParams, error)
- func Query(ctx context.Context, db *sql.DB, query string, args ...interface{}) (*sql.Rows, error)
- func URLToConnParams(urlStr string) (connParams, error)
- type Manager
- func (p *Manager) BecomeStandby(masterconnString string) error
- func (p *Manager) CreateReplRole() error
- func (p *Manager) CreateReplicationSlot(name string) error
- func (p *Manager) DropReplicationSlot(name string) error
- func (p *Manager) GetParameters() Parameters
- func (p *Manager) GetPrimaryConninfo() (connParams, error)
- func (p *Manager) GetReplicatinSlots() ([]string, error)
- func (p *Manager) GetRole() (common.Role, error)
- func (p *Manager) GetRoleFromDB() (common.Role, error)
- func (p *Manager) HasConnString() (bool, error)
- func (p *Manager) Init() error
- func (p *Manager) IsInitialized() (bool, error)
- func (p *Manager) IsStarted() (bool, error)
- func (p *Manager) Promote() error
- func (p *Manager) Reload() error
- func (p *Manager) RemoveAll() error
- func (p *Manager) Restart(fast bool) error
- func (p *Manager) SetParameters(parameters Parameters)
- func (p *Manager) Start() error
- func (p *Manager) Stop(fast bool) error
- func (p *Manager) SyncFromMaster(masterconnString string) error
- func (p *Manager) WriteConf() error
- func (p *Manager) WriteRecoveryConf(masterconnString string) error
- type Parameters
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ValidReplSlotName = regexp.MustCompile("^[a-z0-9_]+$")
)
Functions ¶
func CreateReplRole ¶
func CreateReplicationSlot ¶
func DropReplicationSlot ¶
func GetPGMasterLocation ¶
func GetPGState ¶
func GetReplicatinSlots ¶
func GetTimelinesHistory ¶
func IsValidReplSlotName ¶
func PGLSNToInt ¶
func ParseConnString ¶
ParseConnString parses the options from name and adds them to the values.
The parsing code is based on conninfo_parse from libpq's fe-connect.c
func URLToConnParams ¶
URLToConnParams creates the connParams from the url.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) BecomeStandby ¶
func (*Manager) CreateReplRole ¶
func (*Manager) CreateReplicationSlot ¶
func (*Manager) DropReplicationSlot ¶
func (*Manager) GetParameters ¶
func (p *Manager) GetParameters() Parameters
func (*Manager) GetPrimaryConninfo ¶
func (*Manager) GetReplicatinSlots ¶
func (*Manager) HasConnString ¶
func (*Manager) IsInitialized ¶
func (*Manager) SetParameters ¶
func (p *Manager) SetParameters(parameters Parameters)
func (*Manager) SyncFromMaster ¶
func (*Manager) WriteRecoveryConf ¶
type Parameters ¶
func (Parameters) Copy ¶
func (s Parameters) Copy() Parameters
func (Parameters) Equals ¶
func (s Parameters) Equals(is Parameters) bool
func (Parameters) Set ¶
func (s Parameters) Set(k, v string)
Click to show internal directories.
Click to hide internal directories.