Documentation ¶
Index ¶
- Constants
- Variables
- type AllRoomCountReply
- type AllServerCountReply
- type BoardcastArg
- type BoardcastRoomArg
- type ClientGetSuccessMessageArg
- type ClientGetSuccessMessageArgReply
- type ClientIsTypeingArg
- type ClientIsTypeingArgReply
- type ClientRecalledOneArg
- type ClientRecalledOneArgReply
- type ClientRecalledOneSuccessArg
- type ClientRecalledOneSuccessArgReply
- type ClientResetPushNumberArg
- type ClientResetPushNumberArgReply
- type ConnArg
- type ConnReply
- type CountReply
- type DelArg
- type DelReply
- type DelServerArg
- type DeliverMessageArg
- type DeliverMessageReply
- type DisconnArg
- type DisconnReply
- type GetAllReply
- type GetArg
- type GetReply
- type HttpSpacialImMessageArgs
- type HttpSpacialImMessageReply
- type HttpSpacialMsgResetArgs
- type HttpSpacialMsgResetReply
- type KafkaMsg
- type MGetArg
- type MGetReply
- type MPushMsgArg
- type MPushMsgReply
- type MPushMsgsArg
- type MPushMsgsReply
- type NoArg
- type NoReply
- type Proto
- func (p *Proto) ReadTCP(rr *bufio.Reader) (err error)
- func (p *Proto) ReadWebsocket(wr *websocket.Conn) (err error)
- func (p *Proto) Reset()
- func (p *Proto) String() string
- func (p *Proto) WriteBodyTo(b *bytes.Writer) (err error)
- func (p *Proto) WriteTCP(wr *bufio.Writer) (err error)
- func (p *Proto) WriteTo(b *bytes.Writer)
- func (p *Proto) WriteWebsocket(wr *websocket.Conn) (err error)
- type ProtoEn
- type PushMsgArg
- type PushMsgsArg
- type PushMsgsReply
- type PushOfflineMessageArg
- type PushOfflineMessageReply
- type PutArg
- type PutReply
- type RoomCountArg
- type RoomCountReply
- type RoomsReply
- type UserCountArg
- type UserCountReply
Constants ¶
View Source
const ( // size PackSize = 4 HeaderSize = 2 VerSize = 2 OperationSize = 4 SeqIdSize = 4 RawHeaderSize = PackSize + HeaderSize + VerSize + OperationSize + SeqIdSize MaxPackSize = MaxBodySize + int32(RawHeaderSize) // offset PackOffset = 0 HeaderOffset = PackOffset + PackSize VerOffset = HeaderOffset + HeaderSize OperationOffset = VerOffset + VerSize SeqIdOffset = OperationOffset + OperationSize )
View Source
const (
MaxBodySize = int32(1 << 10)
)
for tcp
Variables ¶
View Source
var ( ErrProtoPackLen = errors.New("default server codec pack length error") ErrProtoHeaderLen = errors.New("default server codec header length error") )
View Source
var ( ProtoReady = &Proto{Operation: define.OP_PROTO_READY} ProtoFinish = &Proto{Operation: define.OP_PROTO_FINISH} )
Functions ¶
This section is empty.
Types ¶
type AllRoomCountReply ¶
type AllServerCountReply ¶
type BoardcastArg ¶
type BoardcastArg struct {
P Proto
}
type BoardcastRoomArg ¶
type ClientGetSuccessMessageArg ¶
type ClientGetSuccessMessageArg struct {
GetMsgSuccessInfo string
}
type ClientIsTypeingArg ¶
type ClientIsTypeingArg struct {
IsTypeingInfo string
}
type ClientIsTypeingArgReply ¶
type ClientIsTypeingArgReply struct {
ErrorString string
}
type ClientRecalledOneArg ¶
type ClientRecalledOneArg struct {
RecalledOneInfo string
}
type ClientRecalledOneArgReply ¶
type ClientRecalledOneArgReply struct {
ErrorString string
}
type ClientRecalledOneSuccessArg ¶
type ClientRecalledOneSuccessArg struct {
RecalledOneSuccessInfo string
}
type ClientRecalledOneSuccessArgReply ¶
type ClientRecalledOneSuccessArgReply struct {
ErrorString string
}
type ClientResetPushNumberArg ¶
type ClientResetPushNumberArg struct {
ResetPushNumberInfo string
}
type ClientResetPushNumberArgReply ¶
type ClientResetPushNumberArgReply struct {
ErrorString string
}
type CountReply ¶
type CountReply struct {
Count int32
}
type DelServerArg ¶
type DelServerArg struct {
Server int32
}
type DeliverMessageArg ¶
type DeliverMessageReply ¶
type DisconnArg ¶
type DisconnReply ¶
type DisconnReply struct {
Has bool
}
type GetAllReply ¶
type HttpSpacialImMessageArgs ¶
****这个是http的私信调用
type HttpSpacialImMessageReply ¶
type HttpSpacialImMessageReply struct {
ErrorString string
}
type HttpSpacialMsgResetArgs ¶
type HttpSpacialMsgResetArgs struct {
MsgResetInfo string
}
type HttpSpacialMsgResetReply ¶
type HttpSpacialMsgResetReply struct {
ErrorString string
}
type KafkaMsg ¶
type KafkaMsg struct { OP string `json:"op"` RoomId int32 `json:"roomid,omitempty"` ServerId int32 `json:"server,omitempty"` SubKeys []string `json:"subkeys,omitempty"` Msg []byte `json:"msg"` Ensure bool `json:"ensure,omitempty"` }
TODO optimize struct after replace kafka
type MPushMsgArg ¶
type MPushMsgReply ¶
type MPushMsgReply struct {
Index int32
}
type MPushMsgsArg ¶
type MPushMsgsArg struct {
PMArgs []*PushMsgArg
}
type MPushMsgsReply ¶
type MPushMsgsReply struct {
Index int32
}
type Proto ¶
type Proto struct { Ver int16 `json:"ver"` // protocol version Operation int32 `json:"op"` // operation for request SeqId int32 `json:"seq"` // sequence number chosen by client Body json.RawMessage `json:"body"` // binary body bytes(json.RawMessage is []byte) }
type ProtoEn ¶
type ProtoEn struct {
JsonBody string
}
Proto is a request&response written before every goim connect. It is used internally but documented here as an aid to debugging, such as when analyzing network traffic. tcp: binary codec websocket & http: raw codec, with http header stored ver, operation, seqid
type PushMsgArg ¶
type PushMsgsArg ¶
type PushMsgsArg struct { Key string PMArgs []*PushMsgArg }
type PushMsgsReply ¶
type PushMsgsReply struct {
Index int32
}
type PushOfflineMessageArg ¶
type PushOfflineMessageArg struct {
PushInfo string
}
type PushOfflineMessageReply ¶
type RoomCountArg ¶
type RoomCountArg struct {
RoomId int32
}
type RoomCountReply ¶
type RoomCountReply struct {
Count int32
}
type RoomsReply ¶
type RoomsReply struct {
RoomIds map[int32]struct{}
}
type UserCountArg ¶
type UserCountArg struct {
UserId int64
}
type UserCountReply ¶
type UserCountReply struct {
Count int32
}
Click to show internal directories.
Click to hide internal directories.