Versions in this module Expand all Collapse all v1 v1.0.4 Jun 14, 2022 Changes in this version type KerberosConfig + ServiceName string v1.0.3 May 24, 2022 Changes in this version + const DefaultPort + const FlagEphemeral + const FlagSequence + const FlagTTL + const GssapiGenericTag + const PermAdmin + const PermAll + const PermCreate + const PermDelete + const PermRead + const PermWrite + const TokIdKrbApReq + var ErrAPIError = errors.New("zk: api error") + var ErrAuthFailed = errors.New("zk: client authentication failed") + var ErrBadArguments = errors.New("invalid arguments") + 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 ErrInvalidFlags = errors.New("zk: invalid flags specified") + var ErrInvalidPath = errors.New("zk: invalid path") + 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 responses to process") + var ErrPtrExpected = errors.New("zk: encode/decode expect a non-nil pointer to struct") + var ErrReconfigDisabled = errors.New(...) + 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 WithDialer(dialer Dialer) connOption + func WithEventCallback(cb EventCallback) connOption + func WithHostProvider(hostProvider HostProvider) connOption + func WithLogInfo(logInfo bool) connOption + func WithLogger(logger Logger) connOption + func WithMaxBufferSize(maxBufferSize int) connOption + func WithMaxConnBufferSize(maxBufferSize int) connOption + func WithSASLConfig(config *SASLConfig) connOption + 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, options ...connOption) (*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) CreateContainer(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) CreateTTL(path string, data []byte, flags int32, acl []ACL, ttl time.Duration) (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) IncrementalReconfig(joining, leaving []string, version int64) (*Stat, error) + func (c *Conn) Multi(ops ...interface{}) ([]MultiResponse, error) + func (c *Conn) Reconfig(members []string, version int64) (*Stat, error) + func (c *Conn) Server() string + func (c *Conn) SessionID() int64 + 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) SetLogger(l Logger) + func (c *Conn) State() State + func (c *Conn) Sync(path string) (string, error) + type CreateContainerRequest CreateRequest + type CreateRequest struct + Acl []ACL + Data []byte + Flags int32 + Path string + type CreateTTLRequest struct + Acl []ACL + Data []byte + Flags int32 + Path string + Ttl int64 + type DNSHostProvider struct + func (hp *DNSHostProvider) Connected() + func (hp *DNSHostProvider) Init(servers []string) error + func (hp *DNSHostProvider) Len() int + func (hp *DNSHostProvider) Next() (server string, retryStart bool) + type DeleteRequest PathVersionRequest + type Dialer func(network, address string, timeout time.Duration) (net.Conn, error) + type ErrCode int32 + type Event struct + Err error + Path string + Server string + State State + Type EventType + type EventCallback func(Event) + type EventType int32 + const EventNodeChildrenChanged + const EventNodeCreated + const EventNodeDataChanged + const EventNodeDeleted + const EventNotWatching + const EventSession + func (t EventType) String() string + type GssapiStep int64 + const GssapiFinish + const GssapiInitial + const GssapiVerify + type HostProvider interface + Connected func() + Init func(servers []string) error + Len func() int + Next func() (server string, retryStart bool) + type KerberosAuth struct + Config *KerberosConfig + func (k *KerberosAuth) Authorize(ctx context.Context, c *Conn) error + type KerberosConfig struct + Keytab []byte + Krb5 string + PrincipalStr string + type Lock struct + func NewLock(c *Conn, path string, acl []ACL) *Lock + func (l *Lock) Lock() error + func (l *Lock) LockWithData(data []byte) error + func (l *Lock) Unlock() error + type Logger interface + Printf func(string, ...interface{}) + var DefaultLogger Logger = defaultLogger{} + type Mode uint8 + const ModeFollower + const ModeLeader + const ModeStandalone + const ModeUnknown + func (m Mode) String() string + type MultiResponse struct + Error error + Stat *Stat + String string + type PathVersionRequest struct + Path string + Version int32 + type Principal struct + Components []string + Realm string + func NewPrincipal(principalStr string) (*Principal, error) + type SASLConfig struct + Enable bool + KerberosConfig *KerberosConfig + 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 ServerStats struct + AvgLatency float64 + 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 + Server string + 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 + const StateAuthFailed + const StateConnected + const StateConnectedReadOnly + const StateConnecting + const StateDisconnected + const StateExpired + const StateHasSession + const StateSaslAuthenticated + const StateUnknown + func (s State) String() string