zookeeper

package
v1.4.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConnDelay connection delay interval
	ConnDelay = 3
	// MaxFailTimes max fail times
	MaxFailTimes = 15
)

Variables

This section is empty.

Functions

func HandleClientRestart

func HandleClientRestart(r zkClientFacade)

HandleClientRestart ...

func StateToString

func StateToString(state zk.State) string

StateToString ...

func ValidateZookeeperClient

func ValidateZookeeperClient(container zkClientFacade, opts ...Option) error

ValidateZookeeperClient ...

Types

type Option

type Option func(*Options)

Option ...

func WithTestCluster

func WithTestCluster(ts *zk.TestCluster) Option

WithTestCluster ...

func WithZkName

func WithZkName(name string) Option

WithZkName ...

type Options

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

Options ...

type ZkEventListener

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

ZkEventListener ...

func NewZkEventListener

func NewZkEventListener(client *ZookeeperClient) *ZkEventListener

NewZkEventListener ...

func (*ZkEventListener) Close

func (l *ZkEventListener) Close()

Close ...

func (*ZkEventListener) ListenServiceEvent

func (l *ZkEventListener) ListenServiceEvent(zkPath string, listener remoting.DataListener)

ListenServiceEvent is invoked by ZkConsumerRegistry::Register/ZkConsumerRegistry::get/ZkConsumerRegistry::getListener registry.go:Listen -> listenServiceEvent -> listenDirEvent -> ListenServiceNodeEvent

|
--------> ListenServiceNodeEvent

func (*ZkEventListener) ListenServiceNodeEvent

func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener ...remoting.DataListener) bool

ListenServiceNodeEvent ...

func (*ZkEventListener) SetClient

func (l *ZkEventListener) SetClient(client *ZookeeperClient)

SetClient ...

type ZookeeperClient

type ZookeeperClient struct {
	ZkAddrs    []string
	sync.Mutex // for conn
	Conn       *zk.Conn
	Timeout    time.Duration

	Wait sync.WaitGroup
	// contains filtered or unexported fields
}

ZookeeperClient ...

func NewMockZookeeperClient

func NewMockZookeeperClient(name string, timeout time.Duration, opts ...Option) (*zk.TestCluster, *ZookeeperClient, <-chan zk.Event, error)

NewMockZookeeperClient ...

func (*ZookeeperClient) Close

func (z *ZookeeperClient) Close()

Close ...

func (*ZookeeperClient) Create

func (z *ZookeeperClient) Create(basePath string) error

Create ...

func (*ZookeeperClient) Delete

func (z *ZookeeperClient) Delete(basePath string) error

Delete ...

func (*ZookeeperClient) Done

func (z *ZookeeperClient) Done() <-chan struct{}

Done ...

func (*ZookeeperClient) ExistW

func (z *ZookeeperClient) ExistW(zkPath string) (<-chan zk.Event, error)

ExistW ...

func (*ZookeeperClient) GetChildren

func (z *ZookeeperClient) GetChildren(path string) ([]string, error)

GetChildren ...

func (*ZookeeperClient) GetChildrenW

func (z *ZookeeperClient) GetChildrenW(path string) ([]string, <-chan zk.Event, error)

GetChildrenW ...

func (*ZookeeperClient) GetContent

func (z *ZookeeperClient) GetContent(zkPath string) ([]byte, *zk.Stat, error)

GetContent ...

func (*ZookeeperClient) HandleZkEvent

func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event)

HandleZkEvent ...

func (*ZookeeperClient) RegisterEvent

func (z *ZookeeperClient) RegisterEvent(zkPath string, event *chan struct{})

RegisterEvent ...

func (*ZookeeperClient) RegisterTemp

func (z *ZookeeperClient) RegisterTemp(basePath string, node string) (string, error)

RegisterTemp ...

func (*ZookeeperClient) RegisterTempSeq

func (z *ZookeeperClient) RegisterTempSeq(basePath string, data []byte) (string, error)

RegisterTempSeq ...

func (*ZookeeperClient) UnregisterEvent

func (z *ZookeeperClient) UnregisterEvent(zkPath string, event *chan struct{})

UnregisterEvent ...

func (*ZookeeperClient) ZkConnValid

func (z *ZookeeperClient) ZkConnValid() bool

ZkConnValid ...

Jump to

Keyboard shortcuts

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