Documentation ¶
Index ¶
- Constants
- type ClusterMember
- type ClusterMembers
- type Interface
- type MemberData
- type MemberDataPatroni
- type Patroni
- func (p *Patroni) GetClusterMembers(server *v1.Pod) ([]ClusterMember, error)
- func (p *Patroni) GetConfig(server *v1.Pod) (cpov1.Patroni, map[string]string, error)
- func (p *Patroni) GetMemberData(server *v1.Pod) (MemberData, error)
- func (p *Patroni) Restart(server *v1.Pod) error
- func (p *Patroni) SetConfig(server *v1.Pod, config map[string]interface{}) error
- func (p *Patroni) SetPostgresParameters(server *v1.Pod, parameters map[string]string) error
- func (p *Patroni) Switchover(master *v1.Pod, candidate string) error
- type ReplicationLag
Constants ¶
View Source
const (
ApiPort = 8008
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterMember ¶
type ClusterMember struct { Name string `json:"name"` Role string `json:"role"` State string `json:"state"` Timeline int `json:"timeline"` Lag ReplicationLag `json:"lag,omitempty"` }
ClusterMember cluster member data from Patroni API
type ClusterMembers ¶
type ClusterMembers struct {
Members []ClusterMember `json:"members"`
}
ClusterMembers array of cluster members from Patroni API
type Interface ¶
type Interface interface { GetClusterMembers(master *v1.Pod) ([]ClusterMember, error) Switchover(master *v1.Pod, candidate string) error SetPostgresParameters(server *v1.Pod, options map[string]string) error GetMemberData(server *v1.Pod) (MemberData, error) Restart(server *v1.Pod) error GetConfig(server *v1.Pod) (cpov1.Patroni, map[string]string, error) SetConfig(server *v1.Pod, config map[string]interface{}) error }
Interface describe patroni methods
type MemberData ¶
type MemberData struct { State string `json:"state"` Role string `json:"role"` ServerVersion int `json:"server_version"` PendingRestart bool `json:"pending_restart"` ClusterUnlocked bool `json:"cluster_unlocked"` Patroni MemberDataPatroni `json:"patroni"` }
MemberData Patroni member data from Patroni API
type MemberDataPatroni ¶
MemberDataPatroni child element
type Patroni ¶
type Patroni struct {
// contains filtered or unexported fields
}
Patroni API client
func (*Patroni) GetClusterMembers ¶
func (p *Patroni) GetClusterMembers(server *v1.Pod) ([]ClusterMember, error)
GetClusterMembers read cluster data from patroni API
func (*Patroni) GetMemberData ¶
func (p *Patroni) GetMemberData(server *v1.Pod) (MemberData, error)
GetMemberData read member data from patroni API
func (*Patroni) SetPostgresParameters ¶
SetPostgresParameters sets Postgres options via Patroni patch API call.
type ReplicationLag ¶
type ReplicationLag uint64
func (*ReplicationLag) UnmarshalJSON ¶
func (rl *ReplicationLag) UnmarshalJSON(data []byte) error
UnmarshalJSON converts member lag (can be int or string) into uint64
Click to show internal directories.
Click to hide internal directories.