Documentation ¶
Index ¶
- Constants
- func EqStrings(a, b []string) bool
- func SwitchPrimary(ctx context.Context, mysql *v1.Mysql, id int) error
- func SwitchPrimaryAll(mysql *v1.Mysql) map[int]error
- type Myctl
- func (ctl *Myctl) GetOrNewGroup(mysql *v1.Mysql) (*MysqlGroup, error)
- func (ctl *Myctl) PullMysqlGroup(ctx *tiny.Context) *MysqlGroup
- func (ctl *Myctl) Purge(k types.NamespacedName) error
- func (ctl *Myctl) PushMysqlGroup(ctx *tiny.Context)
- func (ctl *Myctl) Route(r *tiny.Router)
- func (ctl *Myctl) Run()
- func (ctl *Myctl) SyncSpec(mysql *v1.Mysql) error
- func (ctl *Myctl) SyncStatus(mysql *v1.Mysql) error
- type MysqlGroup
Constants ¶
View Source
const ( Timeout5s = 5 * time.Second Timeout15s = 15 * time.Second SwitchCount = 2 MyctlReplicas = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Myctl ¶
type Myctl struct { sync.Mutex C chan event.GenericEvent M map[types.NamespacedName]*MysqlGroup ReadinessProbe bool LivenessProbe bool StartupProbe bool }
func (*Myctl) GetOrNewGroup ¶
func (ctl *Myctl) GetOrNewGroup(mysql *v1.Mysql) (*MysqlGroup, error)
func (*Myctl) PullMysqlGroup ¶
func (ctl *Myctl) PullMysqlGroup(ctx *tiny.Context) *MysqlGroup
func (*Myctl) PushMysqlGroup ¶
type MysqlGroup ¶
type MysqlGroup struct { *Myctl *v1.Mysql States map[mylet.StateKey]*mylet.MysqlState SwitchCount int SwitchTime time.Time Running bool ExitChan chan struct{} }
func (*MysqlGroup) Check ¶
func (g *MysqlGroup) Check() error
func (*MysqlGroup) Color ¶
func (g *MysqlGroup) Color(id int) (red, yellow, green int)
func (*MysqlGroup) Start ¶
func (g *MysqlGroup) Start()
func (*MysqlGroup) SwitchPrimary ¶
func (g *MysqlGroup) SwitchPrimary(newId int) error
Click to show internal directories.
Click to hide internal directories.