Documentation
¶
Overview ¶
Package model is a generated protocol buffer package.
It is generated from these files:
app/service/main/broadcast/model/model.proto
It has these top-level messages:
Proto
Index ¶
- Constants
- Variables
- func DecodeRoomKey(key string) (string, string, error)
- func EncodeRoomKey(business string, room string) string
- type AuthToken
- type Online
- type Proto
- func (*Proto) Descriptor() ([]byte, []int)
- func (m *Proto) GetBody() []byte
- func (m *Proto) GetCompress() int32
- func (m *Proto) GetContentType() int32
- func (m *Proto) GetOperation() int32
- func (m *Proto) GetSeqId() int32
- func (m *Proto) GetVer() int32
- func (m *Proto) Marshal() (dAtA []byte, err error)
- func (m *Proto) MarshalTo(dAtA []byte) (int, error)
- func (*Proto) ProtoMessage()
- func (p *Proto) ReadTCP(rr *bufio.Reader) (err error)
- func (p *Proto) ReadTCPV1(rr *bufio.Reader) (err error)
- func (p *Proto) ReadWebsocket(ws *websocket.Conn) (err error)
- func (p *Proto) ReadWebsocketV1(ws *websocket.Conn) (err error)
- func (m *Proto) Reset()
- func (m *Proto) Size() (n int)
- func (m *Proto) String() string
- func (m *Proto) Unmarshal(dAtA []byte) error
- func (p *Proto) WriteTCP(wr *bufio.Writer) (err error)
- func (p *Proto) WriteTCPHeart(wr *bufio.Writer) (err error)
- func (p *Proto) WriteTCPHeartV1(wr *bufio.Writer, online int32) (err error)
- func (p *Proto) WriteTCPV1(wr *bufio.Writer) (err error)
- func (p *Proto) WriteTo(b *bytes.Writer)
- func (p *Proto) WriteToV1(b *bytes.Writer)
- func (p *Proto) WriteWebsocket(ws *websocket.Conn) (err error)
- func (p *Proto) WriteWebsocketHeart(wr *websocket.Conn) (err error)
- func (p *Proto) WriteWebsocketHeartV1(wr *websocket.Conn, online int32) (err error)
- func (p *Proto) WriteWebsocketV1(ws *websocket.Conn) (err error)
- type ServerInfo
- type Top
Constants ¶
View Source
const ( // OpHandshake handshake OpHandshake = int32(0) // OpHandshakeReply handshake reply OpHandshakeReply = int32(1) // OpHeartbeat heartbeat OpHeartbeat = int32(2) // OpHeartbeatReply heartbeat reply OpHeartbeatReply = int32(3) // OpSendMsg send message. OpSendMsg = int32(4) // OpSendMsgReply send message reply OpSendMsgReply = int32(5) // OpDisconnectReply disconnect reply OpDisconnectReply = int32(6) // OpAuth auth connnect OpAuth = int32(7) // OpAuthReply auth connect reply OpAuthReply = int32(8) // OpRaw raw message OpRaw = int32(9) // OpProtoReady proto ready OpProtoReady = int32(10) // OpProtoFinish proto finish OpProtoFinish = int32(11) // OpChangeRoom change room OpChangeRoom = int32(12) // OpChangeRoomReply change room reply OpChangeRoomReply = int32(13) // OpRegister register operation OpRegister = int32(14) // OpRegisterReply register operation OpRegisterReply = int32(15) // OpUnregister unregister operation OpUnregister = int32(16) // OpUnregisterReply unregister operation reply OpUnregisterReply = int32(17) // MinBusinessOp min business operation MinBusinessOp = 1000 // MaxBusinessOp max business operation MaxBusinessOp = 10000 )
View Source
const ( // MaxBodySize max proto body size MaxBodySize = int32(1 << 12) )
View Source
const (
// NoRoom default no room key
NoRoom = "noroom"
)
Variables ¶
View Source
var ( // ErrProtoPackLen proto packet len error ErrProtoPackLen = errors.New("default server codec pack length error") // ErrProtoHeaderLen proto header len error ErrProtoHeaderLen = errors.New("default server codec header length error") )
View Source
var ( // ProtoReady proto ready ProtoReady = &Proto{Operation: OpProtoReady} // ProtoFinish proto finish ProtoFinish = &Proto{Operation: OpProtoFinish} )
View Source
var ( ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") )
Functions ¶
func DecodeRoomKey ¶
DecodeRoomKey decode room key.
func EncodeRoomKey ¶
EncodeRoomKey encode a room key.
Types ¶
type AuthToken ¶
type AuthToken struct { DeviceID string `json:"device_id"` // 客户端唯一key RoomID string `json:"room_id"` // 业务房间号 AccessKey string `json:"access_key"` // access key用来获取mid Platform string `json:"platform"` // 平台, android/ios/h5/web MobiApp string `json:"mobi_app"` // mobi_app Build int32 `json:"build"` // build Accepts []int32 `json:"accepts"` // accept operations // 兼容goim-chat Aid int64 `json:"aid"` Cid int64 `json:"roomid"` }
AuthToken auth token.
type Online ¶
type Online struct { Server string `json:"server"` RoomCount map[string]int32 `json:"room_count"` Updated int64 `json:"updated"` }
Online ip and room online.
type Proto ¶
type Proto struct { Ver int32 `protobuf:"varint,1,opt,name=ver,proto3" json:"ver,omitempty"` Operation int32 `protobuf:"varint,2,opt,name=operation,proto3" json:"operation,omitempty"` SeqId int32 `protobuf:"varint,3,opt,name=seqId,proto3" json:"seqId,omitempty"` Compress int32 `protobuf:"varint,4,opt,name=compress,proto3" json:"compress,omitempty"` ContentType int32 `protobuf:"varint,5,opt,name=contentType,proto3" json:"contentType,omitempty"` Body []byte `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"` }
func (*Proto) Descriptor ¶
func (*Proto) GetCompress ¶
func (*Proto) GetContentType ¶
func (*Proto) GetOperation ¶
func (*Proto) ProtoMessage ¶
func (*Proto) ProtoMessage()
func (*Proto) ReadWebsocket ¶
ReadWebsocket read a proto from websocket connection.
func (*Proto) ReadWebsocketV1 ¶
ReadWebsocketV1 .
func (*Proto) WriteTCPHeart ¶
WriteTCPHeart write a heartbeat proto to TCP writer.
func (*Proto) WriteTCPHeartV1 ¶
WriteTCPHeartV1 .
func (*Proto) WriteWebsocket ¶
WriteWebsocket write a proto to websocket connection.
func (*Proto) WriteWebsocketHeart ¶
WriteWebsocketHeart write a heartbeat proto to websocket connnection.
func (*Proto) WriteWebsocketHeartV1 ¶
WriteWebsocketHeartV1 .
type ServerInfo ¶
type ServerInfo struct { Region string `json:"region"` Server string `json:"server"` IPCount int32 `json:"ip_count"` ConnCount int32 `json:"conn_count"` RoomIPCount int32 `json:"room_ips"` Weight int32 `json:"weight"` Updated int64 `json:"updated"` IPAddrs []string `json:"ip_addrs"` IPAddrsV6 []string `json:"ip_addrs_v6"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Overseas bool `json:"overseas"` }
ServerInfo server info.
Click to show internal directories.
Click to hide internal directories.