Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consul ¶
type Consul struct { Ready bool Healthy bool Master bool MasterAddr string MasterPort int Stopped bool }
Consul state used by the reconciler to decide what actions to take
func (*Consul) IsMaster ¶
isConsulMaster return whether the Consul lock is held or not if it's held, the Redis under management should become master
func (*Consul) IsSlave ¶
isConsulSlave return whether the Consul lock is held or not if its *not* hold, the Reids under management should become slave
func (*Consul) IsUnhealhy ¶
func (*Consul) NoMasterElected ¶
NoMasterElected return whether any Consul elected Redis master exist
type Redis ¶
type Redis struct { Healthy bool // are we able to connect to Redis? Ready bool // are we ready to provide state for the reconciler? Info RedisStatus // parse "info" data InfoString string `testdiff:"ignore"` // raw "info" data Stopped bool }
Redis state represent the full state of the connection with Redis
func (*Redis) IsRedisMaster ¶
isRedisMaster return whether the Redis under management currently see itself as a master instance or not
func (*Redis) IsUnhealthy ¶
type RedisStatus ¶
type RedisStatus struct { Role string // current redis role (master or slave) Loading bool // is redis currently loading data from disk? MasterLinkUp bool // is the link to master up (master_link_status == up) MasterLinkDownSince time.Duration // for how long has the master link been down? MasterSyncInProgress bool // is a master sync in progress? MasterHost string // if slave, the master hostname its replicating from MasterPort int // if slave, the master port its replicating from }
func (*RedisStatus) Changed ¶
func (r *RedisStatus) Changed(new RedisStatus) bool
changed will test if the current replication state is different from the new one passed in as argument