Versions in this module Expand all Collapse all v1 v1.0.1 Apr 29, 2021 v1.0.0 Apr 29, 2021 Changes in this version + const DefaultRedisPort + const HashMaxSlots + const NodeStatusFail + const NodeStatusHandshake + const NodeStatusNoAddr + const NodeStatusNoFlags + const NodeStatusPFail + const RedisLinkStateConnected + const RedisLinkStateDisconnected + const RedisMasterRole + const RedisNoneRole + const RedisSlaveRole + const RedisStandaloneRole + const ResetHard + const ResetSoft + var IsMasterWithNoSlot = func(n *Node) bool + var IsMasterWithSlot = func(n *Node) bool + var IsSlave = func(n *Node) bool + func Contains(s []Slot, e Slot) bool + func DecodeClusterInfos(input *string) *map[string]string + func DecodeSlotRange(str string) ([]Slot, *ImportingSlot, *MigratingSlot, error) + func IsInconsistentError(err error) bool + func IsNodeNotFoundedError(err error) bool + func IsPartialError(err error) bool + func LessByID(n1, n2 *Node) bool + func MoreByID(n1, n2 *Node) bool + func NewClient(addr, password string) *redis.Client + func NewClusterClient(addrs []string, password string) *redis.ClusterClient + func SetRedisConfig(ctx context.Context, rc *redis.Client, newConfig map[string]string) error + type Admin struct + func (a *Admin) CloseClient() + func (a *Admin) CloseClusterClient() + func (a *Admin) GetClusterInfos() (*map[string]string, error) + func (a *Admin) GetClusterNodes() (*Nodes, error) + func (a *Admin) GetHashMaxSlot() Slot + func (a *Admin) SetConfigIfNeed(newConfig map[string]string) error + func (a *Admin) UpdateMasterConfig(newConfig map[string]string) error + func (a *Admin) UpdateSlaveConfig(newConfig map[string]string) error + type AdminInterface interface + CloseClient func() + CloseClusterClient func() + GetClusterInfos func() (*map[string]string, error) + GetClusterNodes func() (*Nodes, error) + GetHashMaxSlot func() Slot + SetConfigIfNeed func(newConfig map[string]string) error + func NewAdmin(addrs []string, password string) AdminInterface + type ClusterInfosError struct + func NewClusterInfosError() ClusterInfosError + func (e ClusterInfosError) Error() string + func (e ClusterInfosError) Inconsistent() bool + func (e ClusterInfosError) Partial() bool + type ClusterStatus string + const ClusterStatusCalculatingRebalancing + const ClusterStatusKO + const ClusterStatusOK + const ClusterStatusRebalancing + const ClusterStatusRollingUpdate + const ClusterStatusScaling + type Error string + func (e Error) Error() string + type FindNodeFunc func(node *Node) bool + type ImportingSlot struct + FromNodeID string + SlotID Slot + func (s ImportingSlot) String() string + type MigratingSlot struct + SlotID Slot + ToNodeID string + func (s MigratingSlot) String() string + type Node struct + ConfigEpoch int64 + FailStatus []string + ID string + IP string + ImportingSlots map[Slot]string + LinkState string + MasterReferent string + MigratingSlots map[Slot]string + PingSent int64 + Pod *corev1.Pod + PongRecv int64 + Port string + Role string + ServerStartTime time.Time + Slots []Slot + func NewDefaultNode() *Node + func NewNode(id, ip string, pod *corev1.Pod) *Node + func (n *Node) Clear() + func (n *Node) GetRole() string + func (n *Node) HasStatus(flag string) bool + func (n *Node) IPPort() string + func (n *Node) SetFailureStatus(flags string) + func (n *Node) SetLinkStatus(status string) + func (n *Node) SetReferentMaster(ref string) + func (n *Node) SetRole(flags string) + func (n *Node) String() string + func (n *Node) TotalSlots() int + type Nodes []*Node + func DecodeNodeInfos(input *string) *Nodes + func (n Nodes) CountByFunc(fn func(*Node) bool) (result int) + func (n Nodes) FilterByFunc(fn func(*Node) bool) Nodes + func (n Nodes) GetNodeByAddr(addr string) (*Node, error) + func (n Nodes) GetNodeByID(id string) (*Node, error) + func (n Nodes) GetNodeByMasterID(id string) (*Node, error) + func (n Nodes) GetNodesByFunc(f FindNodeFunc) (Nodes, error) + func (n Nodes) Len() int + func (n Nodes) Less(i, j int) bool + func (n Nodes) SortByFunc(less func(*Node, *Node) bool) Nodes + func (n Nodes) SortNodes() Nodes + func (n Nodes) String() string + func (n Nodes) Swap(i, j int) + type NodesPlacementInfo string + const NodesPlacementInfoBestEffort + const NodesPlacementInfoOptimal + type Slot uint64 + func AddSlots(slots []Slot, addedSlots []Slot) []Slot + func BuildSlotSlice(min, max Slot) []Slot + func DecodeSlot(s string) (Slot, error) + func RemoveSlots(slots []Slot, removedSlots []Slot) []Slot + func (s Slot) String() string + type SlotRange struct + Max Slot + Min Slot + func SlotRangesFromSlots(slots []Slot) []SlotRange + func (s SlotRange) String() string + func (s SlotRange) Total() int + type SlotSlice []Slot + func (s SlotSlice) Len() int + func (s SlotSlice) Less(i, j int) bool + func (s SlotSlice) String() string + func (s SlotSlice) Swap(i, j int)