Documentation ¶
Index ¶
- Constants
- Variables
- func DealRequestResponse(message Packet) *trace.TResult_
- type ApplicationRequest
- type ApplicationResponse
- type ApplicationSend
- type ApplicationStreamClose
- type ApplicationStreamCreate
- func (a *ApplicationStreamCreate) Decode(conn net.Conn, reader io.Reader) error
- func (a *ApplicationStreamCreate) Encode() ([]byte, error)
- func (a *ApplicationStreamCreate) GetPacketType() int16
- func (a *ApplicationStreamCreate) GetPayload() []byte
- func (a *ApplicationStreamCreate) GetRequestID() int
- type ApplicationStreamCreateFail
- func (a *ApplicationStreamCreateFail) Decode(conn net.Conn, reader io.Reader) error
- func (a *ApplicationStreamCreateFail) Encode() ([]byte, error)
- func (a *ApplicationStreamCreateFail) GetPacketType() int16
- func (a *ApplicationStreamCreateFail) GetPayload() []byte
- func (a *ApplicationStreamCreateFail) GetRequestID() int
- type ApplicationStreamCreateSuccess
- func (a *ApplicationStreamCreateSuccess) Decode(conn net.Conn, reader io.Reader) error
- func (a *ApplicationStreamCreateSuccess) Encode() ([]byte, error)
- func (a *ApplicationStreamCreateSuccess) GetPacketType() int16
- func (a *ApplicationStreamCreateSuccess) GetPayload() []byte
- func (a *ApplicationStreamCreateSuccess) GetRequestID() int
- type ApplicationStreamPing
- type ApplicationStreamPong
- type ApplicationStreamResponse
- func (a *ApplicationStreamResponse) Decode(conn net.Conn, reader io.Reader) error
- func (a *ApplicationStreamResponse) Encode() ([]byte, error)
- func (a *ApplicationStreamResponse) GetPacketType() int16
- func (a *ApplicationStreamResponse) GetPayload() []byte
- func (a *ApplicationStreamResponse) GetRequestID() int
- type ControlClientClose
- type ControlHandShake
- type ControlHandShakeResponse
- func (c *ControlHandShakeResponse) Decode(conn net.Conn, reader io.Reader) error
- func (c *ControlHandShakeResponse) Encode() ([]byte, error)
- func (c *ControlHandShakeResponse) GetPacketType() int16
- func (c *ControlHandShakeResponse) GetPayload() []byte
- func (c *ControlHandShakeResponse) GetRequestID() int
- type ControlPing
- type ControlPingPayload
- type ControlPong
- type HandshakeResponseCode
- type Packet
Constants ¶
const TCP_MAX_PACKET_SIZE int = 16 * 1024
const UDP_MAX_PACKET_SIZE int = 5 * 1024
Variables ¶
var ( APPLICATION_SEND int16 = 1 APPLICATION_TRACE_SEND int16 = 2 APPLICATION_TRACE_SEND_ACK int16 = 3 APPLICATION_REQUEST int16 = 5 APPLICATION_RESPONSE int16 = 6 APPLICATION_STREAM_CREATE int16 = 10 APPLICATION_STREAM_CREATE_SUCCESS int16 = 12 APPLICATION_STREAM_CREATE_FAIL int16 = 14 APPLICATION_STREAM_CLOSE int16 = 15 APPLICATION_STREAM_PING int16 = 17 APPLICATION_STREAM_PONG int16 = 18 APPLICATION_STREAM_RESPONSE int16 = 20 CONTROL_CLIENT_CLOSE int16 = 100 CONTROL_SERVER_CLOSE int16 = 110 // control packet CONTROL_HANDSHAKE int16 = 150 CONTROL_HANDSHAKE_RESPONSE int16 = 151 // keep stay because of performance in case of ping and pong. others removed. // CONTROL_PING will be deprecated. caused : Two payload types are used in one control packet. // since 1.7.0, use CONTROL_PING_SIMPLE, CONTROL_PING_PAYLOAD //@Deprecated CONTROL_PING int16 = 200 CONTROL_PONG int16 = 201 CONTROL_PING_SIMPLE int16 = 210 CONTROL_PING_PAYLOAD int16 = 211 UNKNOWN int16 = 500 PACKET_TYPE_SIZE int16 = 2 )
packetType
var ( CODE string = "code" SUB_CODE string = "subCode" CLUSTER string = "cluster" )
var ( HANDSHAKE_SUCCESS = &HandshakeResponseCode{0, 0, "Success."} HANDSHAKE_SIMPLEX_COMMUNICATION = &HandshakeResponseCode{0, 1, "Simplex Connection successfully established."} HANDSHAKE_DUPLEX_COMMUNICATION = &HandshakeResponseCode{0, 2, "Duplex Connection successfully established."} HANDSHAKE_ALREADY_KNOWN = &HandshakeResponseCode{1, 0, "Already Known."} HANDSHAKE_ALREADY_SIMPLEX_COMMUNICATION = &HandshakeResponseCode{1, 1, "Already Simplex Connection established."} HANDSHAKE_ALREADY_DUPLEX_COMMUNICATION = &HandshakeResponseCode{1, 2, "Already Duplex Connection established."} HANDSHAKE_PROPERTY_ERROR = &HandshakeResponseCode{2, 0, "Property error."} HANDSHAKE_PROTOCOL_ERROR = &HandshakeResponseCode{3, 0, "Illegal protocol error."} HANDSHAKE_UNKNOWN_ERROR = &HandshakeResponseCode{4, 0, "Unknown Error."} HANDSHAKE_UNKNOWN_CODE = &HandshakeResponseCode{-1, -1, "Unknown Code."} )
Functions ¶
func DealRequestResponse ¶
Types ¶
type ApplicationRequest ¶
APPLICATION_REQUEST ApplicationSend ...
func NewApplicationRequest ¶
func NewApplicationRequest() *ApplicationRequest
NewApplicationRequest ....
func (*ApplicationRequest) Encode ¶
func (a *ApplicationRequest) Encode() ([]byte, error)
Encode ...
func (*ApplicationRequest) GetPacketType ¶
func (a *ApplicationRequest) GetPacketType() int16
GetPacketType ...
func (*ApplicationRequest) GetPayload ¶
func (a *ApplicationRequest) GetPayload() []byte
GetPayload ...
func (*ApplicationRequest) GetRequestID ¶
func (a *ApplicationRequest) GetRequestID() int
GetRequestID ...
type ApplicationResponse ¶
ApplicationResponse ...
func NewApplicationResponse ¶
func NewApplicationResponse() *ApplicationResponse
func (*ApplicationResponse) Encode ¶
func (a *ApplicationResponse) Encode() ([]byte, error)
Encode ...
func (*ApplicationResponse) GetPacketType ¶
func (a *ApplicationResponse) GetPacketType() int16
GetPacketType ...
func (*ApplicationResponse) GetPayload ¶
func (a *ApplicationResponse) GetPayload() []byte
GetPayload ...
func (*ApplicationResponse) GetRequestID ¶
func (a *ApplicationResponse) GetRequestID() int
GetRequestID ...
type ApplicationSend ¶
APPLICATION_SEND ApplicationSend ...
func NewApplicationSend ¶
func NewApplicationSend() *ApplicationSend
func (*ApplicationSend) GetPacketType ¶
func (a *ApplicationSend) GetPacketType() int16
GetPacketType ...
func (*ApplicationSend) GetRequestID ¶
func (a *ApplicationSend) GetRequestID() int
GetRequestID ...
type ApplicationStreamClose ¶
ApplicationStreamClose ...
func NewApplicationStreamClose ¶
func NewApplicationStreamClose() *ApplicationStreamClose
NewApplicationStreamClose ...
func (*ApplicationStreamClose) Encode ¶
func (a *ApplicationStreamClose) Encode() ([]byte, error)
Encode ...
func (*ApplicationStreamClose) GetPacketType ¶
func (a *ApplicationStreamClose) GetPacketType() int16
GetPacketType ...
func (*ApplicationStreamClose) GetPayload ¶
func (a *ApplicationStreamClose) GetPayload() []byte
GetPayload ...
func (*ApplicationStreamClose) GetRequestID ¶
func (a *ApplicationStreamClose) GetRequestID() int
GetRequestID ...
type ApplicationStreamCreate ¶
ApplicationStreamCreate ...
func NewApplicationStreamCreate ¶
func NewApplicationStreamCreate() *ApplicationStreamCreate
NewApplicationStreamCreate ...
func (*ApplicationStreamCreate) Encode ¶
func (a *ApplicationStreamCreate) Encode() ([]byte, error)
Encode ...
func (*ApplicationStreamCreate) GetPacketType ¶
func (a *ApplicationStreamCreate) GetPacketType() int16
GetPacketType ...
func (*ApplicationStreamCreate) GetPayload ¶
func (a *ApplicationStreamCreate) GetPayload() []byte
GetPayload ...
func (*ApplicationStreamCreate) GetRequestID ¶
func (a *ApplicationStreamCreate) GetRequestID() int
GetRequestID ...
type ApplicationStreamCreateFail ¶
ApplicationStreamCreateFail ...
func NewApplicationStreamCreateFail ¶
func NewApplicationStreamCreateFail() *ApplicationStreamCreateFail
NewApplicationStreamCreateFail ...
func (*ApplicationStreamCreateFail) Encode ¶
func (a *ApplicationStreamCreateFail) Encode() ([]byte, error)
Encode ...
func (*ApplicationStreamCreateFail) GetPacketType ¶
func (a *ApplicationStreamCreateFail) GetPacketType() int16
GetPacketType ...
func (*ApplicationStreamCreateFail) GetPayload ¶
func (a *ApplicationStreamCreateFail) GetPayload() []byte
GetPayload ...
func (*ApplicationStreamCreateFail) GetRequestID ¶
func (a *ApplicationStreamCreateFail) GetRequestID() int
GetRequestID ...
type ApplicationStreamCreateSuccess ¶
ApplicationStreamCreateSuccess ...
func NewApplicationStreamCreateSuccess ¶
func NewApplicationStreamCreateSuccess() *ApplicationStreamCreateSuccess
NewApplicationStreamCreateSuccess ...
func (*ApplicationStreamCreateSuccess) Encode ¶
func (a *ApplicationStreamCreateSuccess) Encode() ([]byte, error)
Encode ...
func (*ApplicationStreamCreateSuccess) GetPacketType ¶
func (a *ApplicationStreamCreateSuccess) GetPacketType() int16
GetPacketType ...
func (*ApplicationStreamCreateSuccess) GetPayload ¶
func (a *ApplicationStreamCreateSuccess) GetPayload() []byte
GetPayload ...
func (*ApplicationStreamCreateSuccess) GetRequestID ¶
func (a *ApplicationStreamCreateSuccess) GetRequestID() int
GetRequestID ...
type ApplicationStreamPing ¶
ApplicationStreamPing ...
func NewApplicationStreamPing ¶
func NewApplicationStreamPing() *ApplicationStreamPing
NewApplicationStreamPing ...
func (*ApplicationStreamPing) Encode ¶
func (a *ApplicationStreamPing) Encode() ([]byte, error)
Encode ...
func (*ApplicationStreamPing) GetPacketType ¶
func (a *ApplicationStreamPing) GetPacketType() int16
GetPacketType ...
func (*ApplicationStreamPing) GetPayload ¶
func (a *ApplicationStreamPing) GetPayload() []byte
GetPayload ...
func (*ApplicationStreamPing) GetRequestID ¶
func (a *ApplicationStreamPing) GetRequestID() int
GetRequestID ...
type ApplicationStreamPong ¶
ApplicationStreamPong ...
func NewApplicationStreamPong ¶
func NewApplicationStreamPong() *ApplicationStreamPong
NewApplicationStreamPong ...
func (*ApplicationStreamPong) Encode ¶
func (a *ApplicationStreamPong) Encode() ([]byte, error)
Encode ...
func (*ApplicationStreamPong) GetPacketType ¶
func (a *ApplicationStreamPong) GetPacketType() int16
GetPacketType ...
func (*ApplicationStreamPong) GetPayload ¶
func (a *ApplicationStreamPong) GetPayload() []byte
GetPayload ...
func (*ApplicationStreamPong) GetRequestID ¶
func (a *ApplicationStreamPong) GetRequestID() int
GetRequestID ...
type ApplicationStreamResponse ¶
ApplicationStreamResponse ...
func NewApplicationStreamResponse ¶
func NewApplicationStreamResponse() *ApplicationStreamResponse
NewApplicationStreamResponse ...
func (*ApplicationStreamResponse) Encode ¶
func (a *ApplicationStreamResponse) Encode() ([]byte, error)
Encode ...
func (*ApplicationStreamResponse) GetPacketType ¶
func (a *ApplicationStreamResponse) GetPacketType() int16
GetPacketType ...
func (*ApplicationStreamResponse) GetPayload ¶
func (a *ApplicationStreamResponse) GetPayload() []byte
GetPayload ...
func (*ApplicationStreamResponse) GetRequestID ¶
func (a *ApplicationStreamResponse) GetRequestID() int
GetRequestID ...
type ControlClientClose ¶
ControlClientClose ...
func NewControlClientClose ¶
func NewControlClientClose() *ControlClientClose
NewControlClientClose ...
func (*ControlClientClose) Encode ¶
func (c *ControlClientClose) Encode() ([]byte, error)
Encode ...
func (*ControlClientClose) GetPacketType ¶
func (c *ControlClientClose) GetPacketType() int16
GetPacketType ...
func (*ControlClientClose) GetPayload ¶
func (c *ControlClientClose) GetPayload() []byte
GetPayload ...
func (*ControlClientClose) GetRequestID ¶
func (c *ControlClientClose) GetRequestID() int
GetRequestID ...
type ControlHandShake ¶
ControlHandShake
func (*ControlHandShake) GetPacketType ¶
func (c *ControlHandShake) GetPacketType() int16
GetPacketType ...
func (*ControlHandShake) GetRequestID ¶
func (c *ControlHandShake) GetRequestID() int
GetRequestID ...
type ControlHandShakeResponse ¶
ControlHandShake
func NewControlHandShakeResponse ¶
func NewControlHandShakeResponse() *ControlHandShakeResponse
NewControlHandShake ...
func (*ControlHandShakeResponse) Encode ¶
func (c *ControlHandShakeResponse) Encode() ([]byte, error)
Encode ...
func (*ControlHandShakeResponse) GetPacketType ¶
func (c *ControlHandShakeResponse) GetPacketType() int16
GetPacketType ...
func (*ControlHandShakeResponse) GetPayload ¶
func (c *ControlHandShakeResponse) GetPayload() []byte
GetPayload ...
func (*ControlHandShakeResponse) GetRequestID ¶
func (c *ControlHandShakeResponse) GetRequestID() int
GetRequestID ...
type ControlPing ¶
type ControlPing struct { Type int16 PingID int StateVersion byte // contains filtered or unexported fields }
CONTROL_PING ControlPing ...
func NewControlPing ¶
func NewControlPing() *ControlPing
type ControlPingPayload ¶
type ControlPingPayload struct { Type int16 PingID int StateVersion byte // contains filtered or unexported fields }
CONTROL_PING_PAYLOAD ControlPingPayload ...
func NewControlPingPayload ¶
func NewControlPingPayload() *ControlPingPayload
func (*ControlPingPayload) Encode ¶
func (c *ControlPingPayload) Encode() ([]byte, error)
Encode ...
func (*ControlPingPayload) GetPacketType ¶
func (c *ControlPingPayload) GetPacketType() int16
GetPacketType ...
func (*ControlPingPayload) GetPayload ¶
func (c *ControlPingPayload) GetPayload() []byte
GetPayload ...
func (*ControlPingPayload) GetRequestID ¶
func (c *ControlPingPayload) GetRequestID() int
GetRequestID ...
type ControlPong ¶
type ControlPong struct {
Type int16
}
CONTROL_PONG ControlPong ...
func NewControlPong ¶
func NewControlPong() *ControlPong
type HandshakeResponseCode ¶
Source Files ¶
- application_request.go
- application_response.go
- application_send.go
- application_stream_close.go
- application_stream_create.go
- application_stream_create_fail.go
- application_stream_create_success.go
- application_stream_ping.go
- application_stream_pong.go
- application_stream_response.go
- control_client_close.go
- control_handshake.go
- control_handshake_response.go
- control_ping.go
- control_ping_payload.go
- control_pong.go
- packet.go