Versions in this module Expand all Collapse all v1 v1.0.0 Oct 31, 2023 Changes in this version + const Bin + const Close + const Json + const Open + const Ping + const Pong + const ProtoBuf + const Text + const Unknown + const Version + var CloseMessage = []byte + var OpenMessage = []byte + var PingMessage = []byte + var PongMessage = []byte + type DefaultTcpProtocol struct + func (d *DefaultTcpProtocol) Decode(message []byte) (order uint32, messageType byte, code uint32, id uint64, route []byte, ...) + func (d *DefaultTcpProtocol) Encode(order uint32, messageType byte, code uint32, id uint64, route []byte, ...) []byte + func (d *DefaultTcpProtocol) HeadLen() int + func (d *DefaultTcpProtocol) IsPing(messageType byte) bool + func (d *DefaultTcpProtocol) IsPong(messageType byte) bool + func (d *DefaultTcpProtocol) IsUnknown(messageType byte) bool + func (d *DefaultTcpProtocol) PackPing() []byte + func (d *DefaultTcpProtocol) PackPong() []byte + func (d *DefaultTcpProtocol) Reader() func(n int, buf []byte, fn func(bytes []byte)) error + type DefaultUdpProtocol struct + func (d *DefaultUdpProtocol) Decode(message []byte) (order uint32, messageType byte, code uint32, id uint64, route []byte, ...) + func (d *DefaultUdpProtocol) Encode(order uint32, messageType byte, code uint32, id uint64, route []byte, ...) []byte + func (d *DefaultUdpProtocol) GetMessageType(message []byte) byte + func (d *DefaultUdpProtocol) HeadLen() int + func (d *DefaultUdpProtocol) IsClose(messageType byte) bool + func (d *DefaultUdpProtocol) IsOpen(messageType byte) bool + func (d *DefaultUdpProtocol) IsPing(messageType byte) bool + func (d *DefaultUdpProtocol) IsPong(messageType byte) bool + func (d *DefaultUdpProtocol) IsUnknown(messageType byte) bool + func (d *DefaultUdpProtocol) PackClose() []byte + func (d *DefaultUdpProtocol) PackOpen() []byte + func (d *DefaultUdpProtocol) PackPing() []byte + func (d *DefaultUdpProtocol) PackPong() []byte + func (d *DefaultUdpProtocol) Reader() func(n int, buf []byte, fn func(bytes []byte)) error + type DefaultWsProtocol struct + func (d *DefaultWsProtocol) Decode(message []byte) (order uint32, messageType byte, code uint32, id uint64, route []byte, ...) + func (d *DefaultWsProtocol) Encode(order uint32, messageType byte, code uint32, id uint64, route []byte, ...) []byte + func (d *DefaultWsProtocol) HeadLen() int + func (d *DefaultWsProtocol) IsPing(messageType byte) bool + func (d *DefaultWsProtocol) IsPong(messageType byte) bool + func (d *DefaultWsProtocol) IsUnknown(messageType byte) bool + func (d *DefaultWsProtocol) PackPing() []byte + func (d *DefaultWsProtocol) PackPong() []byte + func (d *DefaultWsProtocol) Reader() func(n int, buf []byte, fn func(bytes []byte)) error + type Protocol interface + Decode func(message []byte) (order uint32, messageType byte, code uint32, id uint64, route []byte, ...) + Encode func(order uint32, messageType byte, code uint32, id uint64, route []byte, ...) []byte + HeadLen func() int + IsPing func(messageType byte) bool + IsPong func(messageType byte) bool + IsUnknown func(messageType byte) bool + PackPing func() []byte + PackPong func() []byte + Reader func() func(n int, buf []byte, fn func(bytes []byte)) error + type UDPProtocol interface + GetMessageType func([]byte) byte + IsClose func(byte) bool + IsOpen func(byte) bool + PackClose func() []byte + PackOpen func() []byte