repl

package
v0.0.0-...-b59d530 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostInfo

type HostInfo struct {
	Host string `yaml:"host" json:"host"`
	IP   string `yaml:"ip" json:"ip"`
	Port int    `yaml:"port" json:"port"`
}

type KubeSeeker

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

func NewKubeSeeker

func NewKubeSeeker(clientSet *kubernetes.Clientset) *KubeSeeker

func (*KubeSeeker) GetHostInfoByClusterID

func (s *KubeSeeker) GetHostInfoByClusterID(clusterID string) (hosts []*HostInfo, err error)

func (*KubeSeeker) GetHostInfoByHostname

func (s *KubeSeeker) GetHostInfoByHostname(hostname string) (host *HostInfo, err error)

type ReplicationService

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

func NewReplicationService

func NewReplicationService(engine *xorm.Engine, replication config.Replication, seeker Seeker) *ReplicationService

func (*ReplicationService) BuildMasterSlave

func (r *ReplicationService) BuildMasterSlave() (err error)

func (*ReplicationService) CheckSlaveStatus

func (r *ReplicationService) CheckSlaveStatus() (ready bool, err error)

func (*ReplicationService) RefreshMaster

func (r *ReplicationService) RefreshMaster(replication config.Replication)

RefreshMaster when the master changes, refresh master

func (*ReplicationService) Start

func (r *ReplicationService) Start()

Start service of replication

func (*ReplicationService) Stop

func (r *ReplicationService) Stop()

Stop service of replication

type Seeker

type Seeker interface {
	GetHostInfoByHostname(hostname string) (*HostInfo, error)
	GetHostInfoByClusterID(id string) ([]*HostInfo, error)
}

Jump to

Keyboard shortcuts

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