zk

package
v0.0.0-...-d60fe65 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 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 it does not Exist.

func CreateIfNotExistsOrDie

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

CreateIfNotExistsOrDie creates ZNode if it does not Exist or dies.

func SafeCreate

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

SafeCreate creates ZNode.

func SafeCreateOrDie

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

SafeCreateOrDie creates ZNode 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.

func SafeDeleteOrDie

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

SafeDeleteOrDie deletes ZNode or does dies.

func SafeGet

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

SafeGet gets ZNode.

func SafeGetChildren

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

SafeGetChildren lists all children attched to the ZNode.

func SafeSet

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

SafeSet sets ZNode.

func SafeSetOrDie

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

SafeSetOrDie sets ZNode or dies.

func ValidateZNodeName

func ValidateZNodeName(n string) bool

ValidateZNodeName validates ZNode's name.

  1. must be between 3 and 63 characters in length.
  2. can include dot (.), hyphen (-) and lowercase letters and numbers ([a-z0-9]).
  3. can start with an alphanumeric character or a hyphen (-).
  4. can not start with a dot (.).
  5. can not contain a double dot (..).
  6. can not end with a dot (.).
  7. must not be formatted as IPv4 address.

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 (n *Notifier) Signal(data []byte) error

func (*Notifier) Watcher

func (n *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