cluster

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NodeNoExist = errors.New("node no exist")
)

Functions

This section is empty.

Types

type Node

type Node struct {
	NNA  string // 节点名称
	Addr string // 节点addr
}

type NodeDiscover

type NodeDiscover interface {
	GetNodes() ([]Node, error)
	GetNodeMap() map[string]Node
	GetNode(name string) (Node, error)
	RegisterMe(node Node) error
	RemoveNode(name string) error
}

NodeDiscover 集群节点发现

func NewStaticNodeDiscover

func NewStaticNodeDiscover(nodes map[string]Node) NodeDiscover

type ShareTopicMapNode

type ShareTopicMapNode interface {
	GetShareNames(topic []byte) (map[string]string, error)
	AddTopicMapNode(topic []byte, shareName, nodeName string) error
	RemoveTopicMapNode(topic []byte, shareName, nodeName string) error
}

func NewShareMap

func NewShareMap() ShareTopicMapNode

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL