init
This commit is contained in:
218
proto/auth.pb.go
Normal file
218
proto/auth.pb.go
Normal file
@@ -0,0 +1,218 @@
|
||||
// protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.19.1
|
||||
// source: auth.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Device int32
|
||||
|
||||
const (
|
||||
Device_Android Device = 0
|
||||
Device_IOS Device = 1
|
||||
)
|
||||
|
||||
// Enum value maps for Device.
|
||||
var (
|
||||
Device_name = map[int32]string{
|
||||
0: "Android",
|
||||
1: "IOS",
|
||||
}
|
||||
Device_value = map[string]int32{
|
||||
"Android": 0,
|
||||
"IOS": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Device) Enum() *Device {
|
||||
p := new(Device)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Device) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Device) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_auth_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (Device) Type() protoreflect.EnumType {
|
||||
return &file_auth_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x Device) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Device.Descriptor instead.
|
||||
func (Device) EnumDescriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type Login struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Device Device `protobuf:"varint,1,opt,name=device,proto3,enum=imparse.auth.Device" json:"device,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
DeviceToken string `protobuf:"bytes,3,opt,name=deviceToken,proto3" json:"deviceToken,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Login) Reset() {
|
||||
*x = Login{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Login) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Login) ProtoMessage() {}
|
||||
|
||||
func (x *Login) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Login.ProtoReflect.Descriptor instead.
|
||||
func (*Login) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Login) GetDevice() Device {
|
||||
if x != nil {
|
||||
return x.Device
|
||||
}
|
||||
return Device_Android
|
||||
}
|
||||
|
||||
func (x *Login) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Login) GetDeviceToken() string {
|
||||
if x != nil {
|
||||
return x.DeviceToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_auth_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x69, 0x6d,
|
||||
0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x22, 0x73, 0x0a, 0x05, 0x4c, 0x6f,
|
||||
0x67, 0x69, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x61, 0x75,
|
||||
0x74, 0x68, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a,
|
||||
0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2a,
|
||||
0x1e, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x6e, 0x64,
|
||||
0x72, 0x6f, 0x69, 0x64, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4f, 0x53, 0x10, 0x01, 0x42,
|
||||
0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x33, 0x33, 0x2e, 0x63, 0x6e, 0x2f,
|
||||
0x63, 0x68, 0x61, 0x74, 0x2f, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_auth_proto_rawDescOnce sync.Once
|
||||
file_auth_proto_rawDescData = file_auth_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_auth_proto_rawDescGZIP() []byte {
|
||||
file_auth_proto_rawDescOnce.Do(func() {
|
||||
file_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_auth_proto_rawDescData)
|
||||
})
|
||||
return file_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_auth_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_auth_proto_goTypes = []interface{}{
|
||||
(Device)(0), // 0: imparse.auth.Device
|
||||
(*Login)(nil), // 1: imparse.auth.Login
|
||||
}
|
||||
var file_auth_proto_depIdxs = []int32{
|
||||
0, // 0: imparse.auth.Login.device:type_name -> imparse.auth.Device
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_auth_proto_init() }
|
||||
func file_auth_proto_init() {
|
||||
if File_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Login); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_auth_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_auth_proto_goTypes,
|
||||
DependencyIndexes: file_auth_proto_depIdxs,
|
||||
EnumInfos: file_auth_proto_enumTypes,
|
||||
MessageInfos: file_auth_proto_msgTypes,
|
||||
}.Build()
|
||||
File_auth_proto = out.File
|
||||
file_auth_proto_rawDesc = nil
|
||||
file_auth_proto_goTypes = nil
|
||||
file_auth_proto_depIdxs = nil
|
||||
}
|
||||
16
proto/auth.proto
Normal file
16
proto/auth.proto
Normal file
@@ -0,0 +1,16 @@
|
||||
// protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
|
||||
syntax = "proto3";
|
||||
|
||||
package imparse.auth;
|
||||
option go_package = "gitlab.33.cn/chat/imparse/proto";
|
||||
|
||||
enum Device {
|
||||
Android = 0;
|
||||
IOS = 1;
|
||||
}
|
||||
|
||||
message Login {
|
||||
Device device = 1;
|
||||
string username = 2;
|
||||
string deviceToken = 3;
|
||||
}
|
||||
12
proto/create.sh
Normal file
12
proto/create.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
#protoc --proto_path=$GOPATH/src:. \
|
||||
# --go_out=. --go_opt=paths=source_relative \
|
||||
# --go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||
# api.proto
|
||||
|
||||
#protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
|
||||
|
||||
protoc --go_out=. --go_opt=paths=source_relative \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||
*.proto
|
||||
2003
proto/msg.pb.go
Normal file
2003
proto/msg.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
154
proto/msg.proto
Normal file
154
proto/msg.proto
Normal file
@@ -0,0 +1,154 @@
|
||||
// protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
|
||||
syntax = "proto3";
|
||||
|
||||
package imparse.msg;
|
||||
option go_package = "gitlab.33.cn/chat/imparse/proto";
|
||||
|
||||
import "signal.proto";
|
||||
|
||||
message EncryptMsg {
|
||||
string content = 1;
|
||||
}
|
||||
|
||||
message TextMsg {
|
||||
string content = 1;
|
||||
repeated string mention = 2;
|
||||
}
|
||||
|
||||
message AudioMsg {
|
||||
string mediaUrl = 1;
|
||||
int32 time = 2;
|
||||
}
|
||||
|
||||
message ImageMsg {
|
||||
string mediaUrl = 1;
|
||||
int32 height = 2;
|
||||
int32 width = 3;
|
||||
}
|
||||
|
||||
message VideoMsg {
|
||||
string mediaUrl = 1;
|
||||
int32 time = 2;
|
||||
int32 height = 3;
|
||||
int32 width = 4;
|
||||
}
|
||||
|
||||
message FileMsg {
|
||||
string mediaUrl = 1;
|
||||
string name = 2;
|
||||
string md5 = 3;
|
||||
int64 size = 4;
|
||||
}
|
||||
|
||||
message CardMsg {
|
||||
string bank = 1;
|
||||
string name = 2;
|
||||
string account = 3;
|
||||
}
|
||||
|
||||
message NoticeMsg {
|
||||
NoticeMsgType type = 1;
|
||||
bytes body = 2;
|
||||
}
|
||||
|
||||
message ForwardItem {
|
||||
string avatar = 1;
|
||||
string name = 2;
|
||||
int32 msgType = 3;
|
||||
bytes msg = 4;
|
||||
uint64 datetime = 5;
|
||||
}
|
||||
|
||||
message ForwardMsg {
|
||||
repeated ForwardItem items = 1;
|
||||
}
|
||||
|
||||
message TransferMsg {
|
||||
string txHash = 1;
|
||||
string coinName = 2;
|
||||
}
|
||||
|
||||
message RedPacketMsg {
|
||||
string txHash = 1;
|
||||
string coinName = 2;
|
||||
string exec = 3; //执行器名称 user.p.
|
||||
enum RPType {
|
||||
RandomAmount = 0;
|
||||
IdenticalAmount = 1;
|
||||
}
|
||||
RPType packetType = 4;
|
||||
string privateKey = 5; //客户端创建的私钥(选填)
|
||||
string remark = 6;
|
||||
uint64 expire = 7; //到期时间 单位:ms时间戳
|
||||
}
|
||||
|
||||
message ContactCardMsg {
|
||||
enum CardType {
|
||||
Undefined = 0;
|
||||
Personal = 1;
|
||||
}
|
||||
CardType type = 1;
|
||||
string id = 2;
|
||||
string name = 3;
|
||||
string avatar = 4;
|
||||
string server = 5;
|
||||
string inviter = 6;
|
||||
}
|
||||
|
||||
//notice msg define
|
||||
enum NoticeMsgType {
|
||||
UpdateGroupNameNoticeMsg = 0;
|
||||
SignInGroupNoticeMsg = 1;
|
||||
SignOutGroupNoticeMsg = 2;
|
||||
KickOutGroupNoticeMsg = 3;
|
||||
DeleteGroupNoticeMsg = 4;
|
||||
UpdateGroupMutedNoticeMsg = 5;
|
||||
UpdateGroupMemberMutedNoticeMsg = 6;
|
||||
UpdateGroupOwnerNoticeMsg = 7;
|
||||
MsgRevoked = 8; //撤回消息通知,客户端占用
|
||||
}
|
||||
|
||||
message NoticeMsgUpdateGroupName {
|
||||
int64 group = 1;
|
||||
string operator = 2;
|
||||
string name = 3;
|
||||
}
|
||||
|
||||
message NoticeMsgSignInGroup {
|
||||
int64 group = 1;
|
||||
string inviter = 2;
|
||||
repeated string members = 3;
|
||||
}
|
||||
|
||||
message NoticeMsgSignOutGroup {
|
||||
int64 group = 1;
|
||||
string operator = 2;
|
||||
}
|
||||
|
||||
message NoticeMsgKickOutGroup {
|
||||
int64 group = 1;
|
||||
string operator = 2;
|
||||
repeated string members = 3;
|
||||
}
|
||||
|
||||
message NoticeMsgDeleteGroup {
|
||||
int64 group = 1;
|
||||
string operator = 2;
|
||||
}
|
||||
|
||||
message NoticeMsgUpdateGroupMuted {
|
||||
int64 group = 1;
|
||||
string operator = 2;
|
||||
imparse.signal.MuteType type = 3;
|
||||
}
|
||||
|
||||
message NoticeMsgUpdateGroupMemberMutedTime {
|
||||
int64 group = 1;
|
||||
string operator = 2;
|
||||
repeated string members = 3;
|
||||
}
|
||||
|
||||
message NoticeMsgUpdateGroupOwner {
|
||||
int64 group = 1;
|
||||
string newOwner = 2;
|
||||
}
|
||||
1859
proto/signal.pb.go
Normal file
1859
proto/signal.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
158
proto/signal.proto
Normal file
158
proto/signal.proto
Normal file
@@ -0,0 +1,158 @@
|
||||
// protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
|
||||
syntax = "proto3";
|
||||
|
||||
package imparse.signal;
|
||||
option go_package = "gitlab.33.cn/chat/imparse/proto";
|
||||
|
||||
//alert msg define
|
||||
message Signal {
|
||||
SignalType type = 1;
|
||||
bytes body = 2;
|
||||
}
|
||||
|
||||
enum SignalType {
|
||||
Received = 0;
|
||||
Revoke = 1;
|
||||
SignInGroup = 10;
|
||||
SignOutGroup = 11;
|
||||
DeleteGroup = 12;
|
||||
FocusMessage = 13;
|
||||
//
|
||||
UpdateGroupJoinType = 20;
|
||||
UpdateGroupFriendType = 21;
|
||||
UpdateGroupMuteType = 22;
|
||||
UpdateGroupMemberType = 23;
|
||||
UpdateGroupMemberMuteTime = 24;
|
||||
UpdateGroupName = 25;
|
||||
UpdateGroupAvatar = 26;
|
||||
//
|
||||
StartCall = 31;
|
||||
AcceptCall = 32;
|
||||
StopCall = 33;
|
||||
}
|
||||
|
||||
message SignalReceived {
|
||||
repeated int64 logs = 1;
|
||||
}
|
||||
|
||||
message SignalSignInGroup {
|
||||
repeated string uid = 1;
|
||||
int64 group = 2;
|
||||
uint64 time = 3;
|
||||
}
|
||||
|
||||
message SignalSignOutGroup {
|
||||
repeated string uid = 1;
|
||||
int64 group = 2;
|
||||
uint64 time = 3;
|
||||
}
|
||||
|
||||
message SignalDeleteGroup {
|
||||
int64 group = 1;
|
||||
uint64 time = 2;
|
||||
}
|
||||
|
||||
message SignalFocusMessage {
|
||||
int64 mid = 1;
|
||||
string uid = 2;
|
||||
int32 currentNum = 3;
|
||||
uint64 time = 4;
|
||||
}
|
||||
|
||||
enum JoinType {
|
||||
JoinAllow = 0;
|
||||
JoinDeny = 1;
|
||||
JoinApply = 2;
|
||||
}
|
||||
|
||||
message SignalUpdateGroupJoinType {
|
||||
int64 group = 1;
|
||||
JoinType type = 2;
|
||||
uint64 time = 3;
|
||||
}
|
||||
|
||||
enum FriendType {
|
||||
FriendAllow = 0;
|
||||
FriendDeny = 1;
|
||||
}
|
||||
|
||||
message SignalUpdateGroupFriendType {
|
||||
int64 group = 1;
|
||||
FriendType type = 2;
|
||||
uint64 time = 3;
|
||||
}
|
||||
|
||||
enum MuteType {
|
||||
MuteAllow = 0;
|
||||
MuteDeny = 1;
|
||||
}
|
||||
|
||||
message SignalUpdateGroupMuteType {
|
||||
int64 group = 1;
|
||||
MuteType type = 2;
|
||||
uint64 time = 3;
|
||||
}
|
||||
|
||||
enum MemberType {
|
||||
Normal = 0;
|
||||
Admin = 1;
|
||||
Owner = 2;
|
||||
}
|
||||
|
||||
message SignalUpdateGroupMemberType {
|
||||
int64 group = 1;
|
||||
string uid = 2;
|
||||
MemberType type = 3;
|
||||
uint64 time = 4;
|
||||
}
|
||||
|
||||
message SignalUpdateGroupMemberMuteTime {
|
||||
int64 group = 1;
|
||||
repeated string uid = 2;
|
||||
int64 muteTime = 3;
|
||||
uint64 time = 4;
|
||||
}
|
||||
|
||||
message SignalUpdateGroupName {
|
||||
int64 group = 1;
|
||||
string name = 2;
|
||||
uint64 time = 3;
|
||||
}
|
||||
|
||||
message SignalUpdateGroupAvatar {
|
||||
int64 group = 1;
|
||||
string avatar = 2;
|
||||
uint64 time = 3;
|
||||
}
|
||||
|
||||
message SignalStartCall {
|
||||
int64 trace_id = 1;
|
||||
}
|
||||
|
||||
message SignalAcceptCall {
|
||||
int64 trace_id = 1;
|
||||
int32 room_id = 2;
|
||||
string uid = 3;
|
||||
string user_sig = 4;
|
||||
string private_map_key = 5;
|
||||
int32 skd_app_id = 6;
|
||||
}
|
||||
|
||||
enum StopCallType {
|
||||
Busy = 0;
|
||||
Timeout = 1;
|
||||
Reject = 2;
|
||||
Hangup = 3;
|
||||
Cancel = 4;
|
||||
}
|
||||
|
||||
message SignalStopCall {
|
||||
int64 trace_id = 1;
|
||||
StopCallType reason = 2;
|
||||
}
|
||||
|
||||
message SignalRevoke {
|
||||
int64 mid = 1;
|
||||
string operator = 2;
|
||||
bool self = 3;
|
||||
}
|
||||
822
proto/v1.pb.go
Normal file
822
proto/v1.pb.go
Normal file
@@ -0,0 +1,822 @@
|
||||
// protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.19.1
|
||||
// source: v1.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Channel int32
|
||||
|
||||
const (
|
||||
Channel_ToUser Channel = 0
|
||||
Channel_ToGroup Channel = 1
|
||||
)
|
||||
|
||||
// Enum value maps for Channel.
|
||||
var (
|
||||
Channel_name = map[int32]string{
|
||||
0: "ToUser",
|
||||
1: "ToGroup",
|
||||
}
|
||||
Channel_value = map[string]int32{
|
||||
"ToUser": 0,
|
||||
"ToGroup": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Channel) Enum() *Channel {
|
||||
p := new(Channel)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Channel) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Channel) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_v1_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (Channel) Type() protoreflect.EnumType {
|
||||
return &file_v1_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x Channel) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Channel.Descriptor instead.
|
||||
func (Channel) EnumDescriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// common msg define
|
||||
type MsgType int32
|
||||
|
||||
const (
|
||||
MsgType_System MsgType = 0
|
||||
MsgType_Text MsgType = 1
|
||||
MsgType_Audio MsgType = 2
|
||||
MsgType_Image MsgType = 3
|
||||
MsgType_Video MsgType = 4
|
||||
MsgType_File MsgType = 5
|
||||
MsgType_Card MsgType = 6
|
||||
MsgType_Notice MsgType = 7
|
||||
MsgType_Forward MsgType = 8
|
||||
MsgType_RTCCall MsgType = 9
|
||||
MsgType_Transfer MsgType = 10
|
||||
MsgType_Collect MsgType = 11
|
||||
MsgType_RedPacket MsgType = 12
|
||||
MsgType_ContactCard MsgType = 13
|
||||
)
|
||||
|
||||
// Enum value maps for MsgType.
|
||||
var (
|
||||
MsgType_name = map[int32]string{
|
||||
0: "System",
|
||||
1: "Text",
|
||||
2: "Audio",
|
||||
3: "Image",
|
||||
4: "Video",
|
||||
5: "File",
|
||||
6: "Card",
|
||||
7: "Notice",
|
||||
8: "Forward",
|
||||
9: "RTCCall",
|
||||
10: "Transfer",
|
||||
11: "Collect",
|
||||
12: "RedPacket",
|
||||
13: "ContactCard",
|
||||
}
|
||||
MsgType_value = map[string]int32{
|
||||
"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,
|
||||
}
|
||||
)
|
||||
|
||||
func (x MsgType) Enum() *MsgType {
|
||||
p := new(MsgType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x MsgType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (MsgType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_v1_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (MsgType) Type() protoreflect.EnumType {
|
||||
return &file_v1_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x MsgType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use MsgType.Descriptor instead.
|
||||
func (MsgType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
// event define
|
||||
type Proto_EventType int32
|
||||
|
||||
const (
|
||||
Proto_common Proto_EventType = 0
|
||||
Proto_commonAck Proto_EventType = 1
|
||||
Proto_Signal Proto_EventType = 2
|
||||
Proto_SYSNotice Proto_EventType = 3
|
||||
)
|
||||
|
||||
// Enum value maps for Proto_EventType.
|
||||
var (
|
||||
Proto_EventType_name = map[int32]string{
|
||||
0: "common",
|
||||
1: "commonAck",
|
||||
2: "Signal",
|
||||
3: "SYSNotice",
|
||||
}
|
||||
Proto_EventType_value = map[string]int32{
|
||||
"common": 0,
|
||||
"commonAck": 1,
|
||||
"Signal": 2,
|
||||
"SYSNotice": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Proto_EventType) Enum() *Proto_EventType {
|
||||
p := new(Proto_EventType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Proto_EventType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Proto_EventType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_v1_proto_enumTypes[2].Descriptor()
|
||||
}
|
||||
|
||||
func (Proto_EventType) Type() protoreflect.EnumType {
|
||||
return &file_v1_proto_enumTypes[2]
|
||||
}
|
||||
|
||||
func (x Proto_EventType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Proto_EventType.Descriptor instead.
|
||||
func (Proto_EventType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
type Proto struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
EventType Proto_EventType `protobuf:"varint,1,opt,name=eventType,proto3,enum=imparse.v1.Proto_EventType" json:"eventType,omitempty"`
|
||||
Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Proto) Reset() {
|
||||
*x = Proto{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Proto) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Proto) ProtoMessage() {}
|
||||
|
||||
func (x *Proto) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Proto.ProtoReflect.Descriptor instead.
|
||||
func (*Proto) Descriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Proto) GetEventType() Proto_EventType {
|
||||
if x != nil {
|
||||
return x.EventType
|
||||
}
|
||||
return Proto_common
|
||||
}
|
||||
|
||||
func (x *Proto) GetBody() []byte {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Common struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ChannelType Channel `protobuf:"varint,1,opt,name=channelType,proto3,enum=imparse.v1.Channel" json:"channelType,omitempty"`
|
||||
Mid int64 `protobuf:"varint,2,opt,name=mid,proto3" json:"mid,omitempty"`
|
||||
Seq string `protobuf:"bytes,3,opt,name=seq,proto3" json:"seq,omitempty"`
|
||||
From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
|
||||
Target string `protobuf:"bytes,5,opt,name=target,proto3" json:"target,omitempty"`
|
||||
MsgType MsgType `protobuf:"varint,6,opt,name=msgType,proto3,enum=imparse.v1.MsgType" json:"msgType,omitempty"`
|
||||
Msg []byte `protobuf:"bytes,7,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
Datetime uint64 `protobuf:"varint,8,opt,name=datetime,proto3" json:"datetime,omitempty"`
|
||||
Source *Source `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Reference *Reference `protobuf:"bytes,10,opt,name=reference,proto3" json:"reference,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Common) Reset() {
|
||||
*x = Common{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Common) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Common) ProtoMessage() {}
|
||||
|
||||
func (x *Common) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Common.ProtoReflect.Descriptor instead.
|
||||
func (*Common) Descriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Common) GetChannelType() Channel {
|
||||
if x != nil {
|
||||
return x.ChannelType
|
||||
}
|
||||
return Channel_ToUser
|
||||
}
|
||||
|
||||
func (x *Common) GetMid() int64 {
|
||||
if x != nil {
|
||||
return x.Mid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Common) GetSeq() string {
|
||||
if x != nil {
|
||||
return x.Seq
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Common) GetFrom() string {
|
||||
if x != nil {
|
||||
return x.From
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Common) GetTarget() string {
|
||||
if x != nil {
|
||||
return x.Target
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Common) GetMsgType() MsgType {
|
||||
if x != nil {
|
||||
return x.MsgType
|
||||
}
|
||||
return MsgType_System
|
||||
}
|
||||
|
||||
func (x *Common) GetMsg() []byte {
|
||||
if x != nil {
|
||||
return x.Msg
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Common) GetDatetime() uint64 {
|
||||
if x != nil {
|
||||
return x.Datetime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Common) GetSource() *Source {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Common) GetReference() *Reference {
|
||||
if x != nil {
|
||||
return x.Reference
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Source struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ChannelType Channel `protobuf:"varint,1,opt,name=channelType,proto3,enum=imparse.v1.Channel" json:"channelType,omitempty"`
|
||||
From *SourceUser `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
|
||||
Target *SourceUser `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Source) Reset() {
|
||||
*x = Source{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Source) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Source) ProtoMessage() {}
|
||||
|
||||
func (x *Source) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Source.ProtoReflect.Descriptor instead.
|
||||
func (*Source) Descriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Source) GetChannelType() Channel {
|
||||
if x != nil {
|
||||
return x.ChannelType
|
||||
}
|
||||
return Channel_ToUser
|
||||
}
|
||||
|
||||
func (x *Source) GetFrom() *SourceUser {
|
||||
if x != nil {
|
||||
return x.From
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Source) GetTarget() *SourceUser {
|
||||
if x != nil {
|
||||
return x.Target
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SourceUser struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SourceUser) Reset() {
|
||||
*x = SourceUser{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SourceUser) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SourceUser) ProtoMessage() {}
|
||||
|
||||
func (x *SourceUser) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SourceUser.ProtoReflect.Descriptor instead.
|
||||
func (*SourceUser) Descriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *SourceUser) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SourceUser) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CommonAck struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Mid int64 `protobuf:"varint,2,opt,name=mid,proto3" json:"mid,omitempty"`
|
||||
Datetime uint64 `protobuf:"varint,8,opt,name=datetime,proto3" json:"datetime,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CommonAck) Reset() {
|
||||
*x = CommonAck{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CommonAck) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CommonAck) ProtoMessage() {}
|
||||
|
||||
func (x *CommonAck) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CommonAck.ProtoReflect.Descriptor instead.
|
||||
func (*CommonAck) Descriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *CommonAck) GetMid() int64 {
|
||||
if x != nil {
|
||||
return x.Mid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CommonAck) GetDatetime() uint64 {
|
||||
if x != nil {
|
||||
return x.Datetime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Reference struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Topic int64 `protobuf:"varint,1,opt,name=topic,proto3" json:"topic,omitempty"`
|
||||
Ref int64 `protobuf:"varint,2,opt,name=ref,proto3" json:"ref,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Reference) Reset() {
|
||||
*x = Reference{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Reference) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Reference) ProtoMessage() {}
|
||||
|
||||
func (x *Reference) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Reference.ProtoReflect.Descriptor instead.
|
||||
func (*Reference) Descriptor() ([]byte, []int) {
|
||||
return file_v1_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *Reference) GetTopic() int64 {
|
||||
if x != nil {
|
||||
return x.Topic
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Reference) GetRef() int64 {
|
||||
if x != nil {
|
||||
return x.Ref
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_v1_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_v1_proto_rawDesc = []byte{
|
||||
0x0a, 0x08, 0x76, 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x69, 0x6d, 0x70, 0x61,
|
||||
0x72, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x99, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x39, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x76, 0x31,
|
||||
0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65,
|
||||
0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62,
|
||||
0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22,
|
||||
0x41, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06,
|
||||
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d,
|
||||
0x6f, 0x6e, 0x41, 0x63, 0x6b, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61,
|
||||
0x6c, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x59, 0x53, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65,
|
||||
0x10, 0x03, 0x22, 0xcd, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x35, 0x0a,
|
||||
0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x13, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x03, 0x6d, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61,
|
||||
0x72, 0x67, 0x65, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54,
|
||||
0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x12, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,
|
||||
0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x33, 0x0a,
|
||||
0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x15, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,
|
||||
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e,
|
||||
0x63, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, 0x0a,
|
||||
0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x13, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d,
|
||||
0x12, 0x2e, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x16, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f,
|
||||
0x75, 0x72, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
|
||||
0x22, 0x30, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
|
||||
0x6d, 0x65, 0x22, 0x39, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x41, 0x63, 0x6b, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69,
|
||||
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x33, 0x0a,
|
||||
0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f,
|
||||
0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x72,
|
||||
0x65, 0x66, 0x2a, 0x22, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x0a, 0x0a,
|
||||
0x06, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x6f, 0x47,
|
||||
0x72, 0x6f, 0x75, 0x70, 0x10, 0x01, 0x2a, 0xb5, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x54, 0x79,
|
||||
0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x00, 0x12, 0x08,
|
||||
0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x75, 0x64, 0x69,
|
||||
0x6f, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x03, 0x12, 0x09,
|
||||
0x0a, 0x05, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x69, 0x6c,
|
||||
0x65, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x61, 0x72, 0x64, 0x10, 0x06, 0x12, 0x0a, 0x0a,
|
||||
0x06, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x10, 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f, 0x72,
|
||||
0x77, 0x61, 0x72, 0x64, 0x10, 0x08, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x54, 0x43, 0x43, 0x61, 0x6c,
|
||||
0x6c, 0x10, 0x09, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x10,
|
||||
0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x10, 0x0b, 0x12, 0x0d,
|
||||
0x0a, 0x09, 0x52, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x10, 0x0c, 0x12, 0x0f, 0x0a,
|
||||
0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x10, 0x0d, 0x42, 0x21,
|
||||
0x5a, 0x1f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x33, 0x33, 0x2e, 0x63, 0x6e, 0x2f, 0x63,
|
||||
0x68, 0x61, 0x74, 0x2f, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_v1_proto_rawDescOnce sync.Once
|
||||
file_v1_proto_rawDescData = file_v1_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_v1_proto_rawDescGZIP() []byte {
|
||||
file_v1_proto_rawDescOnce.Do(func() {
|
||||
file_v1_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_proto_rawDescData)
|
||||
})
|
||||
return file_v1_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_v1_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
|
||||
var file_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_v1_proto_goTypes = []interface{}{
|
||||
(Channel)(0), // 0: imparse.v1.Channel
|
||||
(MsgType)(0), // 1: imparse.v1.MsgType
|
||||
(Proto_EventType)(0), // 2: imparse.v1.Proto.EventType
|
||||
(*Proto)(nil), // 3: imparse.v1.Proto
|
||||
(*Common)(nil), // 4: imparse.v1.Common
|
||||
(*Source)(nil), // 5: imparse.v1.Source
|
||||
(*SourceUser)(nil), // 6: imparse.v1.SourceUser
|
||||
(*CommonAck)(nil), // 7: imparse.v1.CommonAck
|
||||
(*Reference)(nil), // 8: imparse.v1.Reference
|
||||
}
|
||||
var file_v1_proto_depIdxs = []int32{
|
||||
2, // 0: imparse.v1.Proto.eventType:type_name -> imparse.v1.Proto.EventType
|
||||
0, // 1: imparse.v1.Common.channelType:type_name -> imparse.v1.Channel
|
||||
1, // 2: imparse.v1.Common.msgType:type_name -> imparse.v1.MsgType
|
||||
5, // 3: imparse.v1.Common.source:type_name -> imparse.v1.Source
|
||||
8, // 4: imparse.v1.Common.reference:type_name -> imparse.v1.Reference
|
||||
0, // 5: imparse.v1.Source.channelType:type_name -> imparse.v1.Channel
|
||||
6, // 6: imparse.v1.Source.from:type_name -> imparse.v1.SourceUser
|
||||
6, // 7: imparse.v1.Source.target:type_name -> imparse.v1.SourceUser
|
||||
8, // [8:8] is the sub-list for method output_type
|
||||
8, // [8:8] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_v1_proto_init() }
|
||||
func file_v1_proto_init() {
|
||||
if File_v1_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_v1_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Proto); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Common); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Source); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SourceUser); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CommonAck); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_v1_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Reference); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_v1_proto_rawDesc,
|
||||
NumEnums: 3,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_v1_proto_goTypes,
|
||||
DependencyIndexes: file_v1_proto_depIdxs,
|
||||
EnumInfos: file_v1_proto_enumTypes,
|
||||
MessageInfos: file_v1_proto_msgTypes,
|
||||
}.Build()
|
||||
File_v1_proto = out.File
|
||||
file_v1_proto_rawDesc = nil
|
||||
file_v1_proto_goTypes = nil
|
||||
file_v1_proto_depIdxs = nil
|
||||
}
|
||||
74
proto/v1.proto
Normal file
74
proto/v1.proto
Normal file
@@ -0,0 +1,74 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user