zookeeper

package
v0.0.0-...-d6a9545 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ephemeral = zk.FlagEphemeral
)

Variables

This section is empty.

Functions

func IsExistError

func IsExistError(err error) bool

func IsNoNode

func IsNoNode(err error) bool

Types

type Conn

type Conn struct {
	*zk.Conn
}

func NewConnect

func NewConnect(addrs []string) (*Conn, error)

create a new zookeeper connection by given addrs

func (*Conn) Create

func (c *Conn) Create(path string, data string, flags int32) error

Create a node by path with data.

func (*Conn) CreateOrUpdate

func (c *Conn) CreateOrUpdate(path string, data string, flags int32) error

Update data of give path, if not exist create one

func (*Conn) CreateRecursive

func (c *Conn) CreateRecursive(zkPath string, data string, flags int32) error

recursive create a node

func (*Conn) CreateRecursiveIgnoreExist

func (c *Conn) CreateRecursiveIgnoreExist(path string, data string, flags int32) (err error)

recursive create a node, if it exists then omit

func (*Conn) Delete

func (c *Conn) Delete(path string) error

Delete a node by path.

func (*Conn) DeleteRecursive

func (c *Conn) DeleteRecursive(zkPath string) error

递归删除

func (*Conn) HasChildren

func (c *Conn) HasChildren(path string) (bool, error)

test given path whether has sub-node

func (*Conn) NewMutex

func (c *Conn) NewMutex(path string) *Mutex

func (*Conn) Set

func (c *Conn) Set(path string, data string) error

set data to given path

type Mutex

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

func (*Mutex) Lock

func (mu *Mutex) Lock() error

func (*Mutex) Unlock

func (mu *Mutex) Unlock() error

Jump to

Keyboard shortcuts

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