Documentation ¶
Index ¶
- Constants
- type ClusterNode
- func (cn *ClusterNode) AddSlots(start, end int)
- func (cn *ClusterNode) Addr() string
- func (cn *ClusterNode) Call(cmd string, args ...interface{}) (interface{}, error)
- func (cn *ClusterNode) ClusterAddNode(addr string) (ret string, err error)
- func (cn *ClusterNode) ClusterAddSlots(args ...interface{}) (ret string, err error)
- func (cn *ClusterNode) ClusterCountKeysInSlot(slot int) (int, error)
- func (cn *ClusterNode) ClusterDelSlots(args ...interface{}) (ret string, err error)
- func (cn *ClusterNode) ClusterForgetNodeID(nodeid string) (ret string, err error)
- func (cn *ClusterNode) ClusterGetKeysInSlot(slot int, pipeline int) (string, error)
- func (cn *ClusterNode) ClusterReplicateWithNodeID(nodeid string) (ret string, err error)
- func (cn *ClusterNode) ClusterSetSlot(slot int, cmd string) (string, error)
- func (cn *ClusterNode) FlushNodeConfig()
- func (cn *ClusterNode) GetConfigSignature() string
- func (cn *ClusterNode) HasFlag(flag string) bool
- func (cn *ClusterNode) LoadInfo() error
- type Node
Constants ¶
View Source
const ( // UnusedHashSlot unused slot flag UnusedHashSlot = iota // NewHashSlot new solt flag NewHashSlot // AssignedHashSlot assigned slot flag AssignedHashSlot )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterNode ¶
type ClusterNode struct { Info *Node Dirty bool Friends [](*Node) ReplicasNodes [](*ClusterNode) // contains filtered or unexported fields }
ClusterNode redis cluster node
func NewClusterNode ¶
func NewClusterNode(addr string) (*ClusterNode, error)
NewClusterNode return a new cluster node
func (*ClusterNode) AddSlots ¶
func (cn *ClusterNode) AddSlots(start, end int)
AddSlots add slot to cluster node
func (*ClusterNode) Call ¶
func (cn *ClusterNode) Call(cmd string, args ...interface{}) (interface{}, error)
Call call client do somethings
func (*ClusterNode) ClusterAddNode ¶
func (cn *ClusterNode) ClusterAddNode(addr string) (ret string, err error)
ClusterAddNode add node to cluster
func (*ClusterNode) ClusterAddSlots ¶
func (cn *ClusterNode) ClusterAddSlots(args ...interface{}) (ret string, err error)
ClusterAddSlots add slot to cluster node
func (*ClusterNode) ClusterCountKeysInSlot ¶
func (cn *ClusterNode) ClusterCountKeysInSlot(slot int) (int, error)
ClusterCountKeysInSlot clount key in slot
func (*ClusterNode) ClusterDelSlots ¶
func (cn *ClusterNode) ClusterDelSlots(args ...interface{}) (ret string, err error)
ClusterDelSlots delete slot from cluster node
func (*ClusterNode) ClusterForgetNodeID ¶
func (cn *ClusterNode) ClusterForgetNodeID(nodeid string) (ret string, err error)
ClusterForgetNodeID remove a node from cluster
func (*ClusterNode) ClusterGetKeysInSlot ¶
func (cn *ClusterNode) ClusterGetKeysInSlot(slot int, pipeline int) (string, error)
ClusterGetKeysInSlot get key form slot
func (*ClusterNode) ClusterReplicateWithNodeID ¶
func (cn *ClusterNode) ClusterReplicateWithNodeID(nodeid string) (ret string, err error)
ClusterReplicateWithNodeID add replica node
func (*ClusterNode) ClusterSetSlot ¶
func (cn *ClusterNode) ClusterSetSlot(slot int, cmd string) (string, error)
ClusterSetSlot set cluster slot
func (*ClusterNode) FlushNodeConfig ¶
func (cn *ClusterNode) FlushNodeConfig()
FlushNodeConfig flush node config
func (*ClusterNode) GetConfigSignature ¶
func (cn *ClusterNode) GetConfigSignature() string
GetConfigSignature get cluster node config signature
func (*ClusterNode) LoadInfo ¶
func (cn *ClusterNode) LoadInfo() error
LoadInfo get cluster info from current node
Click to show internal directories.
Click to hide internal directories.