Documentation ¶
Index ¶
- Constants
- func NewCodec() api.Protocol
- type MessageAckCommand
- type MessageCommand
- type Request
- func (r *Request) GetData() api.IoBuffer
- func (r *Request) GetHeader() api.HeaderMap
- func (r *Request) GetRequestId() uint64
- func (r *Request) GetStreamType() api.StreamType
- func (r *Request) GetTimeout() int32
- func (r *Request) IsGoAwayFrame() bool
- func (r *Request) IsHeartbeatFrame() bool
- func (r *Request) SetData(data api.IoBuffer)
- func (r *Request) SetRequestId(id uint64)
- type Response
- type XCodec
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 header.CommonHeader }
func (*Request) GetRequestId ¶
func (*Request) GetStreamType ¶
func (r *Request) GetStreamType() api.StreamType
func (*Request) GetTimeout ¶ added in v0.27.0
func (*Request) IsGoAwayFrame ¶ added in v0.27.0
func (*Request) IsHeartbeatFrame ¶ added in v0.27.0
func (*Request) SetRequestId ¶
type Response ¶
func (*Response) GetRequestId ¶
func (*Response) GetStatusCode ¶ added in v0.27.0
func (*Response) GetStreamType ¶
func (r *Response) GetStreamType() api.StreamType
func (*Response) SetRequestId ¶
type XCodec ¶ added in v0.26.0
type XCodec struct {
// contains filtered or unexported fields
}
func (*XCodec) HTTPMapping ¶ added in v0.26.0
func (codec *XCodec) HTTPMapping() api.HTTPMapping
func (*XCodec) NewXProtocol ¶ added in v0.26.0
func (*XCodec) ProtocolMatch ¶ added in v0.26.0
func (codec *XCodec) ProtocolMatch() api.ProtocolMatch
func (*XCodec) ProtocolName ¶ added in v0.26.0
func (codec *XCodec) ProtocolName() api.ProtocolName
Click to show internal directories.
Click to hide internal directories.