Documentation ¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) AddNode(node Node) error
- func (c *Cluster) Destroy() error
- func (c *Cluster) Distribute(id int64) Node
- func (c *Cluster) HasNode(name string) bool
- func (c *Cluster) Nodes() Nodes
- func (c *Cluster) NodesChan() <-chan Nodes
- func (c *Cluster) RemoveNode(nodeName string) error
- func (c *Cluster) UpdateNode(node Node) error
- type Node
- type Nodes
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ZeroNode = Node{}
)
global variables
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster 代表一个集群
func (*Cluster) Distribute ¶
Distribute 将一个任务 id 分配给其中一个 Node 节点,并返回这个 Node
func (*Cluster) RemoveNode ¶
RemoveNode 从集群中删除一个节点
type Nodes ¶
type Nodes []Node
Nodes 代表集群的所有节点
func (Nodes) Distribute ¶
Distribute 将一个任务 id 分配给其中一个 Node 节点,并返回这个 Node
Click to show internal directories.
Click to hide internal directories.