Documentation ¶
Index ¶
- Variables
- type AddSlaveRequest
- type CloneRequest
- type FailoverRequest
- type MonitorRequest
- type NodeManager
- type NodeStore
- func (nm *NodeStore) AddNode(node *RedisNode)
- func (nm *NodeStore) ErrorNodeCount() (count int)
- func (nm *NodeStore) FreeNodeCount() int
- func (nm *NodeStore) GetFreeNodes() (nodes []*RedisNode)
- func (nm *NodeStore) GetNode(name string) (node *RedisNode)
- func (nm *NodeStore) GetNodes() (nodes []*RedisNode)
- func (nm *NodeStore) GetNodesInError() (nodes []*RedisNode)
- func (nm *NodeStore) HasFreeNodes() bool
- func (nm *NodeStore) HasNodesInErrorState() bool
- func (nm *NodeStore) LoadNodes() bool
- func (nm *NodeStore) NodeCount() int
- type RedisNode
- type RedisPod
Constants ¶
This section is empty.
Variables ¶
View Source
var DialTimeout time.Duration = 900 * time.Millisecond
View Source
var NodeRefreshInterval float64
View Source
var NodesMap map[string]*RedisNode
Functions ¶
This section is empty.
Types ¶
type AddSlaveRequest ¶
type CloneRequest ¶
type FailoverRequest ¶
type MonitorRequest ¶
type NodeManager ¶
type NodeStore ¶
type NodeStore struct { Name string Type string Nodes []*RedisNode NodesMap map[string]*RedisNode NodesInError []*RedisNode FreeNodes []*RedisNode }
func (*NodeStore) ErrorNodeCount ¶
func (*NodeStore) FreeNodeCount ¶
func (*NodeStore) GetFreeNodes ¶
func (*NodeStore) GetNodesInError ¶
func (*NodeStore) HasFreeNodes ¶
func (*NodeStore) HasNodesInErrorState ¶
type RedisNode ¶
type RedisNode struct { Name string Address string Port int MaxMemory int LastStart time.Time Info structures.RedisInfoAll Slaves []*RedisNode AOFEnabled bool SaveEnabled bool PercentUsed float64 MemoryUseWarn bool MemoryUseCritical bool HasEnoughMemoryForMaster bool Auth string LastUpdate time.Time LastUpdateValid bool LastUpdateDelay time.Duration HasValidAuth bool Connected bool LatencyHistory client.LatencyHistory LatencyHistoryFastCommand client.LatencyHistory LatencyThreshold int LatencyDoctor string LatencyMonitoringEnabled bool SlowLogThreshold int64 SlowLogLength int64 SlowLogRecords []*client.SlowLog }
func LoadNodeFromHostPort ¶
func (*RedisNode) InErrorState ¶
func (*RedisNode) IsPromotable ¶
func (*RedisNode) MaxMemoryHuman ¶
func (*RedisNode) UpdateData ¶
UpdateData will check if an update is needed, and update if so. It returns a boolean indicating if an update was done and an err.
func (*RedisNode) UptimeHuman ¶
type RedisPod ¶
type RedisPod struct { Name string Info structures.MasterInfo Slaves []structures.InfoSlaves Master *RedisNode SentinelCount int ActiveSentinelCount int ReportedSentinelCount int AuthToken string ValidAuth bool ValidMasterConnection bool NeededSentinels int MissingSentinels bool TooManySentinels bool HasInfo bool NeedsReset bool HasValidSlaves bool }
func (*RedisPod) CanFailover ¶
CanFailover tests failover conditions to determine if a failover call would succeed
func (*RedisPod) HasErrors ¶
HasErrors checks various error conditions and returns t/f TODO: Some of these are better categorized as warnings and this should be split into a pair of functions: one for errors and one for warning. This will require additional work to incorporate the HasWarnings concept through the system.
func (*RedisPod) SlavesHaveEnoughMemory ¶
SlavesHaveEnoughMemory checks all slaves for their maximum memory to validate they match or beter the master
Click to show internal directories.
Click to hide internal directories.