mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-07 04:09:15 +02:00
feat:#36 added new event grpc message
This commit is contained in:
@@ -23,6 +23,8 @@ const _ = grpc.SupportPackageIsVersion7
|
||||
// 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)
|
||||
GetModules(ctx context.Context, in *GetModulesRequest, opts ...grpc.CallOption) (*GetModulesResponse, error)
|
||||
GetEventsForModules(ctx context.Context, in *GetModulesRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
|
||||
}
|
||||
|
||||
type moduleServiceClient struct {
|
||||
@@ -42,11 +44,31 @@ func (c *moduleServiceClient) GetModule(ctx context.Context, in *GetModuleReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *moduleServiceClient) GetModules(ctx context.Context, in *GetModulesRequest, opts ...grpc.CallOption) (*GetModulesResponse, error) {
|
||||
out := new(GetModulesResponse)
|
||||
err := c.cc.Invoke(ctx, "/ModuleService/GetModules", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *moduleServiceClient) GetEventsForModules(ctx context.Context, in *GetModulesRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) {
|
||||
out := new(GetEventsResponse)
|
||||
err := c.cc.Invoke(ctx, "/ModuleService/GetEventsForModules", 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)
|
||||
GetModules(context.Context, *GetModulesRequest) (*GetModulesResponse, error)
|
||||
GetEventsForModules(context.Context, *GetModulesRequest) (*GetEventsResponse, error)
|
||||
mustEmbedUnimplementedModuleServiceServer()
|
||||
}
|
||||
|
||||
@@ -57,6 +79,12 @@ type UnimplementedModuleServiceServer struct {
|
||||
func (UnimplementedModuleServiceServer) GetModule(context.Context, *GetModuleRequest) (*GetModuleResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetModule not implemented")
|
||||
}
|
||||
func (UnimplementedModuleServiceServer) GetModules(context.Context, *GetModulesRequest) (*GetModulesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetModules not implemented")
|
||||
}
|
||||
func (UnimplementedModuleServiceServer) GetEventsForModules(context.Context, *GetModulesRequest) (*GetEventsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetEventsForModules not implemented")
|
||||
}
|
||||
func (UnimplementedModuleServiceServer) mustEmbedUnimplementedModuleServiceServer() {}
|
||||
|
||||
// UnsafeModuleServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
@@ -88,6 +116,42 @@ func _ModuleService_GetModule_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModuleService_GetModules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetModulesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModuleServiceServer).GetModules(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ModuleService/GetModules",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModuleServiceServer).GetModules(ctx, req.(*GetModulesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ModuleService_GetEventsForModules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetModulesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ModuleServiceServer).GetEventsForModules(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ModuleService/GetEventsForModules",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ModuleServiceServer).GetEventsForModules(ctx, req.(*GetModulesRequest))
|
||||
}
|
||||
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)
|
||||
@@ -99,6 +163,14 @@ var ModuleService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetModule",
|
||||
Handler: _ModuleService_GetModule_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetModules",
|
||||
Handler: _ModuleService_GetModules_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetEventsForModules",
|
||||
Handler: _ModuleService_GetEventsForModules_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "modules.proto",
|
||||
|
Reference in New Issue
Block a user