feat:#36 added protobuf communication for modules

This commit is contained in:
Elmar Kresse
2024-06-17 00:59:33 +02:00
parent 8548a537ec
commit fad85f2884
18 changed files with 1286 additions and 59 deletions

View File

@@ -0,0 +1,509 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v5.27.1
// source: modules.proto
package modules
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Event struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
Day string `protobuf:"bytes,2,opt,name=day,proto3" json:"day,omitempty"`
Week string `protobuf:"bytes,3,opt,name=week,proto3" json:"week,omitempty"`
Start string `protobuf:"bytes,4,opt,name=start,proto3" json:"start,omitempty"`
End string `protobuf:"bytes,5,opt,name=end,proto3" json:"end,omitempty"`
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
EventType string `protobuf:"bytes,7,opt,name=eventType,proto3" json:"eventType,omitempty"`
Compulsory string `protobuf:"bytes,8,opt,name=compulsory,proto3" json:"compulsory,omitempty"`
Prof string `protobuf:"bytes,9,opt,name=prof,proto3" json:"prof,omitempty"`
Rooms string `protobuf:"bytes,10,opt,name=rooms,proto3" json:"rooms,omitempty"`
Notes string `protobuf:"bytes,11,opt,name=notes,proto3" json:"notes,omitempty"`
BookedAt string `protobuf:"bytes,12,opt,name=bookedAt,proto3" json:"bookedAt,omitempty"`
Course string `protobuf:"bytes,13,opt,name=course,proto3" json:"course,omitempty"`
Semester string `protobuf:"bytes,14,opt,name=semester,proto3" json:"semester,omitempty"`
}
func (x *Event) Reset() {
*x = Event{}
if protoimpl.UnsafeEnabled {
mi := &file_modules_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Event) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Event) ProtoMessage() {}
func (x *Event) ProtoReflect() protoreflect.Message {
mi := &file_modules_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 Event.ProtoReflect.Descriptor instead.
func (*Event) Descriptor() ([]byte, []int) {
return file_modules_proto_rawDescGZIP(), []int{0}
}
func (x *Event) GetUuid() string {
if x != nil {
return x.Uuid
}
return ""
}
func (x *Event) GetDay() string {
if x != nil {
return x.Day
}
return ""
}
func (x *Event) GetWeek() string {
if x != nil {
return x.Week
}
return ""
}
func (x *Event) GetStart() string {
if x != nil {
return x.Start
}
return ""
}
func (x *Event) GetEnd() string {
if x != nil {
return x.End
}
return ""
}
func (x *Event) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Event) GetEventType() string {
if x != nil {
return x.EventType
}
return ""
}
func (x *Event) GetCompulsory() string {
if x != nil {
return x.Compulsory
}
return ""
}
func (x *Event) GetProf() string {
if x != nil {
return x.Prof
}
return ""
}
func (x *Event) GetRooms() string {
if x != nil {
return x.Rooms
}
return ""
}
func (x *Event) GetNotes() string {
if x != nil {
return x.Notes
}
return ""
}
func (x *Event) GetBookedAt() string {
if x != nil {
return x.BookedAt
}
return ""
}
func (x *Event) GetCourse() string {
if x != nil {
return x.Course
}
return ""
}
func (x *Event) GetSemester() string {
if x != nil {
return x.Semester
}
return ""
}
type Module struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Prof string `protobuf:"bytes,3,opt,name=prof,proto3" json:"prof,omitempty"`
Course string `protobuf:"bytes,4,opt,name=course,proto3" json:"course,omitempty"`
Semester string `protobuf:"bytes,5,opt,name=semester,proto3" json:"semester,omitempty"`
Events []*Event `protobuf:"bytes,6,rep,name=events,proto3" json:"events,omitempty"`
}
func (x *Module) Reset() {
*x = Module{}
if protoimpl.UnsafeEnabled {
mi := &file_modules_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Module) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Module) ProtoMessage() {}
func (x *Module) ProtoReflect() protoreflect.Message {
mi := &file_modules_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 Module.ProtoReflect.Descriptor instead.
func (*Module) Descriptor() ([]byte, []int) {
return file_modules_proto_rawDescGZIP(), []int{1}
}
func (x *Module) GetUuid() string {
if x != nil {
return x.Uuid
}
return ""
}
func (x *Module) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Module) GetProf() string {
if x != nil {
return x.Prof
}
return ""
}
func (x *Module) GetCourse() string {
if x != nil {
return x.Course
}
return ""
}
func (x *Module) GetSemester() string {
if x != nil {
return x.Semester
}
return ""
}
func (x *Module) GetEvents() []*Event {
if x != nil {
return x.Events
}
return nil
}
type GetModuleRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
}
func (x *GetModuleRequest) Reset() {
*x = GetModuleRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_modules_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetModuleRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetModuleRequest) ProtoMessage() {}
func (x *GetModuleRequest) ProtoReflect() protoreflect.Message {
mi := &file_modules_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 GetModuleRequest.ProtoReflect.Descriptor instead.
func (*GetModuleRequest) Descriptor() ([]byte, []int) {
return file_modules_proto_rawDescGZIP(), []int{2}
}
func (x *GetModuleRequest) GetUuid() string {
if x != nil {
return x.Uuid
}
return ""
}
type GetModuleResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Module *Module `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"`
}
func (x *GetModuleResponse) Reset() {
*x = GetModuleResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_modules_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetModuleResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetModuleResponse) ProtoMessage() {}
func (x *GetModuleResponse) ProtoReflect() protoreflect.Message {
mi := &file_modules_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 GetModuleResponse.ProtoReflect.Descriptor instead.
func (*GetModuleResponse) Descriptor() ([]byte, []int) {
return file_modules_proto_rawDescGZIP(), []int{3}
}
func (x *GetModuleResponse) GetModule() *Module {
if x != nil {
return x.Module
}
return nil
}
var File_modules_proto protoreflect.FileDescriptor
var file_modules_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0xcb, 0x02, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12,
0x12, 0x0a, 0x04, 0x77, 0x65, 0x65, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x77,
0x65, 0x65, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x1c, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x6c, 0x73, 0x6f, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x6c, 0x73, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a,
0x04, 0x70, 0x72, 0x6f, 0x66, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x72, 0x6f,
0x66, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x6f, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x72, 0x6f, 0x6f, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73,
0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a,
0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x75,
0x72, 0x73, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x72, 0x73,
0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0e, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x98, 0x01,
0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x12, 0x0a, 0x04, 0x70, 0x72, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x70, 0x72, 0x6f, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x73, 0x65, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x73, 0x65, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74,
0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x26, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64,
0x22, 0x34, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x06,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x32, 0x45, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x12, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64,
0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x1c, 0x5a,
0x1a, 0x68, 0x74, 0x77, 0x6b, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_modules_proto_rawDescOnce sync.Once
file_modules_proto_rawDescData = file_modules_proto_rawDesc
)
func file_modules_proto_rawDescGZIP() []byte {
file_modules_proto_rawDescOnce.Do(func() {
file_modules_proto_rawDescData = protoimpl.X.CompressGZIP(file_modules_proto_rawDescData)
})
return file_modules_proto_rawDescData
}
var file_modules_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_modules_proto_goTypes = []interface{}{
(*Event)(nil), // 0: Event
(*Module)(nil), // 1: Module
(*GetModuleRequest)(nil), // 2: GetModuleRequest
(*GetModuleResponse)(nil), // 3: GetModuleResponse
}
var file_modules_proto_depIdxs = []int32{
0, // 0: Module.events:type_name -> Event
1, // 1: GetModuleResponse.module:type_name -> Module
2, // 2: ModuleService.GetModule:input_type -> GetModuleRequest
3, // 3: ModuleService.GetModule:output_type -> GetModuleResponse
3, // [3:4] is the sub-list for method output_type
2, // [2:3] 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_modules_proto_init() }
func file_modules_proto_init() {
if File_modules_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_modules_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Event); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_modules_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Module); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_modules_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetModuleRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_modules_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetModuleResponse); 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_modules_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_modules_proto_goTypes,
DependencyIndexes: file_modules_proto_depIdxs,
MessageInfos: file_modules_proto_msgTypes,
}.Build()
File_modules_proto = out.File
file_modules_proto_rawDesc = nil
file_modules_proto_goTypes = nil
file_modules_proto_depIdxs = nil
}

View File

@@ -0,0 +1,105 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v5.27.1
// source: modules.proto
package modules
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
// ModuleServiceClient is the client API for ModuleService 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 ModuleServiceClient interface {
GetModule(ctx context.Context, in *GetModuleRequest, opts ...grpc.CallOption) (*GetModuleResponse, error)
}
type moduleServiceClient struct {
cc grpc.ClientConnInterface
}
func NewModuleServiceClient(cc grpc.ClientConnInterface) ModuleServiceClient {
return &moduleServiceClient{cc}
}
func (c *moduleServiceClient) GetModule(ctx context.Context, in *GetModuleRequest, opts ...grpc.CallOption) (*GetModuleResponse, error) {
out := new(GetModuleResponse)
err := c.cc.Invoke(ctx, "/ModuleService/GetModule", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ModuleServiceServer is the server API for ModuleService service.
// All implementations must embed UnimplementedModuleServiceServer
// for forward compatibility
type ModuleServiceServer interface {
GetModule(context.Context, *GetModuleRequest) (*GetModuleResponse, error)
mustEmbedUnimplementedModuleServiceServer()
}
// UnimplementedModuleServiceServer must be embedded to have forward compatible implementations.
type UnimplementedModuleServiceServer struct {
}
func (UnimplementedModuleServiceServer) GetModule(context.Context, *GetModuleRequest) (*GetModuleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetModule not implemented")
}
func (UnimplementedModuleServiceServer) mustEmbedUnimplementedModuleServiceServer() {}
// UnsafeModuleServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ModuleServiceServer will
// result in compilation errors.
type UnsafeModuleServiceServer interface {
mustEmbedUnimplementedModuleServiceServer()
}
func RegisterModuleServiceServer(s grpc.ServiceRegistrar, srv ModuleServiceServer) {
s.RegisterService(&ModuleService_ServiceDesc, srv)
}
func _ModuleService_GetModule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetModuleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ModuleServiceServer).GetModule(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ModuleService/GetModule",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ModuleServiceServer).GetModule(ctx, req.(*GetModuleRequest))
}
return interceptor(ctx, in, info, handler)
}
// ModuleService_ServiceDesc is the grpc.ServiceDesc for ModuleService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ModuleService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ModuleService",
HandlerType: (*ModuleServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetModule",
Handler: _ModuleService_GetModule_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "modules.proto",
}