Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyNode ¶
type DummyNode struct {
Id string
}
DummyNode is dummy, it has an ID field which will be using as primary key
func (*DummyNode) OwnsPayload ¶
func (*DummyNode) PrimaryKey ¶
type NodeRegister ¶
type NodeRegister struct { ZkServerAddresses string StateChan chan ServiceState // contains filtered or unexported fields }
NodeRegister is the low-level register for any type of nodes
func NewNodeRegister ¶
func NewNodeRegister(zkServerAddresses string, baseKey string, node Node) *NodeRegister
func (*NodeRegister) DoRegister ¶
func (r *NodeRegister) DoRegister() error
DoRegister register current node info to ZK Servers
func (*NodeRegister) EnsureConn ¶
func (r *NodeRegister) EnsureConn() error
EnsureConn connects to zookeeper server if needed
func (*NodeRegister) GetRegisterKey ¶
func (r *NodeRegister) GetRegisterKey() string
GetRegisterkey accepts a node and returns the key of zookeeper
func (*NodeRegister) SendEmptyEvent ¶
func (r *NodeRegister) SendEmptyEvent()
func (*NodeRegister) StartDiscover ¶
func (r *NodeRegister) StartDiscover(timeoutSeconds int) error
StartDiscover watch for new events on current cluster node, will retry on connection errors
func (*NodeRegister) Stop ¶
func (r *NodeRegister) Stop() error
type ServiceState ¶
ServiceState is event for StartDiscover
Click to show internal directories.
Click to hide internal directories.