Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) GetLeaderMember() *Member
- func (c *Cluster) GetMemberAddr(member Member) string
- func (c *Cluster) GetMemberAddrWithName(name string) string
- func (c *Cluster) GetMemberAddrWithPort(member Member) string
- func (c *Cluster) GetMemberAddrs() []string
- func (c *Cluster) GetMemberName() []string
- func (c *Cluster) GetMemberWithHost(host string) *Member
- func (c *Cluster) GetMemberWithName(name string) *Member
- func (c *Cluster) HasMember(memberName string) bool
- func (c *Cluster) IsLocked() bool
- type DBState
- type DCS
- type HaConfig
- func (c *HaConfig) AddMemberToDelete(member *Member)
- func (c *HaConfig) FinishDeleted(member *Member)
- func (c *HaConfig) GetMaxLagOnSwitchover() int64
- func (c *HaConfig) GetMemberToDelete(member *Member) *MemberToDelete
- func (c *HaConfig) GetTTL() int
- func (c *HaConfig) IsDeleted(member *Member) bool
- func (c *HaConfig) IsDeleting(member *Member) bool
- type KubernetesStore
- func (store *KubernetesStore) AddCurrentMember() error
- func (store *KubernetesStore) AttempAcquireLock() error
- func (store *KubernetesStore) CreateHaConfig(cluster *Cluster) error
- func (store *KubernetesStore) CreateLock() error
- func (store *KubernetesStore) CreateSwitchover(leader, candidate string) error
- func (store *KubernetesStore) DeleteCluser()
- func (store *KubernetesStore) DeleteLeader() error
- func (store *KubernetesStore) DeleteSwitchover() error
- func (store *KubernetesStore) GetCluster() (*Cluster, error)
- func (store *KubernetesStore) GetClusterFromCache() *Cluster
- func (store *KubernetesStore) GetClusterName() string
- func (store *KubernetesStore) GetHaConfig() (*HaConfig, error)
- func (store *KubernetesStore) GetLeader() (*Leader, error)
- func (store *KubernetesStore) GetLeaderConfigMap() (*corev1.ConfigMap, error)
- func (store *KubernetesStore) GetMembers() ([]Member, error)
- func (store *KubernetesStore) GetSwitchOverConfigMap() (*corev1.ConfigMap, error)
- func (store *KubernetesStore) GetSwitchover() (*Switchover, error)
- func (store *KubernetesStore) HasLock() bool
- func (store *KubernetesStore) Initialize(cluster *Cluster) error
- func (store *KubernetesStore) IsLockExist() (bool, error)
- func (store *KubernetesStore) ReleaseLock() error
- func (store *KubernetesStore) ResetCluser()
- func (store *KubernetesStore) UpdateHaConfig() error
- func (store *KubernetesStore) UpdateLock() error
- type Leader
- type Member
- type MemberToDelete
- type Switchover
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { ClusterCompName string Namespace string Replicas int32 HaConfig *HaConfig Leader *Leader Members []Member Switchover *Switchover Extra map[string]string // contains filtered or unexported fields }
func (*Cluster) GetLeaderMember ¶
func (*Cluster) GetMemberAddr ¶
func (*Cluster) GetMemberAddrWithName ¶
func (*Cluster) GetMemberAddrWithPort ¶
func (*Cluster) GetMemberAddrs ¶
func (*Cluster) GetMemberName ¶
func (*Cluster) GetMemberWithHost ¶
func (*Cluster) GetMemberWithName ¶
type DCS ¶
type DCS interface { Initialize(*Cluster) error // cluster manage functions GetClusterName() string GetCluster() (*Cluster, error) ResetCluser() DeleteCluser() // cluster scole ha config GetHaConfig() (*HaConfig, error) UpdateHaConfig() error // member manager funtions GetMembers() ([]Member, error) AddCurrentMember() error // manual switchover GetSwitchover() (*Switchover, error) CreateSwitchover(string, string) error DeleteSwitchover() error // cluster scope leader lock AttempAcquireLock() error CreateLock() error IsLockExist() (bool, error) HasLock() bool ReleaseLock() error UpdateLock() error GetLeader() (*Leader, error) }
type HaConfig ¶
type HaConfig struct { DeleteMembers map[string]MemberToDelete // contains filtered or unexported fields }
func (*HaConfig) AddMemberToDelete ¶
func (*HaConfig) FinishDeleted ¶
func (*HaConfig) GetMaxLagOnSwitchover ¶
func (*HaConfig) GetMemberToDelete ¶
func (c *HaConfig) GetMemberToDelete(member *Member) *MemberToDelete
func (*HaConfig) IsDeleting ¶
type KubernetesStore ¶
type KubernetesStore struct { LeaderObservedTime int64 // contains filtered or unexported fields }
func NewKubernetesStore ¶
func NewKubernetesStore(logger logr.Logger) (*KubernetesStore, error)
func (*KubernetesStore) AddCurrentMember ¶
func (store *KubernetesStore) AddCurrentMember() error
func (*KubernetesStore) AttempAcquireLock ¶
func (store *KubernetesStore) AttempAcquireLock() error
func (*KubernetesStore) CreateHaConfig ¶
func (store *KubernetesStore) CreateHaConfig(cluster *Cluster) error
func (*KubernetesStore) CreateLock ¶
func (store *KubernetesStore) CreateLock() error
func (*KubernetesStore) CreateSwitchover ¶
func (store *KubernetesStore) CreateSwitchover(leader, candidate string) error
func (*KubernetesStore) DeleteCluser ¶
func (store *KubernetesStore) DeleteCluser()
func (*KubernetesStore) DeleteLeader ¶
func (store *KubernetesStore) DeleteLeader() error
func (*KubernetesStore) DeleteSwitchover ¶
func (store *KubernetesStore) DeleteSwitchover() error
func (*KubernetesStore) GetCluster ¶
func (store *KubernetesStore) GetCluster() (*Cluster, error)
func (*KubernetesStore) GetClusterFromCache ¶
func (store *KubernetesStore) GetClusterFromCache() *Cluster
func (*KubernetesStore) GetClusterName ¶
func (store *KubernetesStore) GetClusterName() string
func (*KubernetesStore) GetHaConfig ¶
func (store *KubernetesStore) GetHaConfig() (*HaConfig, error)
func (*KubernetesStore) GetLeader ¶
func (store *KubernetesStore) GetLeader() (*Leader, error)
func (*KubernetesStore) GetLeaderConfigMap ¶
func (store *KubernetesStore) GetLeaderConfigMap() (*corev1.ConfigMap, error)
func (*KubernetesStore) GetMembers ¶
func (store *KubernetesStore) GetMembers() ([]Member, error)
func (*KubernetesStore) GetSwitchOverConfigMap ¶
func (store *KubernetesStore) GetSwitchOverConfigMap() (*corev1.ConfigMap, error)
func (*KubernetesStore) GetSwitchover ¶
func (store *KubernetesStore) GetSwitchover() (*Switchover, error)
func (*KubernetesStore) HasLock ¶
func (store *KubernetesStore) HasLock() bool
func (*KubernetesStore) Initialize ¶
func (store *KubernetesStore) Initialize(cluster *Cluster) error
func (*KubernetesStore) IsLockExist ¶
func (store *KubernetesStore) IsLockExist() (bool, error)
func (*KubernetesStore) ReleaseLock ¶
func (store *KubernetesStore) ReleaseLock() error
func (*KubernetesStore) ResetCluser ¶
func (store *KubernetesStore) ResetCluser()
func (*KubernetesStore) UpdateHaConfig ¶
func (store *KubernetesStore) UpdateHaConfig() error
func (*KubernetesStore) UpdateLock ¶
func (store *KubernetesStore) UpdateLock() error
type Member ¶
type MemberToDelete ¶
type Switchover ¶
func (*Switchover) GetCandidate ¶
func (s *Switchover) GetCandidate() string
func (*Switchover) GetLeader ¶
func (s *Switchover) GetLeader() string
Click to show internal directories.
Click to hide internal directories.