first commit

This commit is contained in:
2022-03-17 15:59:24 +08:00
commit 2b0debb847
592 changed files with 73946 additions and 0 deletions

View File

@@ -0,0 +1,727 @@
// 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: answer.proto
package answer
import (
proto "gitlab.33.cn/chat/imparse/proto"
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 PushCommonMsgReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
}
func (x *PushCommonMsgReq) Reset() {
*x = PushCommonMsgReq{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PushCommonMsgReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PushCommonMsgReq) ProtoMessage() {}
func (x *PushCommonMsgReq) ProtoReflect() protoreflect.Message {
mi := &file_answer_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 PushCommonMsgReq.ProtoReflect.Descriptor instead.
func (*PushCommonMsgReq) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{0}
}
func (x *PushCommonMsgReq) GetKey() string {
if x != nil {
return x.Key
}
return ""
}
func (x *PushCommonMsgReq) GetFrom() string {
if x != nil {
return x.From
}
return ""
}
func (x *PushCommonMsgReq) GetBody() []byte {
if x != nil {
return x.Body
}
return nil
}
type PushCommonMsgReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Mid int64 `protobuf:"varint,1,opt,name=mid,proto3" json:"mid,omitempty"`
Time uint64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
}
func (x *PushCommonMsgReply) Reset() {
*x = PushCommonMsgReply{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PushCommonMsgReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PushCommonMsgReply) ProtoMessage() {}
func (x *PushCommonMsgReply) ProtoReflect() protoreflect.Message {
mi := &file_answer_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 PushCommonMsgReply.ProtoReflect.Descriptor instead.
func (*PushCommonMsgReply) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{1}
}
func (x *PushCommonMsgReply) GetMid() int64 {
if x != nil {
return x.Mid
}
return 0
}
func (x *PushCommonMsgReply) GetTime() uint64 {
if x != nil {
return x.Time
}
return 0
}
type PushNoticeMsgReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Seq string `protobuf:"bytes,1,opt,name=seq,proto3" json:"seq,omitempty"`
ChannelType int32 `protobuf:"varint,2,opt,name=channelType,proto3" json:"channelType,omitempty"`
From string `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`
Target string `protobuf:"bytes,4,opt,name=target,proto3" json:"target,omitempty"`
Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
}
func (x *PushNoticeMsgReq) Reset() {
*x = PushNoticeMsgReq{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PushNoticeMsgReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PushNoticeMsgReq) ProtoMessage() {}
func (x *PushNoticeMsgReq) ProtoReflect() protoreflect.Message {
mi := &file_answer_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 PushNoticeMsgReq.ProtoReflect.Descriptor instead.
func (*PushNoticeMsgReq) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{2}
}
func (x *PushNoticeMsgReq) GetSeq() string {
if x != nil {
return x.Seq
}
return ""
}
func (x *PushNoticeMsgReq) GetChannelType() int32 {
if x != nil {
return x.ChannelType
}
return 0
}
func (x *PushNoticeMsgReq) GetFrom() string {
if x != nil {
return x.From
}
return ""
}
func (x *PushNoticeMsgReq) GetTarget() string {
if x != nil {
return x.Target
}
return ""
}
func (x *PushNoticeMsgReq) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
type PushNoticeMsgReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Mid int64 `protobuf:"varint,1,opt,name=mid,proto3" json:"mid,omitempty"`
}
func (x *PushNoticeMsgReply) Reset() {
*x = PushNoticeMsgReply{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PushNoticeMsgReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PushNoticeMsgReply) ProtoMessage() {}
func (x *PushNoticeMsgReply) ProtoReflect() protoreflect.Message {
mi := &file_answer_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 PushNoticeMsgReply.ProtoReflect.Descriptor instead.
func (*PushNoticeMsgReply) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{3}
}
func (x *PushNoticeMsgReply) GetMid() int64 {
if x != nil {
return x.Mid
}
return 0
}
type UniCastSignalReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type proto.SignalType `protobuf:"varint,1,opt,name=type,proto3,enum=imparse.signal.SignalType" json:"type,omitempty"`
Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
}
func (x *UniCastSignalReq) Reset() {
*x = UniCastSignalReq{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UniCastSignalReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UniCastSignalReq) ProtoMessage() {}
func (x *UniCastSignalReq) ProtoReflect() protoreflect.Message {
mi := &file_answer_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 UniCastSignalReq.ProtoReflect.Descriptor instead.
func (*UniCastSignalReq) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{4}
}
func (x *UniCastSignalReq) GetType() proto.SignalType {
if x != nil {
return x.Type
}
return proto.SignalType(0)
}
func (x *UniCastSignalReq) GetTarget() string {
if x != nil {
return x.Target
}
return ""
}
func (x *UniCastSignalReq) GetBody() []byte {
if x != nil {
return x.Body
}
return nil
}
type UniCastSignalReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Mid int64 `protobuf:"varint,1,opt,name=mid,proto3" json:"mid,omitempty"`
}
func (x *UniCastSignalReply) Reset() {
*x = UniCastSignalReply{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UniCastSignalReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UniCastSignalReply) ProtoMessage() {}
func (x *UniCastSignalReply) ProtoReflect() protoreflect.Message {
mi := &file_answer_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 UniCastSignalReply.ProtoReflect.Descriptor instead.
func (*UniCastSignalReply) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{5}
}
func (x *UniCastSignalReply) GetMid() int64 {
if x != nil {
return x.Mid
}
return 0
}
type GroupCastSignalReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type proto.SignalType `protobuf:"varint,1,opt,name=type,proto3,enum=imparse.signal.SignalType" json:"type,omitempty"`
Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
}
func (x *GroupCastSignalReq) Reset() {
*x = GroupCastSignalReq{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GroupCastSignalReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GroupCastSignalReq) ProtoMessage() {}
func (x *GroupCastSignalReq) ProtoReflect() protoreflect.Message {
mi := &file_answer_proto_msgTypes[6]
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 GroupCastSignalReq.ProtoReflect.Descriptor instead.
func (*GroupCastSignalReq) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{6}
}
func (x *GroupCastSignalReq) GetType() proto.SignalType {
if x != nil {
return x.Type
}
return proto.SignalType(0)
}
func (x *GroupCastSignalReq) GetTarget() string {
if x != nil {
return x.Target
}
return ""
}
func (x *GroupCastSignalReq) GetBody() []byte {
if x != nil {
return x.Body
}
return nil
}
type GroupCastSignalReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Mid int64 `protobuf:"varint,1,opt,name=mid,proto3" json:"mid,omitempty"`
}
func (x *GroupCastSignalReply) Reset() {
*x = GroupCastSignalReply{}
if protoimpl.UnsafeEnabled {
mi := &file_answer_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GroupCastSignalReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GroupCastSignalReply) ProtoMessage() {}
func (x *GroupCastSignalReply) ProtoReflect() protoreflect.Message {
mi := &file_answer_proto_msgTypes[7]
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 GroupCastSignalReply.ProtoReflect.Descriptor instead.
func (*GroupCastSignalReply) Descriptor() ([]byte, []int) {
return file_answer_proto_rawDescGZIP(), []int{7}
}
func (x *GroupCastSignalReply) GetMid() int64 {
if x != nil {
return x.Mid
}
return 0
}
var File_answer_proto protoreflect.FileDescriptor
var file_answer_proto_rawDesc = []byte{
0x0a, 0x0c, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c,
0x64, 0x74, 0x61, 0x6c, 0x6b, 0x2e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x1a, 0x2c, 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, 0x2f, 0x73, 0x69,
0x67, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x10, 0x50, 0x75,
0x73, 0x68, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x66, 0x72, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x3a, 0x0a, 0x12, 0x50, 0x75, 0x73, 0x68,
0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04,
0x74, 0x69, 0x6d, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x10, 0x50, 0x75, 0x73, 0x68, 0x4e, 0x6f, 0x74,
0x69, 0x63, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x63,
0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f,
0x6d, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x26, 0x0a,
0x12, 0x50, 0x75, 0x73, 0x68, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x03, 0x6d, 0x69, 0x64, 0x22, 0x6e, 0x0a, 0x10, 0x55, 0x6e, 0x69, 0x43, 0x61, 0x73, 0x74,
0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73,
0x65, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x54,
0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72,
0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65,
0x74, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x26, 0x0a, 0x12, 0x55, 0x6e, 0x69, 0x43, 0x61, 0x73, 0x74,
0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6d,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69, 0x64, 0x22, 0x70, 0x0a,
0x12, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c,
0x52, 0x65, 0x71, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x1a, 0x2e, 0x69, 0x6d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x73, 0x69, 0x67, 0x6e,
0x61, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x62,
0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22,
0x28, 0x0a, 0x14, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e,
0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69, 0x64, 0x32, 0xda, 0x02, 0x0a, 0x06, 0x41, 0x6e,
0x73, 0x77, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x1e, 0x2e, 0x64, 0x74, 0x61, 0x6c, 0x6b, 0x2e, 0x61, 0x6e,
0x73, 0x77, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4d,
0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x64, 0x74, 0x61, 0x6c, 0x6b, 0x2e, 0x61, 0x6e,
0x73, 0x77, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4d,
0x73, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x51, 0x0a, 0x0d, 0x50, 0x75, 0x73, 0x68, 0x4e,
0x6f, 0x74, 0x69, 0x63, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x1e, 0x2e, 0x64, 0x74, 0x61, 0x6c, 0x6b,
0x2e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4e, 0x6f, 0x74, 0x69,
0x63, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x64, 0x74, 0x61, 0x6c, 0x6b,
0x2e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4e, 0x6f, 0x74, 0x69,
0x63, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x51, 0x0a, 0x0d, 0x55, 0x6e,
0x69, 0x43, 0x61, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x1e, 0x2e, 0x64, 0x74,
0x61, 0x6c, 0x6b, 0x2e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x43, 0x61,
0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x64, 0x74,
0x61, 0x6c, 0x6b, 0x2e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x69, 0x43, 0x61,
0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x57, 0x0a,
0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c,
0x12, 0x20, 0x2e, 0x64, 0x74, 0x61, 0x6c, 0x6b, 0x2e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52,
0x65, 0x71, 0x1a, 0x22, 0x2e, 0x64, 0x74, 0x61, 0x6c, 0x6b, 0x2e, 0x61, 0x6e, 0x73, 0x77, 0x65,
0x72, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61,
0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62,
0x2e, 0x33, 0x33, 0x2e, 0x63, 0x6e, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x64, 0x74, 0x61, 0x6c,
0x6b, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x2f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_answer_proto_rawDescOnce sync.Once
file_answer_proto_rawDescData = file_answer_proto_rawDesc
)
func file_answer_proto_rawDescGZIP() []byte {
file_answer_proto_rawDescOnce.Do(func() {
file_answer_proto_rawDescData = protoimpl.X.CompressGZIP(file_answer_proto_rawDescData)
})
return file_answer_proto_rawDescData
}
var file_answer_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_answer_proto_goTypes = []interface{}{
(*PushCommonMsgReq)(nil), // 0: dtalk.answer.PushCommonMsgReq
(*PushCommonMsgReply)(nil), // 1: dtalk.answer.PushCommonMsgReply
(*PushNoticeMsgReq)(nil), // 2: dtalk.answer.PushNoticeMsgReq
(*PushNoticeMsgReply)(nil), // 3: dtalk.answer.PushNoticeMsgReply
(*UniCastSignalReq)(nil), // 4: dtalk.answer.UniCastSignalReq
(*UniCastSignalReply)(nil), // 5: dtalk.answer.UniCastSignalReply
(*GroupCastSignalReq)(nil), // 6: dtalk.answer.GroupCastSignalReq
(*GroupCastSignalReply)(nil), // 7: dtalk.answer.GroupCastSignalReply
(proto.SignalType)(0), // 8: imparse.signal.SignalType
}
var file_answer_proto_depIdxs = []int32{
8, // 0: dtalk.answer.UniCastSignalReq.type:type_name -> imparse.signal.SignalType
8, // 1: dtalk.answer.GroupCastSignalReq.type:type_name -> imparse.signal.SignalType
0, // 2: dtalk.answer.Answer.PushCommonMsg:input_type -> dtalk.answer.PushCommonMsgReq
2, // 3: dtalk.answer.Answer.PushNoticeMsg:input_type -> dtalk.answer.PushNoticeMsgReq
4, // 4: dtalk.answer.Answer.UniCastSignal:input_type -> dtalk.answer.UniCastSignalReq
6, // 5: dtalk.answer.Answer.GroupCastSignal:input_type -> dtalk.answer.GroupCastSignalReq
1, // 6: dtalk.answer.Answer.PushCommonMsg:output_type -> dtalk.answer.PushCommonMsgReply
3, // 7: dtalk.answer.Answer.PushNoticeMsg:output_type -> dtalk.answer.PushNoticeMsgReply
5, // 8: dtalk.answer.Answer.UniCastSignal:output_type -> dtalk.answer.UniCastSignalReply
7, // 9: dtalk.answer.Answer.GroupCastSignal:output_type -> dtalk.answer.GroupCastSignalReply
6, // [6:10] is the sub-list for method output_type
2, // [2:6] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_answer_proto_init() }
func file_answer_proto_init() {
if File_answer_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_answer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushCommonMsgReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_answer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushCommonMsgReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_answer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushNoticeMsgReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_answer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushNoticeMsgReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_answer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UniCastSignalReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_answer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UniCastSignalReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_answer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GroupCastSignalReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_answer_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GroupCastSignalReply); 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_answer_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_answer_proto_goTypes,
DependencyIndexes: file_answer_proto_depIdxs,
MessageInfos: file_answer_proto_msgTypes,
}.Build()
File_answer_proto = out.File
file_answer_proto_rawDesc = nil
file_answer_proto_goTypes = nil
file_answer_proto_depIdxs = nil
}

View File

@@ -0,0 +1,57 @@
// protoc -I=. -I=$GOPATH/src --go_out=plugins=grpc:. *.proto
syntax = "proto3";
import "gitlab.33.cn/chat/imparse/proto/signal.proto";
package dtalk.answer;
option go_package = "gitlab.33.cn/chat/dtalk/service/record/answer";
message PushCommonMsgReq {
string key = 1;
string from = 2;
bytes body = 3;
}
message PushCommonMsgReply {
int64 mid = 1;
uint64 time = 2;
}
message PushNoticeMsgReq {
string seq = 1;
int32 channelType = 2;
string from = 3;
string target = 4;
bytes data = 5;
}
message PushNoticeMsgReply {
int64 mid = 1;
}
message UniCastSignalReq {
imparse.signal.SignalType type = 1;
string target = 2;
bytes body = 3;
}
message UniCastSignalReply {
int64 mid = 1;
}
message GroupCastSignalReq {
imparse.signal.SignalType type = 1;
string target = 2;
bytes body = 3;
}
message GroupCastSignalReply {
int64 mid = 1;
}
service Answer {
rpc PushCommonMsg(PushCommonMsgReq) returns (PushCommonMsgReply);
rpc PushNoticeMsg(PushNoticeMsgReq) returns (PushNoticeMsgReply);
rpc UniCastSignal(UniCastSignalReq) returns (UniCastSignalReply);
rpc GroupCastSignal(GroupCastSignalReq) returns (GroupCastSignalReply);
}

View File

@@ -0,0 +1,209 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package answer
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// AnswerClient is the client API for Answer service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AnswerClient interface {
PushCommonMsg(ctx context.Context, in *PushCommonMsgReq, opts ...grpc.CallOption) (*PushCommonMsgReply, error)
PushNoticeMsg(ctx context.Context, in *PushNoticeMsgReq, opts ...grpc.CallOption) (*PushNoticeMsgReply, error)
UniCastSignal(ctx context.Context, in *UniCastSignalReq, opts ...grpc.CallOption) (*UniCastSignalReply, error)
GroupCastSignal(ctx context.Context, in *GroupCastSignalReq, opts ...grpc.CallOption) (*GroupCastSignalReply, error)
}
type answerClient struct {
cc grpc.ClientConnInterface
}
func NewAnswerClient(cc grpc.ClientConnInterface) AnswerClient {
return &answerClient{cc}
}
func (c *answerClient) PushCommonMsg(ctx context.Context, in *PushCommonMsgReq, opts ...grpc.CallOption) (*PushCommonMsgReply, error) {
out := new(PushCommonMsgReply)
err := c.cc.Invoke(ctx, "/dtalk.answer.Answer/PushCommonMsg", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *answerClient) PushNoticeMsg(ctx context.Context, in *PushNoticeMsgReq, opts ...grpc.CallOption) (*PushNoticeMsgReply, error) {
out := new(PushNoticeMsgReply)
err := c.cc.Invoke(ctx, "/dtalk.answer.Answer/PushNoticeMsg", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *answerClient) UniCastSignal(ctx context.Context, in *UniCastSignalReq, opts ...grpc.CallOption) (*UniCastSignalReply, error) {
out := new(UniCastSignalReply)
err := c.cc.Invoke(ctx, "/dtalk.answer.Answer/UniCastSignal", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *answerClient) GroupCastSignal(ctx context.Context, in *GroupCastSignalReq, opts ...grpc.CallOption) (*GroupCastSignalReply, error) {
out := new(GroupCastSignalReply)
err := c.cc.Invoke(ctx, "/dtalk.answer.Answer/GroupCastSignal", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AnswerServer is the server API for Answer service.
// All implementations must embed UnimplementedAnswerServer
// for forward compatibility
type AnswerServer interface {
PushCommonMsg(context.Context, *PushCommonMsgReq) (*PushCommonMsgReply, error)
PushNoticeMsg(context.Context, *PushNoticeMsgReq) (*PushNoticeMsgReply, error)
UniCastSignal(context.Context, *UniCastSignalReq) (*UniCastSignalReply, error)
GroupCastSignal(context.Context, *GroupCastSignalReq) (*GroupCastSignalReply, error)
mustEmbedUnimplementedAnswerServer()
}
// UnimplementedAnswerServer must be embedded to have forward compatible implementations.
type UnimplementedAnswerServer struct {
}
func (UnimplementedAnswerServer) PushCommonMsg(context.Context, *PushCommonMsgReq) (*PushCommonMsgReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PushCommonMsg not implemented")
}
func (UnimplementedAnswerServer) PushNoticeMsg(context.Context, *PushNoticeMsgReq) (*PushNoticeMsgReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PushNoticeMsg not implemented")
}
func (UnimplementedAnswerServer) UniCastSignal(context.Context, *UniCastSignalReq) (*UniCastSignalReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method UniCastSignal not implemented")
}
func (UnimplementedAnswerServer) GroupCastSignal(context.Context, *GroupCastSignalReq) (*GroupCastSignalReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GroupCastSignal not implemented")
}
func (UnimplementedAnswerServer) mustEmbedUnimplementedAnswerServer() {}
// UnsafeAnswerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AnswerServer will
// result in compilation errors.
type UnsafeAnswerServer interface {
mustEmbedUnimplementedAnswerServer()
}
func RegisterAnswerServer(s grpc.ServiceRegistrar, srv AnswerServer) {
s.RegisterService(&Answer_ServiceDesc, srv)
}
func _Answer_PushCommonMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PushCommonMsgReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AnswerServer).PushCommonMsg(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/dtalk.answer.Answer/PushCommonMsg",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AnswerServer).PushCommonMsg(ctx, req.(*PushCommonMsgReq))
}
return interceptor(ctx, in, info, handler)
}
func _Answer_PushNoticeMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PushNoticeMsgReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AnswerServer).PushNoticeMsg(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/dtalk.answer.Answer/PushNoticeMsg",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AnswerServer).PushNoticeMsg(ctx, req.(*PushNoticeMsgReq))
}
return interceptor(ctx, in, info, handler)
}
func _Answer_UniCastSignal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UniCastSignalReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AnswerServer).UniCastSignal(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/dtalk.answer.Answer/UniCastSignal",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AnswerServer).UniCastSignal(ctx, req.(*UniCastSignalReq))
}
return interceptor(ctx, in, info, handler)
}
func _Answer_GroupCastSignal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GroupCastSignalReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AnswerServer).GroupCastSignal(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/dtalk.answer.Answer/GroupCastSignal",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AnswerServer).GroupCastSignal(ctx, req.(*GroupCastSignalReq))
}
return interceptor(ctx, in, info, handler)
}
// Answer_ServiceDesc is the grpc.ServiceDesc for Answer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Answer_ServiceDesc = grpc.ServiceDesc{
ServiceName: "dtalk.answer.Answer",
HandlerType: (*AnswerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "PushCommonMsg",
Handler: _Answer_PushCommonMsg_Handler,
},
{
MethodName: "PushNoticeMsg",
Handler: _Answer_PushNoticeMsg_Handler,
},
{
MethodName: "UniCastSignal",
Handler: _Answer_UniCastSignal_Handler,
},
{
MethodName: "GroupCastSignal",
Handler: _Answer_GroupCastSignal_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "answer.proto",
}

View File

@@ -0,0 +1,82 @@
package answer
import (
"context"
"fmt"
"time"
"gitlab.33.cn/chat/dtalk/pkg/naming"
xgrpc "gitlab.33.cn/chat/dtalk/pkg/net/grpc"
"gitlab.33.cn/chat/im-pkg/trace"
xproto "gitlab.33.cn/chat/imparse/proto"
"google.golang.org/grpc"
"google.golang.org/grpc/resolver"
)
type Client struct {
client AnswerClient
}
func New(etcdAddr, schema, srvName string, dial time.Duration) *Client {
rb := naming.NewResolver(etcdAddr, schema)
resolver.Register(rb)
addr := fmt.Sprintf("%s:///%s", schema, srvName) // "schema://[authority]/service"
fmt.Println("answer rpc client call addr:", addr)
conn, err := xgrpc.NewGRPCConnWithOpts(addr, dial, grpc.WithUnaryInterceptor(trace.OpentracingClientInterceptor))
if err != nil {
panic(err)
}
return &Client{
client: NewAnswerClient(conn),
}
}
func (c *Client) PushCommonMsg(ctx context.Context, key, From string, body []byte) (int64, uint64, error) {
in := &PushCommonMsgReq{
Key: key,
From: From,
Body: body,
}
res, err := c.client.PushCommonMsg(ctx, in)
if err != nil {
return 0, 0, err
}
return res.Mid, res.Time, err
}
func (c *Client) PushNoticeMsg(ctx context.Context, Seq string, ChannelType int32, From, Target string, Data []byte) (int64, error) {
in := &PushNoticeMsgReq{
Seq: Seq,
ChannelType: ChannelType,
From: From,
Target: Target,
Data: Data,
}
res, err := c.client.PushNoticeMsg(ctx, in)
if err != nil {
return 0, err
}
return res.Mid, err
}
func (c *Client) UniCastSignal(ctx context.Context, Action xproto.SignalType, Target string, Body []byte) error {
in := &UniCastSignalReq{
Type: Action,
Target: Target,
Body: Body,
}
_, err := c.client.UniCastSignal(ctx, in)
return err
}
func (c *Client) GroupCastSignal(ctx context.Context, Action xproto.SignalType, Target string, Body []byte) error {
in := &GroupCastSignalReq{
Type: Action,
Target: Target,
Body: Body,
}
_, err := c.client.GroupCastSignal(ctx, in)
return err
}

View File

@@ -0,0 +1,6 @@
#!/bin/sh
protoc -I. -I$GOPATH/src \
--go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
*.proto