zkcli

package
v0.0.0-...-adb0196 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIfNotExist

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

CreateIfNotExist creates znode if not exist.

func CreateIfNotExistOrDie

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

CreateIfNotExistOrDie creates znode if not exist or die.

func SafeCreate

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

SafeCreate creates znode safely.

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 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 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