Documentation
¶
Index ¶
- func DecodeBindReq(buf buffer.Buffer) (cid, uid int64, err error)
- func DecodeBindRes(buf buffer.Buffer) (uint16, error)
- func DecodeBroadcastReq(req *buffer.Bytes) (session.Kind, bool, *buffer.Bytes, error)
- func DecodeBroadcastRes(buf buffer.Buffer) (code uint16, total uint64, err error)
- func DecodeDeliverReq(req *buffer.Bytes) (int64, int64, *buffer.Bytes, error)
- func DecodeDeliverRes(buf buffer.Buffer) (uint16, error)
- func DecodeDisconnectReq(buf buffer.Buffer) (kind session.Kind, target int64, force bool, err error)
- func DecodeDisconnectRes(buf buffer.Buffer) (uint16, error)
- func DecodeGetIPReq(buf buffer.Buffer) (kind session.Kind, target int64, err error)
- func DecodeGetIPRes(buf buffer.Buffer) (code uint16, ip string, err error)
- func DecodeGetStateReq(buf buffer.Buffer) error
- func DecodeGetStateRes(buf buffer.Buffer) (code uint16, state cluster.State, err error)
- func DecodeHandshakeReq(buf buffer.Buffer) (cluster.Kind, string, uint64, error)
- func DecodeHandshakeRes(buf buffer.Buffer) (uint16, error)
- func DecodeIsOnlineReq(buf buffer.Buffer) (kind session.Kind, target int64, err error)
- func DecodeIsOnlineRes(buf buffer.Buffer) (code uint16, isOnline bool, err error)
- func DecodeMulticastReq(req *buffer.Bytes) (session.Kind, []int64, bool, *buffer.Bytes, error)
- func DecodeMulticastRes(buf buffer.Buffer) (code uint16, total uint64, err error)
- func DecodePublishReq(req *buffer.Bytes) (string, bool, *buffer.Bytes, error)
- func DecodePublishRes(buf buffer.Buffer) (code uint16, total uint64, err error)
- func DecodePushReq(req *buffer.Bytes) (session.Kind, int64, bool, *buffer.Bytes, error)
- func DecodePushRes(buf buffer.Buffer) (uint16, error)
- func DecodeSetStateReq(buf buffer.Buffer) (state cluster.State, err error)
- func DecodeSetStateRes(buf buffer.Buffer) (uint16, error)
- func DecodeStatReq(buf buffer.Buffer) (kind session.Kind, err error)
- func DecodeStatRes(buf buffer.Buffer) (code uint16, total uint64, err error)
- func DecodeSubscribeReq(buf buffer.Buffer) (kind session.Kind, targets []int64, channel string, err error)
- func DecodeSubscribeRes(buf buffer.Buffer) (uint16, error)
- func DecodeTriggerReq(buf *buffer.Bytes) (event cluster.Event, cid int64, uid int64, err error)
- func DecodeTriggerRes(buf buffer.Buffer) (uint16, error)
- func DecodeUnbindReq(buf buffer.Buffer) (uid int64, err error)
- func DecodeUnbindRes(buf buffer.Buffer) (uint16, error)
- func DecodeUnsubscribeReq(buf buffer.Buffer) (kind session.Kind, targets []int64, channel string, err error)
- func DecodeUnsubscribeRes(buf buffer.Buffer) (uint16, error)
- func EncodeBindReq(seq uint64, cid, uid int64) *buffer.NocopyBuffer
- func EncodeBindRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeBroadcastReq(seq uint64, kind session.Kind, disconnect bool, message buffer.Buffer) *buffer.NocopyBuffer
- func EncodeBroadcastRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
- func EncodeDeliverReq(seq uint64, cid int64, uid int64, buf buffer.Buffer) *buffer.NocopyBuffer
- func EncodeDeliverRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeDisconnectReq(seq uint64, kind session.Kind, target int64, force bool) *buffer.NocopyBuffer
- func EncodeDisconnectRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeGetIPReq(seq uint64, kind session.Kind, target int64) *buffer.NocopyBuffer
- func EncodeGetIPRes(seq uint64, code uint16, ip ...string) *buffer.NocopyBuffer
- func EncodeGetStateReq(seq uint64) *buffer.NocopyBuffer
- func EncodeGetStateRes(seq uint64, code uint16, state cluster.State) *buffer.NocopyBuffer
- func EncodeHandshakeReq(seq uint64, kind cluster.Kind, inst string, epoch uint64) buffer.Buffer
- func EncodeHandshakeRes(seq uint64, code uint16) buffer.Buffer
- func EncodeIsOnlineReq(seq uint64, kind session.Kind, target int64) *buffer.NocopyBuffer
- func EncodeIsOnlineRes(seq uint64, code uint16, isOnline bool) *buffer.NocopyBuffer
- func EncodeMulticastReq(seq uint64, kind session.Kind, targets []int64, disconnect bool, ...) *buffer.NocopyBuffer
- func EncodeMulticastRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
- func EncodePublishReq(seq uint64, channel string, disconnect bool, message buffer.Buffer) *buffer.NocopyBuffer
- func EncodePublishRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
- func EncodePushReq(seq uint64, kind session.Kind, target int64, disconnect bool, ...) *buffer.NocopyBuffer
- func EncodePushRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeSetStateReq(seq uint64, state cluster.State) *buffer.NocopyBuffer
- func EncodeSetStateRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeStatReq(seq uint64, kind session.Kind) *buffer.NocopyBuffer
- func EncodeStatRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
- func EncodeSubscribeReq(seq uint64, kind session.Kind, targets []int64, channel string) *buffer.NocopyBuffer
- func EncodeSubscribeRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeTriggerReq(seq uint64, event cluster.Event, cid int64, uid ...int64) *buffer.NocopyBuffer
- func EncodeTriggerRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeUnbindReq(seq uint64, uid int64) *buffer.NocopyBuffer
- func EncodeUnbindRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func EncodeUnsubscribeReq(seq uint64, kind session.Kind, targets []int64, channel string) *buffer.NocopyBuffer
- func EncodeUnsubscribeRes(seq uint64, code uint16) *buffer.NocopyBuffer
- func Heartbeat() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBindReq ¶
DecodeBindReq decodes a bind request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {cid + uid}
func DecodeBindRes ¶
DecodeBindRes decodes a bind response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeBroadcastReq ¶
DecodeBroadcastReq decodes a broadcast request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + disconnect + <message packet>}
func DecodeBroadcastRes ¶
DecodeBroadcastRes decodes a broadcast response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func DecodeDeliverReq ¶
DecodeDeliverReq decodes a deliver request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {cid + uid + <message packet>}
func DecodeDeliverRes ¶
DecodeDeliverRes decodes a deliver response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeDisconnectReq ¶
func DecodeDisconnectReq(buf buffer.Buffer) (kind session.Kind, target int64, force bool, err error)
DecodeDisconnectReq decodes a disconnect request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + target + force}
func DecodeDisconnectRes ¶
DecodeDisconnectRes decodes a disconnect response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeGetIPReq ¶
DecodeGetIPReq decodes a get-IP request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + target}
func DecodeGetIPRes ¶
DecodeGetIPRes decodes a get-IP response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code + [ip]}
func DecodeGetStateReq ¶
DecodeGetStateReq decodes a get-state request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq}
func DecodeGetStateRes ¶
DecodeGetStateRes decodes a get-state response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code + cluster state}
func DecodeHandshakeReq ¶
DecodeHandshakeReq decodes a handshake request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {ins kind + ins id + conn epoch}
func DecodeHandshakeRes ¶
DecodeHandshakeRes decodes a handshake response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeIsOnlineReq ¶
DecodeIsOnlineReq decodes an is-online request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + target}
func DecodeIsOnlineRes ¶
DecodeIsOnlineRes decodes an is-online response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code + online state}
func DecodeMulticastReq ¶
DecodeMulticastReq decodes a multicast request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + count + targets + disconnect + <message packet>}
func DecodeMulticastRes ¶
DecodeMulticastRes decodes a multicast response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func DecodePublishReq ¶ added in v2.3.0
DecodePublishReq decodes a publish request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {channel len + channel + disconnect + <message packet>}
func DecodePublishRes ¶ added in v2.3.0
DecodePublishRes decodes a publish response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func DecodePushReq ¶
DecodePushReq decodes a push request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + target + disconnect + <message packet>}
func DecodePushRes ¶
DecodePushRes decodes a push response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeSetStateReq ¶
DecodeSetStateReq decodes a set-state request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {cluster state}
func DecodeSetStateRes ¶
DecodeSetStateRes decodes a set-state response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeStatReq ¶
DecodeStatReq decodes a stat request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind}
func DecodeStatRes ¶
DecodeStatRes decodes a stat response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func DecodeSubscribeReq ¶ added in v2.3.0
func DecodeSubscribeReq(buf buffer.Buffer) (kind session.Kind, targets []int64, channel string, err error)
DecodeSubscribeReq decodes a subscribe request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + count + targets + channel}
func DecodeSubscribeRes ¶ added in v2.3.0
DecodeSubscribeRes decodes a subscribe response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeTriggerReq ¶
DecodeTriggerReq decodes a trigger request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {event + cid + [uid]}
func DecodeTriggerRes ¶
DecodeTriggerRes decodes a trigger response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeUnbindReq ¶
DecodeUnbindReq decodes an unbind request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {uid}
func DecodeUnbindRes ¶
DecodeUnbindRes decodes an unbind response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func DecodeUnsubscribeReq ¶ added in v2.3.0
func DecodeUnsubscribeReq(buf buffer.Buffer) (kind session.Kind, targets []int64, channel string, err error)
DecodeUnsubscribeReq decodes an unsubscribe request. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {session kind + count + targets + channel}
func DecodeUnsubscribeRes ¶ added in v2.3.0
DecodeUnsubscribeRes decodes an unsubscribe response. Note that buf contains only the private section. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeBindReq ¶
func EncodeBindReq(seq uint64, cid, uid int64) *buffer.NocopyBuffer
EncodeBindReq encodes a bind request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {cid + uid}
func EncodeBindRes ¶
func EncodeBindRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeBindRes encodes a bind response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeBroadcastReq ¶
func EncodeBroadcastReq(seq uint64, kind session.Kind, disconnect bool, message buffer.Buffer) *buffer.NocopyBuffer
EncodeBroadcastReq encodes a broadcast request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind + disconnect + <message packet>}
func EncodeBroadcastRes ¶
func EncodeBroadcastRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
EncodeBroadcastRes encodes a broadcast response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func EncodeDeliverReq ¶
EncodeDeliverReq encodes a deliver request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {cid + uid + <message packet>}
func EncodeDeliverRes ¶
func EncodeDeliverRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeDeliverRes encodes a deliver response. Protocol: size + header + route + seq + code
func EncodeDisconnectReq ¶
func EncodeDisconnectReq(seq uint64, kind session.Kind, target int64, force bool) *buffer.NocopyBuffer
EncodeDisconnectReq encodes a disconnect request. Note that buf contains the full protocol. Protocol: {size + header + route + seq} + private section: {session kind + target + force}
func EncodeDisconnectRes ¶
func EncodeDisconnectRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeDisconnectRes encodes a disconnect response. Note that buf contains the full protocol. Protocol: {size + header + route + seq} + private section: {code}
func EncodeGetIPReq ¶
EncodeGetIPReq encodes a get-IP request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind + target}
func EncodeGetIPRes ¶
func EncodeGetIPRes(seq uint64, code uint16, ip ...string) *buffer.NocopyBuffer
EncodeGetIPRes encodes a get-IP response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code + [ip]}
func EncodeGetStateReq ¶
func EncodeGetStateReq(seq uint64) *buffer.NocopyBuffer
EncodeGetStateReq encodes a get-state request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq}
func EncodeGetStateRes ¶
EncodeGetStateRes encodes a get-state response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code + cluster state}
func EncodeHandshakeReq ¶
EncodeHandshakeReq encodes a handshake request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {ins kind + ins id + conn epoch}
func EncodeHandshakeRes ¶
EncodeHandshakeRes encodes a handshake response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeIsOnlineReq ¶
EncodeIsOnlineReq encodes an is-online request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind + target}
func EncodeIsOnlineRes ¶
func EncodeIsOnlineRes(seq uint64, code uint16, isOnline bool) *buffer.NocopyBuffer
EncodeIsOnlineRes encodes an is-online response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code + online state}
func EncodeMulticastReq ¶
func EncodeMulticastReq(seq uint64, kind session.Kind, targets []int64, disconnect bool, message buffer.Buffer) *buffer.NocopyBuffer
EncodeMulticastReq encodes a multicast request (at most 65535 targets). Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind + count + targets + disconnect + <message packet>}
func EncodeMulticastRes ¶
func EncodeMulticastRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
EncodeMulticastRes encodes a multicast response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func EncodePublishReq ¶ added in v2.3.0
func EncodePublishReq(seq uint64, channel string, disconnect bool, message buffer.Buffer) *buffer.NocopyBuffer
EncodePublishReq encodes a publish request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {channel len + channel + disconnect + <message packet>}
func EncodePublishRes ¶ added in v2.3.0
func EncodePublishRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
EncodePublishRes encodes a publish response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func EncodePushReq ¶
func EncodePushReq(seq uint64, kind session.Kind, target int64, disconnect bool, message buffer.Buffer) *buffer.NocopyBuffer
EncodePushReq encodes a push request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind + target + disconnect + <message packet>}
func EncodePushRes ¶
func EncodePushRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodePushRes encodes a push response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeSetStateReq ¶
func EncodeSetStateReq(seq uint64, state cluster.State) *buffer.NocopyBuffer
EncodeSetStateReq encodes a set-state request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {cluster state}
func EncodeSetStateRes ¶
func EncodeSetStateRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeSetStateRes encodes a set-state response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeStatReq ¶
func EncodeStatReq(seq uint64, kind session.Kind) *buffer.NocopyBuffer
EncodeStatReq encodes a stat request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind}
func EncodeStatRes ¶
func EncodeStatRes(seq uint64, code uint16, total ...uint64) *buffer.NocopyBuffer
EncodeStatRes encodes a stat response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code + [total]}
func EncodeSubscribeReq ¶ added in v2.3.0
func EncodeSubscribeReq(seq uint64, kind session.Kind, targets []int64, channel string) *buffer.NocopyBuffer
EncodeSubscribeReq encodes a subscribe request (at most 65535 targets per call). Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind + count + targets + channel}
func EncodeSubscribeRes ¶ added in v2.3.0
func EncodeSubscribeRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeSubscribeRes encodes a subscribe response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeTriggerReq ¶
func EncodeTriggerReq(seq uint64, event cluster.Event, cid int64, uid ...int64) *buffer.NocopyBuffer
EncodeTriggerReq encodes a trigger request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {event + cid + [uid]}
func EncodeTriggerRes ¶
func EncodeTriggerRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeTriggerRes encodes a trigger response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeUnbindReq ¶
func EncodeUnbindReq(seq uint64, uid int64) *buffer.NocopyBuffer
EncodeUnbindReq encodes an unbind request. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {uid}
func EncodeUnbindRes ¶
func EncodeUnbindRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeUnbindRes encodes an unbind response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
func EncodeUnsubscribeReq ¶ added in v2.3.0
func EncodeUnsubscribeReq(seq uint64, kind session.Kind, targets []int64, channel string) *buffer.NocopyBuffer
EncodeUnsubscribeReq encodes an unsubscribe request (at most 65535 targets per call). Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {session kind + count + targets + channel}
func EncodeUnsubscribeRes ¶ added in v2.3.0
func EncodeUnsubscribeRes(seq uint64, code uint16) *buffer.NocopyBuffer
EncodeUnsubscribeRes encodes an unsubscribe response. Note that buf contains the full protocol. Protocol: public section: {size + header + route + seq} + private section: {code}
Types ¶
This section is empty.