zkcli

package
v0.0.0-...-fb670e6 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIfNotExists

func CreateIfNotExists(conn *zk.Conn, path string) error

CreateIfNotExists creates ZNode if not exist.

func CreateIfNotExistsOrDie

func CreateIfNotExistsOrDie(conn *zk.Conn, path string)

CreateIfNotExistsOrDie creates ZNode if not exist or dies.

func SafeCreate

func SafeCreate(conn *zk.Conn, path string, data []byte, flags int32) (string, error)

SafeCreate creates ZNode safely.

func SafeCreateOrDie

func SafeCreateOrDie(conn *zk.Conn, path string, data []byte, flags int32) (string, error)

SafeCreateOrDie creates ZNode safely or dies.

func SafeCreateOrSet

func SafeCreateOrSet(conn *zk.Conn, path string, data []byte, flags int32) (string, error)

SafeCreateOrSet creates ZNode or sets ZNode.

func SafeDelete

func SafeDelete(conn *zk.Conn, path string, version int32) error

SafeDelete deletes ZNode safely.

func SafeDeleteOrDie

func SafeDeleteOrDie(conn *zk.Conn, path string, version int32) error

SafeDeleteOrDie deletes ZNode safely or does dies.

func SafeGet

func SafeGet(conn *zk.Conn, path string) ([]byte, *zk.Stat, error)

SafeGet gets ZNode safely.

func SafeGetChildren

func SafeGetChildren(conn *zk.Conn, path string, watch bool) ([]string, <-chan zk.Event, error)

SafeGetChildren lists all children attched to the parent ZNode.

func SafeSet

func SafeSet(conn *zk.Conn, path string, data []byte, version int32) (*zk.Stat, error)

SafeSet sets ZNode safely.

func SafeSetOrDie

func SafeSetOrDie(conn *zk.Conn, path string, data []byte, version int32) (*zk.Stat, error)

SafeSetOrDie sets ZNode safely or dies.

func ValidateZNode

func ValidateZNode(znode string) bool

ValidateZNode validates ZNode.

Types

type Notifier

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

func NewNotifier

func NewNotifier(conn *zk.Conn, path string, create bool) (*Notifier, error)

func (*Notifier) Signal

func (nf *Notifier) Signal(data []byte) error

func (*Notifier) Watcher

func (nf *Notifier) Watcher() ([]byte, <-chan zk.Event, error)

Jump to

Keyboard shortcuts

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