75 lines
1.4 KiB
Protocol Buffer
75 lines
1.4 KiB
Protocol Buffer
// protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
|
|
syntax = "proto3";
|
|
|
|
package imparse.v1;
|
|
option go_package = "gitlab.33.cn/chat/imparse/proto";
|
|
|
|
enum Channel {
|
|
ToUser = 0;
|
|
ToGroup = 1;
|
|
}
|
|
|
|
// common msg define
|
|
enum MsgType {
|
|
System = 0;
|
|
Text = 1;
|
|
Audio = 2;
|
|
Image = 3;
|
|
Video = 4;
|
|
File = 5;
|
|
Card = 6;
|
|
Notice = 7;
|
|
Forward = 8;
|
|
RTCCall = 9;
|
|
Transfer = 10;
|
|
Collect = 11;
|
|
RedPacket = 12;
|
|
ContactCard = 13;
|
|
}
|
|
|
|
message Proto {
|
|
// event define
|
|
enum EventType {
|
|
common = 0;
|
|
commonAck = 1;
|
|
Signal = 2;
|
|
SYSNotice = 3;
|
|
}
|
|
EventType eventType = 1;
|
|
bytes body = 2;
|
|
}
|
|
|
|
message Common {
|
|
Channel channelType = 1;
|
|
int64 mid = 2;
|
|
string seq = 3;
|
|
string from = 4;
|
|
string target = 5;
|
|
MsgType msgType = 6;
|
|
bytes msg = 7;
|
|
uint64 datetime = 8;
|
|
Source source = 9;
|
|
Reference reference = 10;
|
|
}
|
|
|
|
message Source {
|
|
Channel channelType = 1;
|
|
SourceUser from = 2;
|
|
SourceUser target = 3;
|
|
}
|
|
|
|
message SourceUser {
|
|
string id = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message CommonAck {
|
|
int64 mid = 2;
|
|
uint64 datetime = 8;
|
|
}
|
|
|
|
message Reference {
|
|
int64 topic = 1;
|
|
int64 ref = 2;
|
|
}
|