zook

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewZKDriver

func NewZKDriver(servers []string, options ...DriverOption) driver.Driver

NewZKDriver returns new zookeeper driver

Types

type Driver added in v1.1.0

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

Driver defines zookeeper driver for Albus

func (*Driver) Children added in v1.1.0

func (d *Driver) Children(path string) ([]string, error)

Children returns the children of the path

func (*Driver) Close added in v1.1.0

func (d *Driver) Close() error

Close shuts down connection for the driver

func (*Driver) Delete added in v1.1.0

func (d *Driver) Delete(path string) error

Delete deletes the node and all its children

func (*Driver) IsConnected added in v1.1.0

func (d *Driver) IsConnected() bool

func (*Driver) Open added in v1.1.0

func (d *Driver) Open() error

Open initializes the driver

func (*Driver) Read added in v1.1.0

func (d *Driver) Read(path string) ([]byte, error)

Read reads the content from the path and returns the value in bytes

func (*Driver) State added in v1.1.0

func (d *Driver) State() zk.State

func (*Driver) Watch added in v1.1.0

func (d *Driver) Watch(path string) ([]byte, <-chan *driver.Event, error)

Watch watches for changes on node

func (*Driver) WatchChildren added in v1.1.0

func (d *Driver) WatchChildren(path string) ([]string, <-chan *driver.Event, error)

func (*Driver) Write added in v1.1.0

func (d *Driver) Write(path string, data []byte) error

Write writes the content to the path

type DriverOption added in v1.1.0

type DriverOption func(*Driver)

func WithACL added in v1.1.0

func WithACL(acl []zk.ACL) DriverOption

func WithRootDirectory added in v1.1.0

func WithRootDirectory(root string) DriverOption

func WithTimeout added in v1.1.0

func WithTimeout(timeout time.Duration) DriverOption

Jump to

Keyboard shortcuts

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