Versions in this module Expand all Collapse all v1 v1.1.0 Aug 27, 2025 v1.0.0 Aug 14, 2025 Changes in this version + const ClusterInfosConsistent + const ClusterInfosInconsistent + const ClusterInfosPartial + const ClusterInfosUnset + const DefaultHashMaxSlots + const DefaultRedisPort + const ErrNotFound + const NodeStatusFail + const NodeStatusHandshake + const NodeStatusNoAddr + const NodeStatusNoFlags + const NodeStatusPFail + const RedisLinkStateConnected + const RedisLinkStateDisconnected + const RedisMasterRole + const RedisReplicaRole + const RedisSlaveRole + const RedisSourceRole + const ResetHard + const ResetSoft + var IsMasterWithNoSlot = func(n *ClusterNode) bool + var IsMasterWithSlot = func(n *ClusterNode) bool + var IsSlave = func(n *ClusterNode) bool + func Contains(s []Slot, e Slot) bool + func DecodeNodeStartTime(input *string, log logr.Logger) (time.Time, error) + 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 *ClusterNode) bool + func MoreByID(n1, n2 *ClusterNode) bool + type AdminConnections struct + func (cnx *AdminConnections) Add(addr string) error + func (cnx *AdminConnections) AddAll(addrs []string) + func (cnx *AdminConnections) Close() + func (cnx *AdminConnections) Get(addr string) (IClient, error) + func (cnx *AdminConnections) GetAUTH() (string, bool) + func (cnx *AdminConnections) GetAll() map[string]IClient + func (cnx *AdminConnections) GetDifferentFrom(addr string) (IClient, error) + func (cnx *AdminConnections) GetRandom() (IClient, error) + func (cnx *AdminConnections) GetSelected(addrs []string) map[string]IClient + func (cnx *AdminConnections) Reconnect(addr string) error + func (cnx *AdminConnections) Remove(addr string) + func (cnx *AdminConnections) ReplaceAll(addrs []string) + func (cnx *AdminConnections) Reset() + func (cnx *AdminConnections) Update(addr string) (IClient, error) + func (cnx *AdminConnections) ValidatePipeResp(client IClient, addr, errMessage string) bool + func (cnx *AdminConnections) ValidateResp(resp *redis.Resp, addr, errMessage string) error + type AdminOptions struct + ClientName string + ConnectionTimeout time.Duration + Password string + type Client struct + func (c *Client) Close() error + func (c *Client) Cmd(cmd string, args ...interface{}) *redis.Resp + func (c *Client) PipeAppend(cmd string, args ...interface{}) + func (c *Client) PipeClear() (int, int) + func (c *Client) PipeResp() *redis.Resp + type Cluster struct + ActionsInfo ClusterActionsInfo + Name string + Namespace string + Nodes map[string]*ClusterNode + Status ClusterStatus + func NewCluster(name, namespace string) *Cluster + func (c *Cluster) AddNode(node *ClusterNode) + func (c *Cluster) GetNodeByFunc(f FindNodeFunc) (*ClusterNode, error) + func (c *Cluster) GetNodeByID(id string) (*ClusterNode, error) + func (c *Cluster) GetNodeByIP(ip string) (*ClusterNode, error) + type ClusterActionsInfo struct + NbslotsToMigrate int32 + type ClusterAdmin struct + func (a *ClusterAdmin) AddSlots(addr string, slots []Slot) error + func (a *ClusterAdmin) AttachNodeToCluster(addr string) error + func (a *ClusterAdmin) AttachSlaveToMaster(slave *ClusterNode, masterID string) error + func (a *ClusterAdmin) Close() + func (a *ClusterAdmin) ClusterManagerNodeIsEmpty() (bool, error) + func (a *ClusterAdmin) Connections() IAdminConnections + func (a *ClusterAdmin) DetachSlave(slave *ClusterNode) error + func (a *ClusterAdmin) FlushAndReset(addr string, mode string) error + func (a *ClusterAdmin) ForgetNode(id string) error + func (a *ClusterAdmin) GetAllConfig(c IClient, addr string) (map[string]string, error) + func (a *ClusterAdmin) GetClusterInfos() (*ClusterInfos, error) + func (a *ClusterAdmin) GetHashMaxSlot() Slot + func (a *ClusterAdmin) MigrateKeys(addr string, dest *ClusterNode, slots []Slot, batch int, timeout int, ...) (int, error) + func (a *ClusterAdmin) MigrateKeysInSlot(addr string, dest *ClusterNode, slot Slot, batch int, timeout int, ...) (int, error) + func (a *ClusterAdmin) SetConfigEpoch() error + func (a *ClusterAdmin) SetSlot(addr, action string, slot Slot, nodeID string) error + func (a *ClusterAdmin) SetSlots(addr, action string, slots []Slot, nodeID string) error + type ClusterInfos struct + Infos map[string]*NodeInfos + Status string + func NewClusterInfos() *ClusterInfos + func (c *ClusterInfos) ComputeStatus(log logr.Logger) bool + func (c *ClusterInfos) GetNodes() ClusterNodes + type ClusterInfosError struct + func NewClusterInfosError() ClusterInfosError + func (e ClusterInfosError) Error() string + func (e ClusterInfosError) Inconsistent() bool + func (e ClusterInfosError) Partial() bool + type ClusterNode struct + ConfigEpoch int64 + FailStatus []string + ID string + IP string + ImportingSlots map[Slot]string + LinkState string + MasterReferent string + MigratingSlots map[Slot]string + NodeName string + PingSent int64 + PongRecv int64 + Port string + Role string + ServerStartTime time.Time + ShardName string + Slots []Slot + func NewClusterNode(name, id, ip string) *ClusterNode + func NewDefaultClusterNode() *ClusterNode + func (n *ClusterNode) Balance() int + func (n *ClusterNode) Clear() + func (n *ClusterNode) GetRole() composev1alpha1.RedisClusterNodeRole + func (n *ClusterNode) HasStatus(flag string) bool + func (n *ClusterNode) IPPort() string + func (n *ClusterNode) SetBalance(balance int) + func (n *ClusterNode) SetFailureStatus(flags string) + func (n *ClusterNode) SetLinkStatus(status string) error + func (n *ClusterNode) SetReferentMaster(ref string) + func (n *ClusterNode) SetRole(flags string) error + func (n *ClusterNode) String() string + func (n *ClusterNode) ToAPINode() composev1alpha1.RedisClusterNode + func (n *ClusterNode) TotalSlots() int + type ClusterNodes []*ClusterNode + func (n ClusterNodes) CountByFunc(fn func(*ClusterNode) bool) (result int) + func (n ClusterNodes) FilterByFunc(fn func(*ClusterNode) bool) ClusterNodes + func (n ClusterNodes) GetNodeByID(id string) (*ClusterNode, error) + func (n ClusterNodes) GetNodesByFunc(f FindNodeFunc) (ClusterNodes, error) + func (n ClusterNodes) Len() int + func (n ClusterNodes) Less(i, j int) bool + func (n ClusterNodes) SortByFunc(less func(*ClusterNode, *ClusterNode) bool) ClusterNodes + func (n ClusterNodes) SortNodes() ClusterNodes + func (n ClusterNodes) String() string + func (n ClusterNodes) Swap(i, j int) + type ClusterStatus string + const ClusterStatusKO + const ClusterStatusOK + type ConfigSignature map[string]SlotSlice + func (c ConfigSignature) String() string + type Error string + func (e Error) Error() string + type FindNodeFunc func(node *ClusterNode) bool + type IAdminConnections interface + Add func(addr string) error + AddAll func(addrs []string) + Get func(addr string) (IClient, error) + GetAUTH func() (string, bool) + GetAll func() map[string]IClient + GetDifferentFrom func(addr string) (IClient, error) + GetRandom func() (IClient, error) + GetSelected func(addrs []string) map[string]IClient + Reconnect func(addr string) error + Remove func(addr string) + ReplaceAll func(addrs []string) + Reset func() + ValidatePipeResp func(c IClient, addr, errMessage string) bool + ValidateResp func(resp *redis.Resp, addr, errMessage string) error + func NewAdminConnections(addrs []string, options *AdminOptions, log logr.Logger) IAdminConnections + type IClient interface + Close func() error + Cmd func(cmd string, args ...interface{}) *redis.Resp + PipeAppend func(cmd string, args ...interface{}) + PipeClear func() (int, int) + PipeResp func() *redis.Resp + func NewClient(addr, password string, cnxTimeout time.Duration) (IClient, error) + type IClusterAdmin interface + AddSlots func(addr string, slots []Slot) error + AttachNodeToCluster func(addr string) error + AttachSlaveToMaster func(slave *ClusterNode, masterID string) error + Close func() + ClusterManagerNodeIsEmpty func() (bool, error) + Connections func() IAdminConnections + DetachSlave func(slave *ClusterNode) error + ForgetNode func(id string) error + GetAllConfig func(c IClient, addr string) (map[string]string, error) + GetClusterInfos func() (*ClusterInfos, error) + GetHashMaxSlot func() Slot + MigrateKeys func(addr string, dest *ClusterNode, slots []Slot, batch, timeout int, replace bool) (int, error) + MigrateKeysInSlot func(addr string, dest *ClusterNode, slot Slot, batch int, timeout int, ...) (int, error) + SetConfigEpoch func() error + SetSlot func(addr, action string, slot Slot, nodeID string) error + SetSlots func(addr string, action string, slots []Slot, nodeID string) error + func NewClusterAdmin(addrs []string, options *AdminOptions, log logr.Logger) IClusterAdmin + type IReplicationAdmin interface + Close func() + Connections func() IAdminConnections + GetReplicationStatus func() *ReplicationInfo + ReplicaOfNoOne func(addr string) error + ReplicaOfSource func(addr, sourceHost, sourcePort string) error + func NewReplicationAdmin(addrs []string, options *AdminOptions, log logr.Logger) IReplicationAdmin + 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 NodeInfos struct + Friends ClusterNodes + Node *ClusterNode + func DecodeNodeInfos(input *string, addr string, log logr.Logger) *NodeInfos + func NewNodeInfos() *NodeInfos + type ReplicationAdmin struct + func (a *ReplicationAdmin) Close() + func (a *ReplicationAdmin) Connections() IAdminConnections + func (a *ReplicationAdmin) GetReplicationStatus() *ReplicationInfo + func (a *ReplicationAdmin) ReplicaOfNoOne(addr string) error + func (a *ReplicationAdmin) ReplicaOfSource(addr, sourceHost, sourcePort string) error + type ReplicationInfo struct + Nodes map[string]*ReplicationNode + func NewReplicationInfo() *ReplicationInfo + type ReplicationNode struct + Host string + Port string + Ready bool + Role string + SourceHost string + SourcePort string + func DecodeNode(input *string, addr string, log logr.Logger) *ReplicationNode + func NewDefaultReplicationNode() *ReplicationNode + func (n *ReplicationNode) GetRole() composev1alpha1.RedisReplicationRole + func (n *ReplicationNode) GetSourcePort() int + func (n *ReplicationNode) HostPort() string + type ReplicationNodes []*ReplicationNode + type Slot uint64 + func AddSlots(slots []Slot, addedSlots []Slot) []Slot + func BuildSlotSlice(min, max Slot) []Slot + func DecodeSlot(s string) (Slot, error) + func RemoveSlot(slots []Slot, removedSlot Slot) []Slot + 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)