Versions in this module Expand all Collapse all v0 v0.1.2 May 11, 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 FLWRuok(servers []string, timeout time.Duration) []bool + func FormatServers(servers []string) []string + 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 + Server 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 Mode uint8 + const ModeFollower + const ModeLeader + const ModeStandalone + const ModeUnknown + func (m Mode) String() string + 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 ServerClient struct + Addr string + AvgLatency int32 + Error error + Established time.Time + LastLatency int32 + LastOperation string + LastResponse time.Time + Lcxid int64 + Lzxid int64 + MaxLatency int32 + MinLatency int32 + Queued int64 + Received int64 + Sent int64 + SessionID int64 + Timeout int32 + type ServerClients struct + Clients []*ServerClient + Error error + func FLWCons(servers []string, timeout time.Duration) ([]*ServerClients, bool) + 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 ServerStats struct + AvgLatency int64 + BuildTime time.Time + Connections int64 + Counter int32 + Epoch int32 + Error error + MaxLatency int64 + MinLatency int64 + Mode Mode + NodeCount int64 + Outstanding int64 + Received int64 + Sent int64 + Version string + func FLWSrvr(servers []string, timeout time.Duration) ([]*ServerStats, bool) + 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, <-chan Event, error) + func (ts *TestCluster) ConnectAllTimeout(sessionTimeout time.Duration) (*Conn, <-chan Event, error) + func (ts *TestCluster) Stop() error + type TestServer struct + Path string + Port int + Srv *Server