Documentation ¶
Index ¶
- Constants
- type Client
- type MsgLoginReq
- type MsgLoginRsp
- type MsgLogoutReq
- func (z *MsgLogoutReq) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *MsgLogoutReq) EncodeMsg(en *msgp.Writer) (err error)
- func (z *MsgLogoutReq) MarshalMsg(b []byte) (o []byte, err error)
- func (z *MsgLogoutReq) Msgsize() (s int)
- func (z *MsgLogoutReq) UnmarshalMsg(bts []byte) (o []byte, err error)
- type MsgLogoutRsp
- type MsgSubscribeBatch
- func (b *MsgSubscribeBatch) Clone() MsgSubscribeBatch
- func (b *MsgSubscribeBatch) CombineWith(other *MsgSubscribeBatch)
- func (z *MsgSubscribeBatch) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *MsgSubscribeBatch) EncodeMsg(en *msgp.Writer) (err error)
- func (z *MsgSubscribeBatch) MarshalMsg(b []byte) (o []byte, err error)
- func (z *MsgSubscribeBatch) Msgsize() (s int)
- func (z *MsgSubscribeBatch) UnmarshalMsg(bts []byte) (o []byte, err error)
- type MsgSubscribeData
- func (z *MsgSubscribeData) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *MsgSubscribeData) EncodeMsg(en *msgp.Writer) (err error)
- func (z *MsgSubscribeData) MarshalMsg(b []byte) (o []byte, err error)
- func (z *MsgSubscribeData) Msgsize() (s int)
- func (z *MsgSubscribeData) UnmarshalMsg(bts []byte) (o []byte, err error)
- type MsgSubscribeReq
- func (z *MsgSubscribeReq) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *MsgSubscribeReq) EncodeMsg(en *msgp.Writer) (err error)
- func (z *MsgSubscribeReq) MarshalMsg(b []byte) (o []byte, err error)
- func (z *MsgSubscribeReq) Msgsize() (s int)
- func (z *MsgSubscribeReq) UnmarshalMsg(bts []byte) (o []byte, err error)
- type MsgSubscribeRoom
- func (z *MsgSubscribeRoom) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *MsgSubscribeRoom) EncodeMsg(en *msgp.Writer) (err error)
- func (z *MsgSubscribeRoom) MarshalMsg(b []byte) (o []byte, err error)
- func (z *MsgSubscribeRoom) Msgsize() (s int)
- func (z *MsgSubscribeRoom) UnmarshalMsg(bts []byte) (o []byte, err error)
- type MsgSubscribeRsp
- func (z *MsgSubscribeRsp) DecodeMsg(dc *msgp.Reader) (err error)
- func (z MsgSubscribeRsp) EncodeMsg(en *msgp.Writer) (err error)
- func (z MsgSubscribeRsp) MarshalMsg(b []byte) (o []byte, err error)
- func (z MsgSubscribeRsp) Msgsize() (s int)
- func (z *MsgSubscribeRsp) UnmarshalMsg(bts []byte) (o []byte, err error)
Constants ¶
const ( MSG_TYPE_DATA = 0 MSG_TYPE_WS_CONNECT = 1 MSG_TYPE_WS_DISCONNECT = 2 MSG_TYPE_ROOM_CONN_FAIL = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewBRelayClient ¶
func (*Client) ReadMessages ¶
func (c *Client) ReadMessages(ctx *toyframe.Context) ([]MsgSubscribeData, error)
func (*Client) Subscribe ¶
func (c *Client) Subscribe(rooms []MsgSubscribeRoom) error
type MsgLoginReq ¶
type MsgLoginReq struct {
ID string `msg:"id"`
}
func (*MsgLoginReq) DecodeMsg ¶
func (z *MsgLoginReq) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (MsgLoginReq) EncodeMsg ¶
func (z MsgLoginReq) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (MsgLoginReq) MarshalMsg ¶
func (z MsgLoginReq) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (MsgLoginReq) Msgsize ¶
func (z MsgLoginReq) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgLoginReq) UnmarshalMsg ¶
func (z *MsgLoginReq) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgLoginRsp ¶
func (*MsgLoginRsp) DecodeMsg ¶
func (z *MsgLoginRsp) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*MsgLoginRsp) EncodeMsg ¶
func (z *MsgLoginRsp) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*MsgLoginRsp) MarshalMsg ¶
func (z *MsgLoginRsp) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*MsgLoginRsp) Msgsize ¶
func (z *MsgLoginRsp) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgLoginRsp) UnmarshalMsg ¶
func (z *MsgLoginRsp) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgLogoutReq ¶
func (*MsgLogoutReq) DecodeMsg ¶
func (z *MsgLogoutReq) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*MsgLogoutReq) EncodeMsg ¶
func (z *MsgLogoutReq) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*MsgLogoutReq) MarshalMsg ¶
func (z *MsgLogoutReq) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*MsgLogoutReq) Msgsize ¶
func (z *MsgLogoutReq) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgLogoutReq) UnmarshalMsg ¶
func (z *MsgLogoutReq) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgLogoutRsp ¶
func (*MsgLogoutRsp) DecodeMsg ¶
func (z *MsgLogoutRsp) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (MsgLogoutRsp) EncodeMsg ¶
func (z MsgLogoutRsp) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (MsgLogoutRsp) MarshalMsg ¶
func (z MsgLogoutRsp) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (MsgLogoutRsp) Msgsize ¶
func (z MsgLogoutRsp) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgLogoutRsp) UnmarshalMsg ¶
func (z *MsgLogoutRsp) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgSubscribeBatch ¶
type MsgSubscribeBatch struct {
Msgs []MsgSubscribeData `msg:"msgs"`
}
func (*MsgSubscribeBatch) Clone ¶
func (b *MsgSubscribeBatch) Clone() MsgSubscribeBatch
func (*MsgSubscribeBatch) CombineWith ¶
func (b *MsgSubscribeBatch) CombineWith(other *MsgSubscribeBatch)
func (*MsgSubscribeBatch) DecodeMsg ¶
func (z *MsgSubscribeBatch) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*MsgSubscribeBatch) EncodeMsg ¶
func (z *MsgSubscribeBatch) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*MsgSubscribeBatch) MarshalMsg ¶
func (z *MsgSubscribeBatch) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*MsgSubscribeBatch) Msgsize ¶
func (z *MsgSubscribeBatch) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgSubscribeBatch) UnmarshalMsg ¶
func (z *MsgSubscribeBatch) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgSubscribeData ¶
type MsgSubscribeData struct { RoomID int `msg:"room"` MsgType byte `msg:"type"` Cmd string `msg:"cmd"` Data []byte `msg:"data"` }
func (*MsgSubscribeData) DecodeMsg ¶
func (z *MsgSubscribeData) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*MsgSubscribeData) EncodeMsg ¶
func (z *MsgSubscribeData) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*MsgSubscribeData) MarshalMsg ¶
func (z *MsgSubscribeData) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*MsgSubscribeData) Msgsize ¶
func (z *MsgSubscribeData) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgSubscribeData) UnmarshalMsg ¶
func (z *MsgSubscribeData) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgSubscribeReq ¶
type MsgSubscribeReq struct { SubscriberID uint32 `msg:"sid"` SubscriberSecret []byte `msg:"sec"` Rooms []MsgSubscribeRoom `msg:"rooms"` }
func (*MsgSubscribeReq) DecodeMsg ¶
func (z *MsgSubscribeReq) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*MsgSubscribeReq) EncodeMsg ¶
func (z *MsgSubscribeReq) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*MsgSubscribeReq) MarshalMsg ¶
func (z *MsgSubscribeReq) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*MsgSubscribeReq) Msgsize ¶
func (z *MsgSubscribeReq) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgSubscribeReq) UnmarshalMsg ¶
func (z *MsgSubscribeReq) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgSubscribeRoom ¶
func (*MsgSubscribeRoom) DecodeMsg ¶
func (z *MsgSubscribeRoom) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*MsgSubscribeRoom) EncodeMsg ¶
func (z *MsgSubscribeRoom) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*MsgSubscribeRoom) MarshalMsg ¶
func (z *MsgSubscribeRoom) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*MsgSubscribeRoom) Msgsize ¶
func (z *MsgSubscribeRoom) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgSubscribeRoom) UnmarshalMsg ¶
func (z *MsgSubscribeRoom) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MsgSubscribeRsp ¶
func (*MsgSubscribeRsp) DecodeMsg ¶
func (z *MsgSubscribeRsp) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (MsgSubscribeRsp) EncodeMsg ¶
func (z MsgSubscribeRsp) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (MsgSubscribeRsp) MarshalMsg ¶
func (z MsgSubscribeRsp) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (MsgSubscribeRsp) Msgsize ¶
func (z MsgSubscribeRsp) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*MsgSubscribeRsp) UnmarshalMsg ¶
func (z *MsgSubscribeRsp) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler