Versions in this module Expand all Collapse all v0 v0.2.4 May 22, 2020 Changes in this version type Admin + func (a *Admin) ResetPassword(newPassword string) error type IAdmin + ResetPassword func(newPassword string) error v0.2.3 Apr 2, 2020 v0.2.2 Mar 26, 2020 v0.2.1 Mar 9, 2020 Changes in this version type Admin + func (a *Admin) GetAllConfig(c IClient, addr string) (map[string]string, error) type AdminConnections + func (cnx *AdminConnections) GetAUTH() (string, bool) type IAdmin + GetAllConfig func(c IClient, addr string) (map[string]string, error) type IAdminConnections + GetAUTH func() (string, bool) v0.2.0 Dec 18, 2019 Changes in this version type Node + StatefulSet string v0.1.0 Dec 2, 2019 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 RedisSlaveRole + 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, masterID string) error + func (a *Admin) Close() + func (a *Admin) ClusterManagerNodeIsEmpty() (bool, error) + func (a *Admin) Connections() IAdminConnections + func (a *Admin) DetachSlave(slave *Node) error + func (a *Admin) FlushAndReset(addr string, mode string) error + func (a *Admin) ForgetNode(id string) error + func (a *Admin) GetClusterInfos() (*ClusterInfos, error) + func (a *Admin) GetHashMaxSlot() Slot + func (a *Admin) MigrateKeys(addr string, dest *Node, slots []Slot, batch int, timeout int, replace bool) (int, error) + func (a *Admin) MigrateKeysInSlot(addr string, dest *Node, slot Slot, batch int, timeout int, replace bool) (int, error) + func (a *Admin) SetConfigEpoch() error + func (a *Admin) SetConfigIfNeed(newConfig map[string]string) error + func (a *Admin) SetSlot(addr, action string, slot Slot, nodeID string) error + func (a *Admin) SetSlots(addr, action string, slots []Slot, nodeID 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) (IClient, error) + 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 + 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 Cluster struct + ActionsInfo ClusterActionsInfo + Name string + Namespace string + Nodes map[string]*Node + NodesPlacement redisv1alpha1.NodesPlacementInfo + Status redisv1alpha1.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) + type ClusterActionsInfo struct + NbslotsToMigrate int32 + type ClusterInfos struct + Infos map[string]*NodeInfos + Status string + func NewClusterInfos() *ClusterInfos + func (c *ClusterInfos) ComputeStatus() bool + 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 IAdmin interface + AddSlots func(addr string, slots []Slot) error + AttachNodeToCluster func(addr string) error + AttachSlaveToMaster func(slave *Node, masterID string) error + Close func() + ClusterManagerNodeIsEmpty func() (bool, error) + Connections func() IAdminConnections + DetachSlave func(slave *Node) error + FlushAndReset func(addr string, mode string) error + ForgetNode func(id string) error + GetClusterInfos func() (*ClusterInfos, error) + GetHashMaxSlot func() Slot + MigrateKeys func(addr string, dest *Node, slots []Slot, batch, timeout int, replace bool) (int, error) + MigrateKeysInSlot func(addr string, dest *Node, slot Slot, batch int, timeout int, replace bool) (int, error) + SetConfigEpoch func() error + SetConfigIfNeed func(newConfig map[string]string) error + SetSlot func(addr, action string, slot Slot, nodeID string) error + SetSlots func(addr string, action string, slots []Slot, nodeID string) error + func NewAdmin(addrs []string, options *AdminOptions) IAdmin + type IAdminConnections interface + Add func(addr string) error + AddAll func(addrs []string) + Get func(addr string) (IClient, error) + 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) 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 + ReadResp func() *redis.Resp + func NewClient(addr, password string, cnxTimeout time.Duration, ...) (IClient, error) + 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 + NodeName string + PingSent int64 + PodName string + 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) Balance() int + func (n *Node) Clear() + func (n *Node) GetRole() redisv1alpha1.RedisRole + func (n *Node) HasStatus(flag string) bool + func (n *Node) IPPort() string + func (n *Node) SetBalance(balance int) + 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() redisv1alpha1.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 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)