Versions in this module Expand all Collapse all v1 v1.0.0 Mar 16, 2022 Changes in this version + const ClusterInfosConsistent + const ClusterInfosInconsistent + const ClusterInfosPartial + const ClusterInfosUnset + const DefaultRedisPort + const ErrNotFound + const HashMaxSlots + const NodeStatusFail + const NodeStatusHandshake + const NodeStatusNoAddr + const NodeStatusNoFlags + const NodeStatusPFail + const RedisLinkStateConnected + const RedisLinkStateDisconnected + 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 DecodeNodeStartTime(input *string) (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 *Node) bool + func MoreByID(n1, n2 *Node) bool + type Admin struct + func (a *Admin) AddSlots(addr string, slots []Slot) error + func (a *Admin) AttachNodeToCluster(addr string) error + func (a *Admin) AttachSlaveToMaster(slave *Node, master *Node) error + func (a *Admin) Close() + func (a *Admin) Connections() AdminConnectionsInterface + func (a *Admin) CountKeysInSlot(addr string, slot Slot) (int64, error) + func (a *Admin) DelSlots(addr string, slots []Slot) error + func (a *Admin) DetachSlave(slave *Node) error + func (a *Admin) FlushAll() + func (a *Admin) FlushAndReset(addr string, mode string) error + func (a *Admin) ForgetNode(id string) error + func (a *Admin) ForgetNodeByAddr(addr string) error + func (a *Admin) GetClusterInfos() (*ClusterInfos, error) + func (a *Admin) GetClusterInfosSelected(addrs []string) (*ClusterInfos, error) + func (a *Admin) GetHashMaxSlot() Slot + func (a *Admin) GetKeysInSlot(addr string, slot Slot, batch int, limit bool) ([]string, error) + func (a *Admin) InitRedisCluster(addr string) error + func (a *Admin) MigrateKeys(addr string, dest *Node, slots []Slot, batch int, timeout int, replace bool) (int, error) + func (a *Admin) RebuildConnectionMap(addrs []string, options *AdminOptions) + func (a *Admin) SetSlots(addr, action string, slots []Slot, nodeID string) error + func (a *Admin) StartFailover(addr string) error + 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) (ClientInterface, error) + func (cnx *AdminConnections) GetAll() map[string]ClientInterface + func (cnx *AdminConnections) GetDifferentFrom(addr string) (ClientInterface, error) + func (cnx *AdminConnections) GetRandom() (ClientInterface, error) + func (cnx *AdminConnections) GetSelected(addrs []string) map[string]ClientInterface + 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) (ClientInterface, error) + func (cnx *AdminConnections) ValidatePipeResp(client ClientInterface, addr, errMessage string) bool + func (cnx *AdminConnections) ValidateResp(resp *redis.Resp, addr, errMessage string) error + type AdminConnectionsInterface interface + Add func(addr string) error + AddAll func(addrs []string) + Get func(addr string) (ClientInterface, error) + GetAll func() map[string]ClientInterface + GetDifferentFrom func(addr string) (ClientInterface, error) + GetRandom func() (ClientInterface, error) + GetSelected func(addrs []string) map[string]ClientInterface + Reconnect func(addr string) error + Remove func(addr string) + ReplaceAll func(addrs []string) + Reset func() + ValidatePipeResp func(c ClientInterface, addr, errMessage string) bool + ValidateResp func(resp *redis.Resp, addr, errMessage string) error + func NewAdminConnections(addrs []string, options *AdminOptions) AdminConnectionsInterface + type AdminInterface interface + AddSlots func(addr string, slots []Slot) error + AttachNodeToCluster func(addr string) error + AttachSlaveToMaster func(slave *Node, master *Node) error + Close func() + Connections func() AdminConnectionsInterface + CountKeysInSlot func(addr string, slot Slot) (int64, error) + DelSlots func(addr string, slots []Slot) error + DetachSlave func(slave *Node) error + FlushAll func() + FlushAndReset func(addr string, mode string) error + ForgetNode func(id string) error + ForgetNodeByAddr func(id string) error + GetClusterInfos func() (*ClusterInfos, error) + GetClusterInfosSelected func(addrs []string) (*ClusterInfos, error) + GetHashMaxSlot func() Slot + GetKeysInSlot func(addr string, slot Slot, batch int, limit bool) ([]string, error) + InitRedisCluster func(addr string) error + MigrateKeys func(addr string, dest *Node, slots []Slot, batch, timeout int, replace bool) (int, error) + RebuildConnectionMap func(addrs []string, options *AdminOptions) + SetSlots func(addr string, action string, slots []Slot, nodeID string) error + StartFailover func(addr string) error + func NewAdmin(addrs []string, options *AdminOptions) AdminInterface + type AdminOptions struct + ClientName string + ConnectionTimeout time.Duration + RenameCommandsFile 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 + func (c *Client) ReadResp() *redis.Resp + type ClientInterface 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 + ReadResp func() *redis.Resp + func NewClient(addr string, cnxTimeout time.Duration, commandsMapping map[string]string) (ClientInterface, error) + type Cluster struct + ActionsInfo ClusterActionsInfo + Name string + Namespace string + Nodes map[string]*Node + NodesPlacement v1.NodesPlacementInfo + Status v1.ClusterStatus + func NewCluster(name, namespace string) *Cluster + func (c *Cluster) AddNode(node *Node) + func (c *Cluster) GetNodeByFunc(f FindNodeFunc) (*Node, error) + func (c *Cluster) GetNodeByID(id string) (*Node, error) + func (c *Cluster) GetNodeByIP(ip string) (*Node, error) + func (c *Cluster) GetNodeByPodName(name string) (*Node, error) + func (c *Cluster) GetNodesByFunc(f FindNodeFunc) (Nodes, error) + func (c *Cluster) ToAPIClusterStatus() v1.RedisClusterClusterStatus + type ClusterActionsInfo struct + NbslotsToMigrate int32 + type ClusterInconsistencies map[Slot]OwneshipView + func (ci ClusterInconsistencies) String() string + type ClusterInfos struct + Infos map[string]*NodeInfos + Status string + func NewClusterInfos() *ClusterInfos + func (c *ClusterInfos) ComputeStatus() bool + func (c *ClusterInfos) GetInconsistencies() *ClusterInconsistencies + func (c *ClusterInfos) GetNodes() Nodes + type ClusterInfosError struct + func NewClusterInfosError() ClusterInfosError + func (e ClusterInfosError) Error() string + func (e ClusterInfosError) Inconsistent() bool + func (e ClusterInfosError) Partial() bool + type ConfigSignature map[string]SlotSlice + func (c ConfigSignature) String() string + 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 Manager struct + func NewManager(admin *Admin) *Manager + func (m *Manager) BuildClusterStatus() (*v1.RedisClusterClusterStatus, error) + 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 *kapiv1.Pod + PongRecv int64 + Port string + Role string + ServerStartTime time.Time + Slots []Slot + func NewDefaultNode() *Node + func NewNode(id, ip string, pod *kapiv1.Pod) *Node + func (n *Node) Clear() + func (n *Node) GetRole() v1.RedisClusterNodeRole + func (n *Node) HasStatus(flag string) bool + func (n *Node) IPPort() string + func (n *Node) SetFailureStatus(flags string) + func (n *Node) SetLinkStatus(status string) error + func (n *Node) SetReferentMaster(ref string) + func (n *Node) SetRole(flags string) error + func (n *Node) String() string + func (n *Node) ToAPINode() v1.RedisClusterNode + func (n *Node) TotalSlots() int + type NodeInfos struct + Friends Nodes + Node *Node + func DecodeNodeInfos(input *string, addr string) *NodeInfos + func NewNodeInfos() *NodeInfos + type Nodes []*Node + func (n Nodes) CountByFunc(fn func(*Node) bool) (result int) + func (n Nodes) FilterByFunc(fn func(*Node) bool) Nodes + func (n Nodes) GetNodeByID(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 OwnerWithStatus struct + Addr string + Status string + type OwneshipView map[OwnerWithStatus][]string + 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)