2023-07-31 10:48:32 +08:00

497 lines
16 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.29.1
// protoc v4.22.0
// source: key/key.proto
package key
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 GetKeyReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ConversationId string `protobuf:"bytes,1,opt,name=conversationId,proto3" json:"conversationId"`
ConversationType uint32 `protobuf:"varint,2,opt,name=conversationType,proto3" json:"conversationType"`
UserId string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId"`
}
func (x *GetKeyReq) Reset() {
*x = GetKeyReq{}
if protoimpl.UnsafeEnabled {
mi := &file_key_key_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetKeyReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetKeyReq) ProtoMessage() {}
func (x *GetKeyReq) ProtoReflect() protoreflect.Message {
mi := &file_key_key_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 GetKeyReq.ProtoReflect.Descriptor instead.
func (*GetKeyReq) Descriptor() ([]byte, []int) {
return file_key_key_proto_rawDescGZIP(), []int{0}
}
func (x *GetKeyReq) GetConversationId() string {
if x != nil {
return x.ConversationId
}
return ""
}
func (x *GetKeyReq) GetConversationType() uint32 {
if x != nil {
return x.ConversationType
}
return 0
}
func (x *GetKeyReq) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
type KeyResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"`
}
func (x *KeyResp) Reset() {
*x = KeyResp{}
if protoimpl.UnsafeEnabled {
mi := &file_key_key_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *KeyResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*KeyResp) ProtoMessage() {}
func (x *KeyResp) ProtoReflect() protoreflect.Message {
mi := &file_key_key_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 KeyResp.ProtoReflect.Descriptor instead.
func (*KeyResp) Descriptor() ([]byte, []int) {
return file_key_key_proto_rawDescGZIP(), []int{1}
}
func (x *KeyResp) GetKey() string {
if x != nil {
return x.Key
}
return ""
}
type GetAllKeyReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId"`
}
func (x *GetAllKeyReq) Reset() {
*x = GetAllKeyReq{}
if protoimpl.UnsafeEnabled {
mi := &file_key_key_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetAllKeyReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetAllKeyReq) ProtoMessage() {}
func (x *GetAllKeyReq) ProtoReflect() protoreflect.Message {
mi := &file_key_key_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 GetAllKeyReq.ProtoReflect.Descriptor instead.
func (*GetAllKeyReq) Descriptor() ([]byte, []int) {
return file_key_key_proto_rawDescGZIP(), []int{2}
}
func (x *GetAllKeyReq) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
type GetAllKeyResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Keys map[string]string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *GetAllKeyResp) Reset() {
*x = GetAllKeyResp{}
if protoimpl.UnsafeEnabled {
mi := &file_key_key_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetAllKeyResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetAllKeyResp) ProtoMessage() {}
func (x *GetAllKeyResp) ProtoReflect() protoreflect.Message {
mi := &file_key_key_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 GetAllKeyResp.ProtoReflect.Descriptor instead.
func (*GetAllKeyResp) Descriptor() ([]byte, []int) {
return file_key_key_proto_rawDescGZIP(), []int{3}
}
func (x *GetAllKeyResp) GetKeys() map[string]string {
if x != nil {
return x.Keys
}
return nil
}
var File_key_key_proto protoreflect.FileDescriptor
var file_key_key_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6b, 0x65, 0x79, 0x2f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x15, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x77, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79,
0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x63,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22,
0x1b, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x26, 0x0a, 0x0c,
0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06,
0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73,
0x65, 0x72, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4b,
0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x74,
0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x4b, 0x65,
0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x32, 0xa9, 0x01, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x06, 0x47,
0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65,
0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x41, 0x6c,
0x6c, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x74,
0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x42,
0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70,
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x6b, 0x65, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_key_key_proto_rawDescOnce sync.Once
file_key_key_proto_rawDescData = file_key_key_proto_rawDesc
)
func file_key_key_proto_rawDescGZIP() []byte {
file_key_key_proto_rawDescOnce.Do(func() {
file_key_key_proto_rawDescData = protoimpl.X.CompressGZIP(file_key_key_proto_rawDescData)
})
return file_key_key_proto_rawDescData
}
var file_key_key_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_key_key_proto_goTypes = []interface{}{
(*GetKeyReq)(nil), // 0: OpenIMServer.protobuf.GetKeyReq
(*KeyResp)(nil), // 1: OpenIMServer.protobuf.KeyResp
(*GetAllKeyReq)(nil), // 2: OpenIMServer.protobuf.GetAllKeyReq
(*GetAllKeyResp)(nil), // 3: OpenIMServer.protobuf.GetAllKeyResp
nil, // 4: OpenIMServer.protobuf.GetAllKeyResp.KeysEntry
}
var file_key_key_proto_depIdxs = []int32{
4, // 0: OpenIMServer.protobuf.GetAllKeyResp.keys:type_name -> OpenIMServer.protobuf.GetAllKeyResp.KeysEntry
0, // 1: OpenIMServer.protobuf.key.GetKey:input_type -> OpenIMServer.protobuf.GetKeyReq
2, // 2: OpenIMServer.protobuf.key.GetAllKey:input_type -> OpenIMServer.protobuf.GetAllKeyReq
1, // 3: OpenIMServer.protobuf.key.GetKey:output_type -> OpenIMServer.protobuf.KeyResp
3, // 4: OpenIMServer.protobuf.key.GetAllKey:output_type -> OpenIMServer.protobuf.GetAllKeyResp
3, // [3:5] is the sub-list for method output_type
1, // [1:3] 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_key_key_proto_init() }
func file_key_key_proto_init() {
if File_key_key_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_key_key_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetKeyReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_key_key_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KeyResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_key_key_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetAllKeyReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_key_key_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetAllKeyResp); 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_key_key_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_key_key_proto_goTypes,
DependencyIndexes: file_key_key_proto_depIdxs,
MessageInfos: file_key_key_proto_msgTypes,
}.Build()
File_key_key_proto = out.File
file_key_key_proto_rawDesc = nil
file_key_key_proto_goTypes = nil
file_key_key_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
// KeyClient is the client API for Key service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type KeyClient interface {
GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
GetAllKey(ctx context.Context, in *GetAllKeyReq, opts ...grpc.CallOption) (*GetAllKeyResp, error)
}
type keyClient struct {
cc grpc.ClientConnInterface
}
func NewKeyClient(cc grpc.ClientConnInterface) KeyClient {
return &keyClient{cc}
}
func (c *keyClient) GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error) {
out := new(KeyResp)
err := c.cc.Invoke(ctx, "/OpenIMServer.protobuf.key/GetKey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *keyClient) GetAllKey(ctx context.Context, in *GetAllKeyReq, opts ...grpc.CallOption) (*GetAllKeyResp, error) {
out := new(GetAllKeyResp)
err := c.cc.Invoke(ctx, "/OpenIMServer.protobuf.key/GetAllKey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// KeyServer is the server API for Key service.
type KeyServer interface {
GetKey(context.Context, *GetKeyReq) (*KeyResp, error)
GetAllKey(context.Context, *GetAllKeyReq) (*GetAllKeyResp, error)
}
// UnimplementedKeyServer can be embedded to have forward compatible implementations.
type UnimplementedKeyServer struct {
}
func (*UnimplementedKeyServer) GetKey(context.Context, *GetKeyReq) (*KeyResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented")
}
func (*UnimplementedKeyServer) GetAllKey(context.Context, *GetAllKeyReq) (*GetAllKeyResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetAllKey not implemented")
}
func RegisterKeyServer(s *grpc.Server, srv KeyServer) {
s.RegisterService(&_Key_serviceDesc, srv)
}
func _Key_GetKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetKeyReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(KeyServer).GetKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/OpenIMServer.protobuf.key/GetKey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KeyServer).GetKey(ctx, req.(*GetKeyReq))
}
return interceptor(ctx, in, info, handler)
}
func _Key_GetAllKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetAllKeyReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(KeyServer).GetAllKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/OpenIMServer.protobuf.key/GetAllKey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KeyServer).GetAllKey(ctx, req.(*GetAllKeyReq))
}
return interceptor(ctx, in, info, handler)
}
var _Key_serviceDesc = grpc.ServiceDesc{
ServiceName: "OpenIMServer.protobuf.key",
HandlerType: (*KeyServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetKey",
Handler: _Key_GetKey_Handler,
},
{
MethodName: "GetAllKey",
Handler: _Key_GetAllKey_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "key/key.proto",
}