Documentation ¶
Index ¶
- func AllocateNewNode(dID int) (int, error)
- func Balance() (int, error)
- func FindNodeIDRedis(dID int) (int, error)
- func FindNodeInfoRedis(nodeID int) (node *db.Node)
- func FindNodeNow(dID int) (node *db.Node)
- func FindNowNodeIDMysql(dID int) (int, error)
- func InsertDNodeMysql(dID int, device *db.Device) error
- func InsertDNodeRedis(dID int, nodeID int) error
- type NodeWithTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindNodeInfoRedis ¶
在redis中查找nodeID对应的node信息
func InsertDNodeMysql ¶
将dID与nodeID的映射写入mysql
func InsertDNodeRedis ¶
将dID与nodeID的映射写入Redis,传入dID和nodeID
Types ¶
type NodeWithTime ¶
func FindNodeIDMysql ¶
func FindNodeIDMysql(dID int) (nodes []NodeWithTime)
在MySQL中 通过dID寻找对应的node信息及开始保存在此node的时间戳
nodes信息为之前绑定的节点,返回整个列表
Click to show internal directories.
Click to hide internal directories.