From 10d4be8a534ca4602b7bfd1eab091ba6a313fe54 Mon Sep 17 00:00:00 2001 From: Anton Sattarov <sattarov@perx.ru> Date: Thu, 27 Jul 2023 11:09:21 +0300 Subject: [PATCH] gen go grpc by proto --- perxis-proto | 2 +- proto/references/references.pb.go | 259 ++++++++++++++++++++++--- proto/references/references_grpc.pb.go | 63 +++++- 3 files changed, 294 insertions(+), 30 deletions(-) diff --git a/perxis-proto b/perxis-proto index f000812a..062d090c 160000 --- a/perxis-proto +++ b/perxis-proto @@ -1 +1 @@ -Subproject commit f000812a1eef24093c0d0abf1318e3179b679773 +Subproject commit 062d090c3a8e44d3cc4ca61678bf58c0e7377812 diff --git a/proto/references/references.pb.go b/proto/references/references.pb.go index 02bfc590..3ed0a65b 100644 --- a/proto/references/references.pb.go +++ b/proto/references/references.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.0 -// protoc v3.21.12 +// protoc-gen-go v1.31.0 +// protoc v4.23.4 // source: references/references.proto package references @@ -202,6 +202,150 @@ func (x *GetResponse) GetNotfound() []*Reference { return nil } +// PublishRequest запрос на публикацию записей по ссылкам +type PublishRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SpaceId string `protobuf:"bytes,1,opt,name=space_id,json=spaceId,proto3" json:"space_id,omitempty"` // Пространство публикации + EnvId string `protobuf:"bytes,2,opt,name=env_id,json=envId,proto3" json:"env_id,omitempty"` // Окружение публикации + References []*Reference `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty"` // Список ссылок на записи для публикации + Recursive bool `protobuf:"varint,4,opt,name=recursive,proto3" json:"recursive,omitempty"` // Рекурсивно публиковать все ссылки на найденные записи + Force bool `protobuf:"varint,5,opt,name=force,proto3" json:"force,omitempty"` // Принудительно публиковать записи, даже если они содержат не опубликованные ссылки +} + +func (x *PublishRequest) Reset() { + *x = PublishRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_references_references_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublishRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublishRequest) ProtoMessage() {} + +func (x *PublishRequest) ProtoReflect() protoreflect.Message { + mi := &file_references_references_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 PublishRequest.ProtoReflect.Descriptor instead. +func (*PublishRequest) Descriptor() ([]byte, []int) { + return file_references_references_proto_rawDescGZIP(), []int{3} +} + +func (x *PublishRequest) GetSpaceId() string { + if x != nil { + return x.SpaceId + } + return "" +} + +func (x *PublishRequest) GetEnvId() string { + if x != nil { + return x.EnvId + } + return "" +} + +func (x *PublishRequest) GetReferences() []*Reference { + if x != nil { + return x.References + } + return nil +} + +func (x *PublishRequest) GetRecursive() bool { + if x != nil { + return x.Recursive + } + return false +} + +func (x *PublishRequest) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +// PublishResponse ответ на запрос публикации записей +type PublishResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Published []*Reference `protobuf:"bytes,2,rep,name=published,proto3" json:"published,omitempty"` // Список опубликованных записей + Notfound []*Reference `protobuf:"bytes,3,rep,name=notfound,proto3" json:"notfound,omitempty"` // Список не найденных записей + Unpublished []*Reference `protobuf:"bytes,4,rep,name=unpublished,proto3" json:"unpublished,omitempty"` // Список не опубликованных записей, требующих публикации +} + +func (x *PublishResponse) Reset() { + *x = PublishResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_references_references_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublishResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublishResponse) ProtoMessage() {} + +func (x *PublishResponse) ProtoReflect() protoreflect.Message { + mi := &file_references_references_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 PublishResponse.ProtoReflect.Descriptor instead. +func (*PublishResponse) Descriptor() ([]byte, []int) { + return file_references_references_proto_rawDescGZIP(), []int{4} +} + +func (x *PublishResponse) GetPublished() []*Reference { + if x != nil { + return x.Published + } + return nil +} + +func (x *PublishResponse) GetNotfound() []*Reference { + if x != nil { + return x.Notfound + } + return nil +} + +func (x *PublishResponse) GetUnpublished() []*Reference { + if x != nil { + return x.Unpublished + } + return nil +} + var File_references_references_proto protoreflect.FileDescriptor var file_references_references_proto_rawDesc = []byte{ @@ -230,17 +374,46 @@ var file_references_references_proto_rawDesc = []byte{ 0x6f, 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x6e, 0x6f, - 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x32, 0x56, 0x0a, 0x0a, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1e, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, - 0x5a, 0x38, 0x67, 0x69, 0x74, 0x2e, 0x70, 0x65, 0x72, 0x78, 0x2e, 0x72, 0x75, 0x2f, 0x70, 0x65, - 0x72, 0x78, 0x69, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2d, 0x67, 0x6f, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x3b, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0xb5, 0x01, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x76, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x76, 0x49, 0x64, 0x12, 0x3d, 0x0a, 0x0a, 0x72, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, + 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, + 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0xca, + 0x01, 0x0a, 0x0f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, + 0x39, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x08, 0x6e, 0x6f, 0x74, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3f, 0x0a, 0x0b, 0x75, 0x6e, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, + 0x75, 0x6e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x32, 0xac, 0x01, 0x0a, 0x0a, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x03, 0x47, 0x65, + 0x74, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, + 0x22, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, + 0x74, 0x2e, 0x70, 0x65, 0x72, 0x78, 0x2e, 0x72, 0x75, 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, + 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x3b, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -255,24 +428,32 @@ func file_references_references_proto_rawDescGZIP() []byte { return file_references_references_proto_rawDescData } -var file_references_references_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_references_references_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_references_references_proto_goTypes = []interface{}{ - (*Reference)(nil), // 0: content.references.Reference - (*GetRequest)(nil), // 1: content.references.GetRequest - (*GetResponse)(nil), // 2: content.references.GetResponse - (*items.Item)(nil), // 3: content.items.Item + (*Reference)(nil), // 0: content.references.Reference + (*GetRequest)(nil), // 1: content.references.GetRequest + (*GetResponse)(nil), // 2: content.references.GetResponse + (*PublishRequest)(nil), // 3: content.references.PublishRequest + (*PublishResponse)(nil), // 4: content.references.PublishResponse + (*items.Item)(nil), // 5: content.items.Item } var file_references_references_proto_depIdxs = []int32{ 0, // 0: content.references.GetRequest.references:type_name -> content.references.Reference - 3, // 1: content.references.GetResponse.items:type_name -> content.items.Item + 5, // 1: content.references.GetResponse.items:type_name -> content.items.Item 0, // 2: content.references.GetResponse.notfound:type_name -> content.references.Reference - 1, // 3: content.references.References.Get:input_type -> content.references.GetRequest - 2, // 4: content.references.References.Get:output_type -> content.references.GetResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 0, // 3: content.references.PublishRequest.references:type_name -> content.references.Reference + 0, // 4: content.references.PublishResponse.published:type_name -> content.references.Reference + 0, // 5: content.references.PublishResponse.notfound:type_name -> content.references.Reference + 0, // 6: content.references.PublishResponse.unpublished:type_name -> content.references.Reference + 1, // 7: content.references.References.Get:input_type -> content.references.GetRequest + 3, // 8: content.references.References.Publish:input_type -> content.references.PublishRequest + 2, // 9: content.references.References.Get:output_type -> content.references.GetResponse + 4, // 10: content.references.References.Publish:output_type -> content.references.PublishResponse + 9, // [9:11] is the sub-list for method output_type + 7, // [7:9] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_references_references_proto_init() } @@ -317,6 +498,30 @@ func file_references_references_proto_init() { return nil } } + file_references_references_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublishRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_references_references_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublishResponse); 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{ @@ -324,7 +529,7 @@ func file_references_references_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_references_references_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/references/references_grpc.pb.go b/proto/references/references_grpc.pb.go index 45c5711e..61a8dbdb 100644 --- a/proto/references/references_grpc.pb.go +++ b/proto/references/references_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.12 +// - protoc v4.23.4 // source: references/references.proto package references @@ -19,14 +19,27 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - References_Get_FullMethodName = "/content.references.References/Get" + References_Get_FullMethodName = "/content.references.References/Get" + References_Publish_FullMethodName = "/content.references.References/Publish" ) // ReferencesClient is the client API for References 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 ReferencesClient interface { + // Get возвращает список записей по ссылкам Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) + // Publish принимает список ссылок на записи и публикует их с учетом вложенных ссылок. + // + // - В случае если флаг `recursive` установлен в true, то будут рекурсивно опубликованы + // все записи на которые ссылаются найденные записи. + // - Если флаг `recursive` установлен в false, то будут опубликованы записи + // только из списка `references` в случае если они не содержат не опубликованных + // ссылок. В противном случае возвращается список не опубликованных записей `unpublished` + // которые требуют публикации. Список `published` при этом будет пустым. В случае если флаг + // `force` установлен в true, то записи будут опубликованы даже если они содержат + // не опубликованные ссылки. + Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) } type referencesClient struct { @@ -46,11 +59,32 @@ func (c *referencesClient) Get(ctx context.Context, in *GetRequest, opts ...grpc return out, nil } +func (c *referencesClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) { + out := new(PublishResponse) + err := c.cc.Invoke(ctx, References_Publish_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ReferencesServer is the server API for References service. // All implementations must embed UnimplementedReferencesServer // for forward compatibility type ReferencesServer interface { + // Get возвращает список записей по ссылкам Get(context.Context, *GetRequest) (*GetResponse, error) + // Publish принимает список ссылок на записи и публикует их с учетом вложенных ссылок. + // + // - В случае если флаг `recursive` установлен в true, то будут рекурсивно опубликованы + // все записи на которые ссылаются найденные записи. + // - Если флаг `recursive` установлен в false, то будут опубликованы записи + // только из списка `references` в случае если они не содержат не опубликованных + // ссылок. В противном случае возвращается список не опубликованных записей `unpublished` + // которые требуют публикации. Список `published` при этом будет пустым. В случае если флаг + // `force` установлен в true, то записи будут опубликованы даже если они содержат + // не опубликованные ссылки. + Publish(context.Context, *PublishRequest) (*PublishResponse, error) mustEmbedUnimplementedReferencesServer() } @@ -61,6 +95,9 @@ type UnimplementedReferencesServer struct { func (UnimplementedReferencesServer) Get(context.Context, *GetRequest) (*GetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } +func (UnimplementedReferencesServer) Publish(context.Context, *PublishRequest) (*PublishResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented") +} func (UnimplementedReferencesServer) mustEmbedUnimplementedReferencesServer() {} // UnsafeReferencesServer may be embedded to opt out of forward compatibility for this service. @@ -92,6 +129,24 @@ func _References_Get_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _References_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReferencesServer).Publish(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: References_Publish_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReferencesServer).Publish(ctx, req.(*PublishRequest)) + } + return interceptor(ctx, in, info, handler) +} + // References_ServiceDesc is the grpc.ServiceDesc for References service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -103,6 +158,10 @@ var References_ServiceDesc = grpc.ServiceDesc{ MethodName: "Get", Handler: _References_Get_Handler, }, + { + MethodName: "Publish", + Handler: _References_Publish_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "references/references.proto", -- GitLab