Versions in this module Expand all Collapse all v0 v0.1.2 Apr 17, 2015 v0.1.1 Apr 9, 2015 Changes in this version + const DefaultLeaderElectionPort + const DefaultPeerPort + const DefaultPort + const DefaultServerAutoPurgeSnapRetainCount + const DefaultServerInitLimit + const DefaultServerSyncLimit + const DefaultServerTickTime + const EventNodeChildrenChanged + const EventNodeCreated + const EventNodeDataChanged + const EventNodeDeleted + const EventNotWatching + const EventSession + const FlagEphemeral + const FlagSequence + const PermAdmin + const PermAll + const PermCreate + const PermDelete + const PermRead + const PermWrite + const StateAuthFailed + const StateConnected + const StateConnectedReadOnly + const StateConnecting + const StateDisconnected + const StateExpired + const StateHasSession + const StateSaslAuthenticated + const StateSyncConnected + const StateUnknown + var ErrAPIError = errors.New("zk: api error") + var ErrAuthFailed = errors.New("zk: client authentication failed") + var ErrBadVersion = errors.New("zk: version conflict") + var ErrClosing = errors.New("zk: zookeeper is closing") + var ErrConnectionClosed = errors.New("zk: connection closed") + var ErrDeadlock = errors.New("zk: trying to acquire a lock twice") + var ErrInvalidACL = errors.New("zk: invalid ACL specified") + var ErrNoAuth = errors.New("zk: not authenticated") + var ErrNoChildrenForEphemerals = errors.New("zk: ephemeral nodes may not have children") + var ErrNoNode = errors.New("zk: node does not exist") + var ErrNoServer = errors.New("zk: could not connect to a server") + var ErrNodeExists = errors.New("zk: node already exists") + var ErrNotEmpty = errors.New("zk: node has children") + var ErrNotLocked = errors.New("zk: not locked") + var ErrNothing = errors.New("zk: no server responsees to process") + var ErrPtrExpected = errors.New("zk: encode/decode expect a non-nil pointer to struct") + var ErrSessionExpired = errors.New("zk: session has been expired by the server") + var ErrSessionMoved = errors.New("zk: session moved to another server, so operation is ignored") + var ErrShortBuffer = errors.New("zk: buffer too small") + var ErrUnhandledFieldType = errors.New("zk: unhandled field type") + var ErrUnknown = errors.New("zk: unknown error") + func StartTracer(listenAddr, serverAddr string) + type ACL struct + ID string + Perms int32 + Scheme string + func AuthACL(perms int32) []ACL + func DigestACL(perms int32, user, password string) []ACL + func WorldACL(perms int32) []ACL + type CheckVersionRequest PathVersionRequest + type Conn struct + func Connect(servers []string, sessionTimeout time.Duration) (*Conn, <-chan Event, error) + func ConnectWithDialer(servers []string, sessionTimeout time.Duration, dialer Dialer) (*Conn, <-chan Event, error) + func (c *Conn) AddAuth(scheme string, auth []byte) error + func (c *Conn) Children(path string) ([]string, *Stat, error) + func (c *Conn) ChildrenW(path string) ([]string, *Stat, <-chan Event, error) + func (c *Conn) Close() + func (c *Conn) Create(path string, data []byte, flags int32, acl []ACL) (string, error) + func (c *Conn) CreateProtectedEphemeralSequential(path string, data []byte, acl []ACL) (string, error) + func (c *Conn) Delete(path string, version int32) error + func (c *Conn) Exists(path string) (bool, *Stat, error) + func (c *Conn) ExistsW(path string) (bool, *Stat, <-chan Event, error) + func (c *Conn) Get(path string) ([]byte, *Stat, error) + func (c *Conn) GetACL(path string) ([]ACL, *Stat, error) + func (c *Conn) GetW(path string) ([]byte, *Stat, <-chan Event, error) + func (c *Conn) Multi(ops ...interface{}) ([]MultiResponse, error) + func (c *Conn) Set(path string, data []byte, version int32) (*Stat, error) + func (c *Conn) SetACL(path string, acl []ACL, version int32) (*Stat, error) + func (c *Conn) State() State + func (c *Conn) Sync(path string) (string, error) + type CreateRequest struct + Acl []ACL + Data []byte + Flags int32 + Path string + type DeleteRequest PathVersionRequest + type Dialer func(network, address string, timeout time.Duration) (net.Conn, error) + type ErrCode int32 + type ErrMissingServerConfigField string + func (e ErrMissingServerConfigField) Error() string + type Event struct + Err error + Path string + State State + Type EventType + type EventType int32 + func (t EventType) String() string + type Lock struct + func NewLock(c *Conn, path string, acl []ACL) *Lock + func (l *Lock) Lock() error + func (l *Lock) Unlock() error + type MultiResponse struct + Stat *Stat + String string + type PathVersionRequest struct + Path string + Version int32 + type Server struct + ConfigPath string + JarPath string + Stderr io.Writer + Stdout io.Writer + func (srv *Server) Start() error + func (srv *Server) Stop() error + type ServerConfig struct + AutoPurgePurgeInterval int + AutoPurgeSnapRetainCount int + ClientPort int + DataDir string + InitLimit int + Servers []ServerConfigServer + SyncLimit int + TickTime int + func (sc ServerConfig) Marshall(w io.Writer) error + type ServerConfigServer struct + Host string + ID int + LeaderElectionPort int + PeerPort int + type SetDataRequest struct + Data []byte + Path string + Version int32 + type Stat struct + Aversion int32 + Ctime int64 + Cversion int32 + Czxid int64 + DataLength int32 + EphemeralOwner int64 + Mtime int64 + Mzxid int64 + NumChildren int32 + Pzxid int64 + Version int32 + type State int32 + func (s State) String() string + type TestCluster struct + Path string + Servers []TestServer + func StartTestCluster(size int, stdout, stderr io.Writer) (*TestCluster, error) + func (ts *TestCluster) Connect(idx int) (*Conn, error) + func (ts *TestCluster) ConnectAll() (*Conn, error) + func (ts *TestCluster) Stop() error + type TestServer struct + Path string + Port int + Srv *Server