From 36ddf0102177f9dd5b3ccfc53548be3e6f9342c7 Mon Sep 17 00:00:00 2001 From: YuanJay <2218773049@qq.com> Date: Thu, 16 Nov 2023 10:03:48 +0800 Subject: [PATCH] aes key --- aeskey/aesKey.pb.go | 621 ++++++++++++++++++++++++++++++++++++++++++++ aeskey/aesKey.proto | 36 +++ gen.sh | 3 +- 3 files changed, 659 insertions(+), 1 deletion(-) create mode 100644 aeskey/aesKey.pb.go create mode 100644 aeskey/aesKey.proto diff --git a/aeskey/aesKey.pb.go b/aeskey/aesKey.pb.go new file mode 100644 index 00000000..4e410c14 --- /dev/null +++ b/aeskey/aesKey.pb.go @@ -0,0 +1,621 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.1 +// protoc v4.22.0 +// source: aesKey/aesKey.proto + +package aesKey + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 AesKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyConversationsID string `protobuf:"bytes,1,opt,name=keyConversationsID,proto3" json:"keyConversationsID"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key"` + ConversationType int32 `protobuf:"varint,3,opt,name=conversationType,proto3" json:"conversationType"` + OwnerUserID string `protobuf:"bytes,4,opt,name=ownerUserID,proto3" json:"ownerUserID"` + FriendUserID string `protobuf:"bytes,5,opt,name=friendUserID,proto3" json:"friendUserID"` + GroupID string `protobuf:"bytes,6,opt,name=groupID,proto3" json:"groupID"` +} + +func (x *AesKey) Reset() { + *x = AesKey{} + if protoimpl.UnsafeEnabled { + mi := &file_aesKey_aesKey_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AesKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AesKey) ProtoMessage() {} + +func (x *AesKey) ProtoReflect() protoreflect.Message { + mi := &file_aesKey_aesKey_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 AesKey.ProtoReflect.Descriptor instead. +func (*AesKey) Descriptor() ([]byte, []int) { + return file_aesKey_aesKey_proto_rawDescGZIP(), []int{0} +} + +func (x *AesKey) GetKeyConversationsID() string { + if x != nil { + return x.KeyConversationsID + } + return "" +} + +func (x *AesKey) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *AesKey) GetConversationType() int32 { + if x != nil { + return x.ConversationType + } + return 0 +} + +func (x *AesKey) GetOwnerUserID() string { + if x != nil { + return x.OwnerUserID + } + return "" +} + +func (x *AesKey) GetFriendUserID() string { + if x != nil { + return x.FriendUserID + } + return "" +} + +func (x *AesKey) GetGroupID() string { + if x != nil { + return x.GroupID + } + return "" +} + +type AcquireAesKeyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConversationType int32 `protobuf:"varint,1,opt,name=conversationType,proto3" json:"conversationType"` + OwnerUserID string `protobuf:"bytes,2,opt,name=ownerUserID,proto3" json:"ownerUserID"` + FriendUserID string `protobuf:"bytes,3,opt,name=friendUserID,proto3" json:"friendUserID"` + GroupID string `protobuf:"bytes,4,opt,name=groupID,proto3" json:"groupID"` +} + +func (x *AcquireAesKeyReq) Reset() { + *x = AcquireAesKeyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_aesKey_aesKey_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcquireAesKeyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcquireAesKeyReq) ProtoMessage() {} + +func (x *AcquireAesKeyReq) ProtoReflect() protoreflect.Message { + mi := &file_aesKey_aesKey_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 AcquireAesKeyReq.ProtoReflect.Descriptor instead. +func (*AcquireAesKeyReq) Descriptor() ([]byte, []int) { + return file_aesKey_aesKey_proto_rawDescGZIP(), []int{1} +} + +func (x *AcquireAesKeyReq) GetConversationType() int32 { + if x != nil { + return x.ConversationType + } + return 0 +} + +func (x *AcquireAesKeyReq) GetOwnerUserID() string { + if x != nil { + return x.OwnerUserID + } + return "" +} + +func (x *AcquireAesKeyReq) GetFriendUserID() string { + if x != nil { + return x.FriendUserID + } + return "" +} + +func (x *AcquireAesKeyReq) GetGroupID() string { + if x != nil { + return x.GroupID + } + return "" +} + +type AcquireAesKeyResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AesKey *AesKey `protobuf:"bytes,1,opt,name=aesKey,proto3" json:"aesKey"` +} + +func (x *AcquireAesKeyResp) Reset() { + *x = AcquireAesKeyResp{} + if protoimpl.UnsafeEnabled { + mi := &file_aesKey_aesKey_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcquireAesKeyResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcquireAesKeyResp) ProtoMessage() {} + +func (x *AcquireAesKeyResp) ProtoReflect() protoreflect.Message { + mi := &file_aesKey_aesKey_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 AcquireAesKeyResp.ProtoReflect.Descriptor instead. +func (*AcquireAesKeyResp) Descriptor() ([]byte, []int) { + return file_aesKey_aesKey_proto_rawDescGZIP(), []int{2} +} + +func (x *AcquireAesKeyResp) GetAesKey() *AesKey { + if x != nil { + return x.AesKey + } + return nil +} + +type AcquireAesKeysReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID"` +} + +func (x *AcquireAesKeysReq) Reset() { + *x = AcquireAesKeysReq{} + if protoimpl.UnsafeEnabled { + mi := &file_aesKey_aesKey_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcquireAesKeysReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcquireAesKeysReq) ProtoMessage() {} + +func (x *AcquireAesKeysReq) ProtoReflect() protoreflect.Message { + mi := &file_aesKey_aesKey_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 AcquireAesKeysReq.ProtoReflect.Descriptor instead. +func (*AcquireAesKeysReq) Descriptor() ([]byte, []int) { + return file_aesKey_aesKey_proto_rawDescGZIP(), []int{3} +} + +func (x *AcquireAesKeysReq) GetUserID() string { + if x != nil { + return x.UserID + } + return "" +} + +type AcquireAesKeysResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AesKeys []*AesKey `protobuf:"bytes,1,rep,name=aesKeys,proto3" json:"aesKeys"` +} + +func (x *AcquireAesKeysResp) Reset() { + *x = AcquireAesKeysResp{} + if protoimpl.UnsafeEnabled { + mi := &file_aesKey_aesKey_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcquireAesKeysResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcquireAesKeysResp) ProtoMessage() {} + +func (x *AcquireAesKeysResp) ProtoReflect() protoreflect.Message { + mi := &file_aesKey_aesKey_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 AcquireAesKeysResp.ProtoReflect.Descriptor instead. +func (*AcquireAesKeysResp) Descriptor() ([]byte, []int) { + return file_aesKey_aesKey_proto_rawDescGZIP(), []int{4} +} + +func (x *AcquireAesKeysResp) GetAesKeys() []*AesKey { + if x != nil { + return x.AesKeys + } + return nil +} + +var File_aesKey_aesKey_proto protoreflect.FileDescriptor + +var file_aesKey_aesKey_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x61, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x2f, 0x61, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x61, 0x65, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0xd6, 0x01, 0x0a, 0x06, + 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x12, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x76, + 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x44, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0x49, 0x0a, 0x11, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x06, 0x61, 0x65, + 0x73, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, + 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x61, 0x65, 0x73, 0x5f, 0x6b, 0x65, + 0x79, 0x2e, 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x61, 0x65, 0x73, 0x4b, 0x65, 0x79, + 0x22, 0x2b, 0x0a, 0x11, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x65, 0x73, 0x4b, 0x65, + 0x79, 0x73, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x4c, 0x0a, + 0x12, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x07, 0x61, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x61, 0x65, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x41, 0x65, 0x73, 0x4b, + 0x65, 0x79, 0x52, 0x07, 0x61, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x32, 0xcf, 0x01, 0x0a, 0x06, + 0x61, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x60, 0x0a, 0x0d, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x61, 0x65, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x41, + 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, + 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x61, + 0x65, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x65, + 0x73, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, 0x0a, 0x0e, 0x41, 0x63, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x27, 0x2e, 0x4f, 0x70, 0x65, + 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x61, 0x65, 0x73, 0x5f, 0x6b, 0x65, + 0x79, 0x2e, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x61, 0x65, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x41, 0x63, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x41, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x26, 0x5a, + 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, + 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, + 0x65, 0x73, 0x4b, 0x65, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_aesKey_aesKey_proto_rawDescOnce sync.Once + file_aesKey_aesKey_proto_rawDescData = file_aesKey_aesKey_proto_rawDesc +) + +func file_aesKey_aesKey_proto_rawDescGZIP() []byte { + file_aesKey_aesKey_proto_rawDescOnce.Do(func() { + file_aesKey_aesKey_proto_rawDescData = protoimpl.X.CompressGZIP(file_aesKey_aesKey_proto_rawDescData) + }) + return file_aesKey_aesKey_proto_rawDescData +} + +var file_aesKey_aesKey_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_aesKey_aesKey_proto_goTypes = []interface{}{ + (*AesKey)(nil), // 0: OpenIMServer.aes_key.AesKey + (*AcquireAesKeyReq)(nil), // 1: OpenIMServer.aes_key.AcquireAesKeyReq + (*AcquireAesKeyResp)(nil), // 2: OpenIMServer.aes_key.AcquireAesKeyResp + (*AcquireAesKeysReq)(nil), // 3: OpenIMServer.aes_key.AcquireAesKeysReq + (*AcquireAesKeysResp)(nil), // 4: OpenIMServer.aes_key.AcquireAesKeysResp +} +var file_aesKey_aesKey_proto_depIdxs = []int32{ + 0, // 0: OpenIMServer.aes_key.AcquireAesKeyResp.aesKey:type_name -> OpenIMServer.aes_key.AesKey + 0, // 1: OpenIMServer.aes_key.AcquireAesKeysResp.aesKeys:type_name -> OpenIMServer.aes_key.AesKey + 1, // 2: OpenIMServer.aes_key.aesKey.AcquireAesKey:input_type -> OpenIMServer.aes_key.AcquireAesKeyReq + 3, // 3: OpenIMServer.aes_key.aesKey.AcquireAesKeys:input_type -> OpenIMServer.aes_key.AcquireAesKeysReq + 2, // 4: OpenIMServer.aes_key.aesKey.AcquireAesKey:output_type -> OpenIMServer.aes_key.AcquireAesKeyResp + 4, // 5: OpenIMServer.aes_key.aesKey.AcquireAesKeys:output_type -> OpenIMServer.aes_key.AcquireAesKeysResp + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] 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_aesKey_aesKey_proto_init() } +func file_aesKey_aesKey_proto_init() { + if File_aesKey_aesKey_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_aesKey_aesKey_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AesKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aesKey_aesKey_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcquireAesKeyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aesKey_aesKey_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcquireAesKeyResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aesKey_aesKey_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcquireAesKeysReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aesKey_aesKey_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcquireAesKeysResp); 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_aesKey_aesKey_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_aesKey_aesKey_proto_goTypes, + DependencyIndexes: file_aesKey_aesKey_proto_depIdxs, + MessageInfos: file_aesKey_aesKey_proto_msgTypes, + }.Build() + File_aesKey_aesKey_proto = out.File + file_aesKey_aesKey_proto_rawDesc = nil + file_aesKey_aesKey_proto_goTypes = nil + file_aesKey_aesKey_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AesKeyClient is the client API for AesKey service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AesKeyClient interface { + AcquireAesKey(ctx context.Context, in *AcquireAesKeyReq, opts ...grpc.CallOption) (*AcquireAesKeyResp, error) + AcquireAesKeys(ctx context.Context, in *AcquireAesKeysReq, opts ...grpc.CallOption) (*AcquireAesKeysResp, error) +} + +type aesKeyClient struct { + cc grpc.ClientConnInterface +} + +func NewAesKeyClient(cc grpc.ClientConnInterface) AesKeyClient { + return &aesKeyClient{cc} +} + +func (c *aesKeyClient) AcquireAesKey(ctx context.Context, in *AcquireAesKeyReq, opts ...grpc.CallOption) (*AcquireAesKeyResp, error) { + out := new(AcquireAesKeyResp) + err := c.cc.Invoke(ctx, "/OpenIMServer.aes_key.aesKey/AcquireAesKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aesKeyClient) AcquireAesKeys(ctx context.Context, in *AcquireAesKeysReq, opts ...grpc.CallOption) (*AcquireAesKeysResp, error) { + out := new(AcquireAesKeysResp) + err := c.cc.Invoke(ctx, "/OpenIMServer.aes_key.aesKey/AcquireAesKeys", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AesKeyServer is the server API for AesKey service. +type AesKeyServer interface { + AcquireAesKey(context.Context, *AcquireAesKeyReq) (*AcquireAesKeyResp, error) + AcquireAesKeys(context.Context, *AcquireAesKeysReq) (*AcquireAesKeysResp, error) +} + +// UnimplementedAesKeyServer can be embedded to have forward compatible implementations. +type UnimplementedAesKeyServer struct { +} + +func (*UnimplementedAesKeyServer) AcquireAesKey(context.Context, *AcquireAesKeyReq) (*AcquireAesKeyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AcquireAesKey not implemented") +} +func (*UnimplementedAesKeyServer) AcquireAesKeys(context.Context, *AcquireAesKeysReq) (*AcquireAesKeysResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AcquireAesKeys not implemented") +} + +func RegisterAesKeyServer(s *grpc.Server, srv AesKeyServer) { + s.RegisterService(&_AesKey_serviceDesc, srv) +} + +func _AesKey_AcquireAesKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcquireAesKeyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AesKeyServer).AcquireAesKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OpenIMServer.aes_key.aesKey/AcquireAesKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AesKeyServer).AcquireAesKey(ctx, req.(*AcquireAesKeyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _AesKey_AcquireAesKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcquireAesKeysReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AesKeyServer).AcquireAesKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OpenIMServer.aes_key.aesKey/AcquireAesKeys", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AesKeyServer).AcquireAesKeys(ctx, req.(*AcquireAesKeysReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _AesKey_serviceDesc = grpc.ServiceDesc{ + ServiceName: "OpenIMServer.aes_key.aesKey", + HandlerType: (*AesKeyServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AcquireAesKey", + Handler: _AesKey_AcquireAesKey_Handler, + }, + { + MethodName: "AcquireAesKeys", + Handler: _AesKey_AcquireAesKeys_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "aesKey/aesKey.proto", +} diff --git a/aeskey/aesKey.proto b/aeskey/aesKey.proto new file mode 100644 index 00000000..cf0848a9 --- /dev/null +++ b/aeskey/aesKey.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package OpenIMServer.aes_key; +option go_package = "github.com/OpenIMSDK/protocol/aesKey"; + + +message AesKey { + string keyConversationsID=1; + string key=2; + int32 conversationType=3; + string ownerUserID=4; + string friendUserID=5; + string groupID=6; +} +message AcquireAesKeyReq { + int32 conversationType=1; + string ownerUserID=2; + string friendUserID=3; + string groupID=4; +} + +message AcquireAesKeyResp { + AesKey aesKey=1; +} + +message AcquireAesKeysReq { + string UserID=1; +} + +message AcquireAesKeysResp { + repeated AesKey aesKeys=1; +} + +service aesKey { + rpc AcquireAesKey(AcquireAesKeyReq)returns(AcquireAesKeyResp); + rpc AcquireAesKeys(AcquireAesKeysReq)returns(AcquireAesKeysResp); +} \ No newline at end of file diff --git a/gen.sh b/gen.sh index 26fb7904..85053533 100644 --- a/gen.sh +++ b/gen.sh @@ -24,4 +24,5 @@ protoc --go_out=plugins=grpc:./sdkws --go_opt=module=github.com/OpenIMSDK/protoc protoc --go_out=plugins=grpc:./third --go_opt=module=github.com/OpenIMSDK/protocol/third third/third.proto protoc --go_out=plugins=grpc:./user --go_opt=module=github.com/OpenIMSDK/protocol/user user/user.proto protoc --go_out=plugins=grpc:./wrapperspb --go_opt=module=github.com/OpenIMSDK/protocol/wrapperspb wrapperspb/wrapperspb.proto -protoc --go_out=plugins=grpc:./statistics --go_opt=module=github.com/OpenIMSDK/protocol/statistics statistics/statistics.proto \ No newline at end of file +protoc --go_out=plugins=grpc:./statistics --go_opt=module=github.com/OpenIMSDK/protocol/statistics statistics/statistics.proto +protoc --go_out=plugins=grpc:./aesKey --go_opt=module=github.com/OpenIMSDK/protocol/aesKey aesKey/aesKey.proto \ No newline at end of file