Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProtocolName types.ProtocolName = "x_example" // protocol Magic byte = 'x' //magic DirRequest byte = 0 // dir DirResponse byte = 1 // dir TypeHeartbeat byte = 0 // cmd code TypeMessage byte = 1 TypeGoAway byte = 2 ResponseStatusSuccess uint16 = 0 // 0x00 response status ResponseStatusError uint16 = 1 // 0x01 RequestHeaderLen int = 11 // protocol header fields length ResponseHeaderLen int = 13 MinimalDecodeLen int = RequestHeaderLen // minimal length for decoding RequestIdIndex = 3 )
protocol constants
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MessageAckCommand ¶
type MessageAckCommand struct { Response // TODO: pb deserialize target, extract from Payload Message interface{} }
type MessageCommand ¶
type MessageCommand struct { Request // TODO: pb deserialize target, extract from Payload Message interface{} }
type Request ¶
type Request struct { Type byte RequestId uint32 PayloadLen uint32 Payload []byte Content types.IoBuffer }
func (*Request) GetRequestId ¶
func (*Request) GetStreamType ¶
func (r *Request) GetStreamType() xprotocol.StreamType
func (*Request) SetRequestId ¶
type Response ¶
func (*Response) GetRequestId ¶
func (*Response) GetStreamType ¶
func (r *Response) GetStreamType() xprotocol.StreamType
func (*Response) SetRequestId ¶
Click to show internal directories.
Click to hide internal directories.