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) (acidv1.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) SetStandbyClusterParameters(server *v1.Pod, parameters map[string]interface{}) 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 ¶ added in v1.8.0
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 ¶ added in v1.8.0
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 SetStandbyClusterParameters(server *v1.Pod, options map[string]interface{}) error GetMemberData(server *v1.Pod) (MemberData, error) Restart(server *v1.Pod) error GetConfig(server *v1.Pod) (acidv1.Patroni, map[string]string, error) SetConfig(server *v1.Pod, config map[string]interface{}) error }
Interface describe patroni methods
type MemberData ¶ added in v1.6.2
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 ¶ added in v1.6.2
MemberDataPatroni child element
type Patroni ¶
type Patroni struct {
// contains filtered or unexported fields
}
Patroni API client
func (*Patroni) GetClusterMembers ¶ added in v1.8.0
func (p *Patroni) GetClusterMembers(server *v1.Pod) ([]ClusterMember, error)
GetClusterMembers read cluster data from patroni API
func (*Patroni) GetMemberData ¶ added in v1.6.2
func (p *Patroni) GetMemberData(server *v1.Pod) (MemberData, error)
GetMemberData read member data from patroni API
func (*Patroni) Restart ¶ added in v1.7.0
Restart method restarts instance via Patroni POST API call.
func (*Patroni) SetConfig ¶ added in v1.7.0
SetConfig sets Patroni options via Patroni patch API call.
func (*Patroni) SetPostgresParameters ¶
SetPostgresParameters sets Postgres options via Patroni patch API call.
type ReplicationLag ¶ added in v1.8.1
type ReplicationLag uint64
func (*ReplicationLag) UnmarshalJSON ¶ added in v1.8.1
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.