zookeeper

package
v0.0.0-...-92ef796 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IZkClient

type IZkClient interface {
	Close()
	Register(node *ZkNode, srvType string) (string, error)
	GetNodes(srvType string) ([]*ZkNode, error)
	WatchChildrenOnce(srvType string, callback WatchCallback) error
}

type WatchCallback

type WatchCallback func(node *ZkNode, event zk.Event)

type ZkClient

type ZkClient struct {
	// contains filtered or unexported fields
}

func NewZkClient

func NewZkClient(servers []string, root string, timeout int64) (*ZkClient, error)

func (*ZkClient) Close

func (z *ZkClient) Close()

func (*ZkClient) GetNodes

func (z *ZkClient) GetNodes(srvType string) ([]*ZkNode, error)

func (*ZkClient) Register

func (z *ZkClient) Register(node *ZkNode, srvType string) (string, error)

func (*ZkClient) WatchChildrenOnce

func (z *ZkClient) WatchChildrenOnce(srvType string, callback WatchCallback) error

type ZkNode

type ZkNode struct {
	Host string `json:"host"`
	Port int32  `json:"port"`
	Path string `json:"-"`
}

Jump to

Keyboard shortcuts

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