Documentation ¶
Index ¶
- Constants
- Variables
- func BytesLen(bytes []byte) int
- func PanicToError(r any, stack []byte) error
- func StrLen(str string) int
- type Acl
- type CloseReq
- type CloseResp
- type ConnectReq
- type ConnectResp
- type CreateReq
- type CreateResp
- type DataNode
- type DeleteReq
- type DeleteResp
- type ErrorCode
- type ExistsReq
- type ExistsResp
- type GetChildrenReq
- type GetChildrenResp
- type GetDataReq
- type GetDataResp
- type Id
- type OpCode
- type SetDataReq
- type SetDataResp
- type Snapshot
- type Stat
- type StatPersisted
Constants ¶
View Source
const ( LenAclVersion = 4 LenArray = 4 LenChildVersion = 4 LenCreated = LenTime LenCreatedZxId = LenZxId LenDataLength = 4 LenEphemeralOwner = 8 LenError = 4 LenFlags = 4 LenLastModified = LenTime LenLastModifiedZxId = LenZxId LenLastZxidSeen = LenZxId LenLength = 4 LenNumberOfChildren = 4 LenOpCode = 4 LenPeerZxId = LenZxId LenPermission = 4 LenProtocolVersion = 4 LenReadonly = 1 LenSessionId = 8 LenTime = 8 LenTimeout = 4 LenTransactionId = 4 LenVersion = 4 LenWatch = 1 LenZxId = 8 )
Variables ¶
View Source
var (
PasswordEmpty = make([]byte, 16)
)
Functions ¶
func PanicToError ¶
Types ¶
type Acl ¶
func (*Acl) ByteLength ¶
type ConnectReq ¶
type ConnectReq struct { ProtocolVersion int LastZxidSeen int64 Timeout int SessionId int64 Password []byte ReadOnly bool }
func DecodeConnectReq ¶
func DecodeConnectReq(bytes []byte) (req *ConnectReq, err error)
func (*ConnectReq) Bytes ¶
func (c *ConnectReq) Bytes(containLen bool) []byte
func (*ConnectReq) BytesLength ¶
func (c *ConnectReq) BytesLength(containLen bool) int
type ConnectResp ¶
type ConnectResp struct { ProtocolVersion int Timeout int SessionId int64 Password []byte ReadOnly bool }
func DecodeConnectResp ¶
func DecodeConnectResp(bytes []byte) (resp *ConnectResp, err error)
func (*ConnectResp) Bytes ¶
func (c *ConnectResp) Bytes(containLen bool) []byte
func (*ConnectResp) BytesLength ¶
func (c *ConnectResp) BytesLength(containLen bool) int
type CreateReq ¶
type CreateReq struct { TransactionId int OpCode OpCode Path string Data []byte Permissions []int Scheme string Credentials string Flags int }
func DecodeCreateReq ¶
func (*CreateReq) BytesLength ¶
type CreateResp ¶
func DecodeCreateResp ¶
func DecodeCreateResp(bytes []byte) (resp *CreateResp, err error)
func (*CreateResp) Bytes ¶
func (c *CreateResp) Bytes() []byte
func (*CreateResp) BytesLength ¶
func (c *CreateResp) BytesLength() int
type DataNode ¶
type DataNode struct { Path string Data []byte Acl int64 Stat *StatPersisted Children []*DataNode }
type DeleteResp ¶
func DecodeDeleteResp ¶
func DecodeDeleteResp(bytes []byte) (resp *DeleteResp, err error)
func (*DeleteResp) Bytes ¶
func (c *DeleteResp) Bytes() []byte
func (*DeleteResp) BytesLength ¶
func (c *DeleteResp) BytesLength() int
type ExistsResp ¶
func DecodeExistsResp ¶
func DecodeExistsResp(bytes []byte) (resp *ExistsResp, err error)
func (*ExistsResp) Bytes ¶
func (c *ExistsResp) Bytes() []byte
func (*ExistsResp) BytesLength ¶
func (c *ExistsResp) BytesLength() int
type GetChildrenReq ¶
func DecodeGetChildrenReq ¶
func DecodeGetChildrenReq(bytes []byte) (req *GetChildrenReq, err error)
func (*GetChildrenReq) Bytes ¶
func (g *GetChildrenReq) Bytes(containLen bool) []byte
func (*GetChildrenReq) BytesLength ¶
func (g *GetChildrenReq) BytesLength(containLen bool) int
type GetChildrenResp ¶
func DecodeGetChildrenResp ¶
func DecodeGetChildrenResp(bytes []byte) (resp *GetChildrenResp, err error)
func (*GetChildrenResp) Bytes ¶
func (c *GetChildrenResp) Bytes() []byte
func (*GetChildrenResp) BytesLength ¶
func (c *GetChildrenResp) BytesLength() int
type GetDataReq ¶
func DecodeGetDataReq ¶
func DecodeGetDataReq(bytes []byte) (req *GetDataReq, err error)
func (*GetDataReq) Bytes ¶
func (e *GetDataReq) Bytes(containLen bool) []byte
func (*GetDataReq) BytesLength ¶
func (e *GetDataReq) BytesLength(containLen bool) int
type GetDataResp ¶
func DecodeGetDataResp ¶
func DecodeGetDataResp(bytes []byte) (resp *GetDataResp, err error)
func (*GetDataResp) Bytes ¶
func (c *GetDataResp) Bytes() []byte
func (*GetDataResp) BytesLength ¶
func (c *GetDataResp) BytesLength() int
type Id ¶
func (*Id) ByteLength ¶
type OpCode ¶
type OpCode int32
const ( OP_NOTIFICATION OpCode = iota OP_CREATE OP_DELETE OP_EXISTS OP_GET_DATA OP_SET_DATA OP_GET_ACL OP_SET_ACL OP_GET_CHILDREN OP_SYNC OP_PING OP_GET_CHILDREN2 OP_CHECK OP_MULTI OP_CREATE2 OP_RECONFIG OP_CHECK_WATCHES OP_REMOVE_WATCHES OP_CREATE_CONTAINER OP_DELETE_CONTAINER OP_CREATE_TTL OP_MULTI_READ )
type SetDataReq ¶
func DecodeSetDataReq ¶
func DecodeSetDataReq(bytes []byte) (req *SetDataReq, err error)
func (*SetDataReq) Bytes ¶
func (s *SetDataReq) Bytes(containLen bool) []byte
func (*SetDataReq) BytesLength ¶
func (s *SetDataReq) BytesLength(containLen bool) int
type SetDataResp ¶
func DecodeSetDataResp ¶
func DecodeSetDataResp(bytes []byte) (resp *SetDataResp, err error)
func (*SetDataResp) Bytes ¶
func (s *SetDataResp) Bytes() []byte
func (*SetDataResp) BytesLength ¶
func (s *SetDataResp) BytesLength() int
type Snapshot ¶
type Snapshot struct { Magic string Version int DbId int64 SessionMap map[int64]int AclMap map[int64][]*Acl Root *DataNode NodeMap map[string]*DataNode NodeCount int }
func DecodeSnapshot ¶
type Stat ¶
type Stat struct { CreatedZxId int64 LastModifiedZxId int64 Created int64 LastModified int64 Version int ChildVersion int AclVersion int EphemeralOwner int64 DataLength int NumChildren int LastModifiedChildrenZxId int64 }
func DecodeStat ¶
func (*Stat) BytesLength ¶
type StatPersisted ¶
type StatPersisted struct { CreatedZxId int64 LastModifiedZxId int64 Created int64 LastModified int64 Version int ChildVersion int AclVersion int EphemeralOwner int64 PeerZxId int64 }
func DecodeStatPersisted ¶
func DecodeStatPersisted(bytes []byte) (stat *StatPersisted, err error)
func (*StatPersisted) BytesLength ¶
func (s *StatPersisted) BytesLength() int
Source Files ¶
- acl.go
- close_req.go
- close_resp.go
- connect_req.go
- connect_resp.go
- const.go
- create_req.go
- create_resp.go
- data_node.go
- delete_req.go
- delete_resp.go
- error_code.go
- exists_req.go
- exists_resp.go
- get_children_req.go
- get_children_resp.go
- get_data_req.go
- get_data_resp.go
- id.go
- op_code.go
- set_data_req.go
- set_data_resp.go
- snapshot.go
- stat.go
- stat_persisted.go
- test_util.go
- util_decode.go
- util_general_bool.go
- util_general_buffer.go
- util_general_byte.go
- util_general_bytes.go
- util_general_integer.go
- util_general_string.go
- util_zookeeper_bool.go
- util_zookeeper_bytes.go
- util_zookeeper_int.go
- util_zookeeper_int32.go
- util_zookeeper_int64.go
- util_zookeeper_snapshot.go
- util_zookeeper_string.go
Click to show internal directories.
Click to hide internal directories.