model

package
v0.0.0-...-83adff0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

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

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

func DecodeRoomKey(key string) (string, string, error)

DecodeRoomKey decode room key.

func EncodeRoomKey

func EncodeRoomKey(business string, room string) string

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) Descriptor() ([]byte, []int)

func (*Proto) GetBody

func (m *Proto) GetBody() []byte

func (*Proto) GetCompress

func (m *Proto) GetCompress() int32

func (*Proto) GetContentType

func (m *Proto) GetContentType() int32

func (*Proto) GetOperation

func (m *Proto) GetOperation() int32

func (*Proto) GetSeqId

func (m *Proto) GetSeqId() int32

func (*Proto) GetVer

func (m *Proto) GetVer() int32

func (*Proto) Marshal

func (m *Proto) Marshal() (dAtA []byte, err error)

func (*Proto) MarshalTo

func (m *Proto) MarshalTo(dAtA []byte) (int, error)

func (*Proto) ProtoMessage

func (*Proto) ProtoMessage()

func (*Proto) ReadTCP

func (p *Proto) ReadTCP(rr *bufio.Reader) (err error)

ReadTCP read a proto from TCP reader.

func (*Proto) ReadTCPV1

func (p *Proto) ReadTCPV1(rr *bufio.Reader) (err error)

ReadTCPV1 .

func (*Proto) ReadWebsocket

func (p *Proto) ReadWebsocket(ws *websocket.Conn) (err error)

ReadWebsocket read a proto from websocket connection.

func (*Proto) ReadWebsocketV1

func (p *Proto) ReadWebsocketV1(ws *websocket.Conn) (err error)

ReadWebsocketV1 .

func (*Proto) Reset

func (m *Proto) Reset()

func (*Proto) Size

func (m *Proto) Size() (n int)

func (*Proto) String

func (m *Proto) String() string

func (*Proto) Unmarshal

func (m *Proto) Unmarshal(dAtA []byte) error

func (*Proto) WriteTCP

func (p *Proto) WriteTCP(wr *bufio.Writer) (err error)

WriteTCP write a proto to TCP writer.

func (*Proto) WriteTCPHeart

func (p *Proto) WriteTCPHeart(wr *bufio.Writer) (err error)

WriteTCPHeart write a heartbeat proto to TCP writer.

func (*Proto) WriteTCPHeartV1

func (p *Proto) WriteTCPHeartV1(wr *bufio.Writer, online int32) (err error)

WriteTCPHeartV1 .

func (*Proto) WriteTCPV1

func (p *Proto) WriteTCPV1(wr *bufio.Writer) (err error)

WriteTCPV1 .

func (*Proto) WriteTo

func (p *Proto) WriteTo(b *bytes.Writer)

WriteTo write a proto to bytes writer.

func (*Proto) WriteToV1

func (p *Proto) WriteToV1(b *bytes.Writer)

WriteToV1 .

func (*Proto) WriteWebsocket

func (p *Proto) WriteWebsocket(ws *websocket.Conn) (err error)

WriteWebsocket write a proto to websocket connection.

func (*Proto) WriteWebsocketHeart

func (p *Proto) WriteWebsocketHeart(wr *websocket.Conn) (err error)

WriteWebsocketHeart write a heartbeat proto to websocket connnection.

func (*Proto) WriteWebsocketHeartV1

func (p *Proto) WriteWebsocketHeartV1(wr *websocket.Conn, online int32) (err error)

WriteWebsocketHeartV1 .

func (*Proto) WriteWebsocketV1

func (p *Proto) WriteWebsocketV1(ws *websocket.Conn) (err error)

WriteWebsocketV1 .

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.

type Top

type Top struct {
	RoomID string `json:"room_id"`
	Count  int32  `json:"count"`
}

Top top sorted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL