zook

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 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

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

Driver defines zookeeper driver for Albus

func (*Driver) Children

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

Children returns the children of the path

func (*Driver) Close

func (d *Driver) Close() error

Close shuts down connection for the driver

func (*Driver) Delete

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

Delete deletes the node and all its children

func (*Driver) IsConnected

func (d *Driver) IsConnected() bool

func (*Driver) Open

func (d *Driver) Open() error

Open initializes the driver

func (*Driver) Read

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

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

func (*Driver) State

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

func (*Driver) Watch

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

Watch watches for changes on node

func (*Driver) WatchChildren

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

func (*Driver) Write

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

Write writes the content to the path

type DriverOption

type DriverOption func(*Driver)

func WithACL

func WithACL(acl []zk.ACL) DriverOption

func WithRootDirectory

func WithRootDirectory(root string) DriverOption

func WithTimeout

func WithTimeout(timeout time.Duration) DriverOption

Jump to

Keyboard shortcuts

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