zk

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

zk provides with higher level commands over the lower level zookeeper connector

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZooKeeper

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

func NewZooKeeper

func NewZooKeeper() *ZooKeeper

func (*ZooKeeper) BuildACL

func (zook *ZooKeeper) BuildACL(authScheme string, user string, pwd string, acls string) (perms []zk.ACL, err error)

Returns acls

func (*ZooKeeper) Children

func (zook *ZooKeeper) Children(path string) ([]string, error)

Children returns sub-paths of given path, optionally empty array, or error if path does not exist

func (*ZooKeeper) ChildrenRecursive

func (zook *ZooKeeper) ChildrenRecursive(path string) ([]string, error)

ChildrenRecursive returns list of all descendants of given path (optionally empty), or error if the path does not exist. Every element in result list is a relative subpath for the given path.

func (*ZooKeeper) Create

func (zook *ZooKeeper) Create(path string, data []byte, aclstr string, force bool) (string, error)

Create will create a new path, or exit with error should the path exist. The "force" param controls the behavior when path's parent directory does not exist. When "force" is false, the function returns with error/ When "force" is true, it recursively attempts to create required parent directories.

func (*ZooKeeper) CreateWithACL

func (zook *ZooKeeper) CreateWithACL(path string, data []byte, force bool, perms []zk.ACL) (string, error)

func (*ZooKeeper) Delete

func (zook *ZooKeeper) Delete(path string) error

Delete removes a path entry. It exits with error if the path does not exist, or has subdirectories.

func (*ZooKeeper) DeleteRecursive

func (zook *ZooKeeper) DeleteRecursive(path string) error

Delete recursive if has subdirectories.

func (*ZooKeeper) Exists

func (zook *ZooKeeper) Exists(path string) (bool, error)

Exists returns true when the given path exists

func (*ZooKeeper) Get

func (zook *ZooKeeper) Get(path string) ([]byte, error)

Get returns value associated with given path, or error if path does not exist

func (*ZooKeeper) GetACL

func (zook *ZooKeeper) GetACL(path string) (data []string, err error)

func (*ZooKeeper) Set

func (zook *ZooKeeper) Set(path string, data []byte) (*zk.Stat, error)

Set updates a value for a given path, or returns with error if the path does not exist

func (*ZooKeeper) SetACL

func (zook *ZooKeeper) SetACL(path string, aclstr string, force bool) (string, error)

updates the ACL on a given path

func (*ZooKeeper) SetAuth

func (zook *ZooKeeper) SetAuth(scheme string, auth []byte)

func (*ZooKeeper) SetServers

func (zook *ZooKeeper) SetServers(serversArray []string)

SetServers sets the list of servers for the zookeeper client to connect to. Each element in the array should be in either of following forms: - "servername" - "servername:port"

Jump to

Keyboard shortcuts

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