From 5dbc9414ee5108608de883cad732445973cd5d51 Mon Sep 17 00:00:00 2001 From: ko_oler <kooler89@gmail.com> Date: Wed, 21 Feb 2024 16:41:12 +0300 Subject: [PATCH] log -> logs --- logs/client.go | 4 +- logs/middleware/logging_middleware.go | 122 +++++++------------------- logs/middleware/middleware.go | 7 +- perxis-proto | 2 +- proto/logs/log_service.pb.go | 40 ++++----- proto/logs/log_service_grpc.pb.go | 98 ++++++++++----------- 6 files changed, 108 insertions(+), 165 deletions(-) diff --git a/logs/client.go b/logs/client.go index b4d384b7..fc6a5b90 100644 --- a/logs/client.go +++ b/logs/client.go @@ -10,14 +10,14 @@ import ( ) type Client struct { - client pb.LogServiceClient + client pb.LogsServiceClient } var _ Service = &Client{} func NewClient(conn *grpc.ClientConn) *Client { return &Client{ - client: pb.NewLogServiceClient(conn), + client: pb.NewLogsServiceClient(conn), } } diff --git a/logs/middleware/logging_middleware.go b/logs/middleware/logging_middleware.go index 008f1251..3a425bf0 100644 --- a/logs/middleware/logging_middleware.go +++ b/logs/middleware/logging_middleware.go @@ -1,145 +1,89 @@ // Code generated by gowrap. DO NOT EDIT. -// template: ../../assets/templates/middleware/access_log +// template: ../../assets/templates/middleware/access_log.tmpl // gowrap: http://github.com/hexdigest/gowrap package middleware -//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/logs -i Service -t ../../assets/templates/middleware/access_log -o logging_middleware.go -l "" +//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/logs -i Service -t ../../assets/templates/middleware/access_log.tmpl -o logging_middleware.go -l "" import ( "context" - "fmt" "time" "git.perx.ru/perxis/perxis-go/logs" "git.perx.ru/perxis/perxis-go/pkg/auth" "git.perx.ru/perxis/perxis-go/pkg/options" "go.uber.org/zap" - "go.uber.org/zap/zapcore" ) -// loggingMiddleware implements logs.Service that is instrumented with logging -type loggingMiddleware struct { +// accessLoggingMiddleware implements logs.Service that is instrumented with logging +type accessLoggingMiddleware struct { logger *zap.Logger next logs.Service } -// LoggingMiddleware instruments an implementation of the logs.Service with simple logging -func LoggingMiddleware(logger *zap.Logger) Middleware { +// AccessLoggingMiddleware instruments an implementation of the logs.Service with simple logging +func AccessLoggingMiddleware(logger *zap.Logger) Middleware { return func(next logs.Service) logs.Service { - return &loggingMiddleware{ + return &accessLoggingMiddleware{ next: next, logger: logger, } } } -func (m *loggingMiddleware) Delete(ctx context.Context, filter *logs.Filter) (err error) { +func (m *accessLoggingMiddleware) Delete(ctx context.Context, filter *logs.Filter) (err error) { begin := time.Now() - var fields []zapcore.Field - for k, v := range map[string]interface{}{ - "ctx": ctx, - "filter": filter} { - if k == "ctx" { - fields = append(fields, zap.String("principal", fmt.Sprint(auth.GetPrincipal(ctx)))) - continue - } - fields = append(fields, zap.Reflect(k, v)) - } - m.logger.Debug("Delete.Request", fields...) + m.logger.Debug("Delete.Request", + zap.Reflect("principal", auth.GetPrincipal(ctx)), + zap.Reflect("filter", filter), + ) err = m.next.Delete(ctx, filter) - fields = []zapcore.Field{ + m.logger.Debug("Delete.Response", zap.Duration("time", time.Since(begin)), - } - - for k, v := range map[string]interface{}{ - "err": err} { - if k == "err" { - err, _ := v.(error) - fields = append(fields, zap.Error(err)) - continue - } - fields = append(fields, zap.Reflect(k, v)) - } - - m.logger.Debug("Delete.Response", fields...) + zap.Error(err), + ) return err } -func (m *loggingMiddleware) Find(ctx context.Context, filter *logs.Filter, options *options.FindOptions) (fp1 *logs.FindResult, err error) { +func (m *accessLoggingMiddleware) Find(ctx context.Context, filter *logs.Filter, options *options.FindOptions) (fp1 *logs.FindResult, err error) { begin := time.Now() - var fields []zapcore.Field - for k, v := range map[string]interface{}{ - "ctx": ctx, - "filter": filter, - "options": options} { - if k == "ctx" { - fields = append(fields, zap.String("principal", fmt.Sprint(auth.GetPrincipal(ctx)))) - continue - } - fields = append(fields, zap.Reflect(k, v)) - } - m.logger.Debug("Find.Request", fields...) + m.logger.Debug("Find.Request", + zap.Reflect("principal", auth.GetPrincipal(ctx)), + zap.Reflect("filter", filter), + zap.Reflect("options", options), + ) fp1, err = m.next.Find(ctx, filter, options) - fields = []zapcore.Field{ + m.logger.Debug("Find.Response", zap.Duration("time", time.Since(begin)), - } - - for k, v := range map[string]interface{}{ - "fp1": fp1, - "err": err} { - if k == "err" { - err, _ := v.(error) - fields = append(fields, zap.Error(err)) - continue - } - fields = append(fields, zap.Reflect(k, v)) - } - - m.logger.Debug("Find.Response", fields...) + zap.Reflect("fp1", fp1), + zap.Error(err), + ) return fp1, err } -func (m *loggingMiddleware) Log(ctx context.Context, entries []*logs.Entry) (err error) { +func (m *accessLoggingMiddleware) Log(ctx context.Context, entries []*logs.Entry) (err error) { begin := time.Now() - var fields []zapcore.Field - for k, v := range map[string]interface{}{ - "ctx": ctx, - "entries": entries} { - if k == "ctx" { - fields = append(fields, zap.String("principal", fmt.Sprint(auth.GetPrincipal(ctx)))) - continue - } - fields = append(fields, zap.Reflect(k, v)) - } - m.logger.Debug("Log.Request", fields...) + m.logger.Debug("Log.Request", + zap.Reflect("principal", auth.GetPrincipal(ctx)), + zap.Reflect("entries", entries), + ) err = m.next.Log(ctx, entries) - fields = []zapcore.Field{ + m.logger.Debug("Log.Response", zap.Duration("time", time.Since(begin)), - } - - for k, v := range map[string]interface{}{ - "err": err} { - if k == "err" { - err, _ := v.(error) - fields = append(fields, zap.Error(err)) - continue - } - fields = append(fields, zap.Reflect(k, v)) - } - - m.logger.Debug("Log.Response", fields...) + zap.Error(err), + ) return err } diff --git a/logs/middleware/middleware.go b/logs/middleware/middleware.go index bb9dfaf9..4ca25f19 100644 --- a/logs/middleware/middleware.go +++ b/logs/middleware/middleware.go @@ -1,10 +1,10 @@ // Code generated by gowrap. DO NOT EDIT. -// template: ../../assets/templates/middleware/middleware +// template: ../../assets/templates/middleware/middleware.tmpl // gowrap: http://github.com/hexdigest/gowrap package middleware -//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/logs -i Service -t ../../assets/templates/middleware/middleware -o middleware.go -l "" +//go:generate gowrap gen -p git.perx.ru/perxis/perxis-go/logs -i Service -t ../../assets/templates/middleware/middleware.tmpl -o middleware.go -l "" import ( "git.perx.ru/perxis/perxis-go/logs" @@ -17,11 +17,10 @@ func WithLog(s logs.Service, logger *zap.Logger, log_access bool) logs.Service { if logger == nil { logger = zap.NewNop() } - logger = logger.Named("Service") s = ErrorLoggingMiddleware(logger)(s) if log_access { - s = LoggingMiddleware(logger)(s) + s = AccessLoggingMiddleware(logger)(s) } s = RecoveringMiddleware(logger)(s) return s diff --git a/perxis-proto b/perxis-proto index 133d1dc3..ce52bc9e 160000 --- a/perxis-proto +++ b/perxis-proto @@ -1 +1 @@ -Subproject commit 133d1dc30c1d8503e6fe6bedaa628a7e64db71ef +Subproject commit ce52bc9e9a425f6d7d584a8996166f1841b01cde diff --git a/proto/logs/log_service.pb.go b/proto/logs/log_service.pb.go index 09497166..70367785 100644 --- a/proto/logs/log_service.pb.go +++ b/proto/logs/log_service.pb.go @@ -539,20 +539,20 @@ var file_logs_log_service_proto_rawDesc = []byte{ 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x32, 0xa2, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x2c, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x10, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x4c, - 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x6f, 0x67, 0x73, - 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, - 0x0a, 0x04, 0x46, 0x69, 0x6e, 0x64, 0x12, 0x11, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x46, 0x69, - 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x6f, 0x67, 0x73, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x35, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x6c, 0x6f, 0x67, 0x73, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, - 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2e, 0x5a, 0x2c, 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, 0x6c, 0x6f, 0x67, - 0x73, 0x3b, 0x6c, 0x6f, 0x67, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x32, 0xa3, 0x01, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x2c, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x10, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, + 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x6f, 0x67, + 0x73, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x2f, 0x0a, 0x04, 0x46, 0x69, 0x6e, 0x64, 0x12, 0x11, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x46, + 0x69, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x6f, 0x67, + 0x73, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x35, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x6c, 0x6f, 0x67, + 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x14, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2e, 0x5a, 0x2c, 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, 0x6c, 0x6f, + 0x67, 0x73, 0x3b, 0x6c, 0x6f, 0x67, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -593,12 +593,12 @@ var file_logs_log_service_proto_depIdxs = []int32{ 9, // 8: logs.FindResponse.error:type_name -> common.Error 2, // 9: logs.DeleteRequest.filter:type_name -> logs.Filter 9, // 10: logs.DeleteResponse.error:type_name -> common.Error - 0, // 11: logs.LogService.Log:input_type -> logs.LogRequest - 3, // 12: logs.LogService.Find:input_type -> logs.FindRequest - 6, // 13: logs.LogService.Delete:input_type -> logs.DeleteRequest - 1, // 14: logs.LogService.Log:output_type -> logs.LogResponse - 5, // 15: logs.LogService.Find:output_type -> logs.FindResponse - 7, // 16: logs.LogService.Delete:output_type -> logs.DeleteResponse + 0, // 11: logs.LogsService.Log:input_type -> logs.LogRequest + 3, // 12: logs.LogsService.Find:input_type -> logs.FindRequest + 6, // 13: logs.LogsService.Delete:input_type -> logs.DeleteRequest + 1, // 14: logs.LogsService.Log:output_type -> logs.LogResponse + 5, // 15: logs.LogsService.Find:output_type -> logs.FindResponse + 7, // 16: logs.LogsService.Delete:output_type -> logs.DeleteResponse 14, // [14:17] is the sub-list for method output_type 11, // [11:14] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name diff --git a/proto/logs/log_service_grpc.pb.go b/proto/logs/log_service_grpc.pb.go index a0af05d3..ad55cee2 100644 --- a/proto/logs/log_service_grpc.pb.go +++ b/proto/logs/log_service_grpc.pb.go @@ -19,15 +19,15 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - LogService_Log_FullMethodName = "/logs.LogService/Log" - LogService_Find_FullMethodName = "/logs.LogService/Find" - LogService_Delete_FullMethodName = "/logs.LogService/Delete" + LogsService_Log_FullMethodName = "/logs.LogsService/Log" + LogsService_Find_FullMethodName = "/logs.LogsService/Find" + LogsService_Delete_FullMethodName = "/logs.LogsService/Delete" ) -// LogServiceClient is the client API for LogService service. +// LogsServiceClient is the client API for LogsService 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 LogServiceClient interface { +type LogsServiceClient interface { // Метод для записи логов Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*LogResponse, error) // Метод для поиска логов по заданным параметрам @@ -36,152 +36,152 @@ type LogServiceClient interface { Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) } -type logServiceClient struct { +type logsServiceClient struct { cc grpc.ClientConnInterface } -func NewLogServiceClient(cc grpc.ClientConnInterface) LogServiceClient { - return &logServiceClient{cc} +func NewLogsServiceClient(cc grpc.ClientConnInterface) LogsServiceClient { + return &logsServiceClient{cc} } -func (c *logServiceClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*LogResponse, error) { +func (c *logsServiceClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*LogResponse, error) { out := new(LogResponse) - err := c.cc.Invoke(ctx, LogService_Log_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, LogsService_Log_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *logServiceClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindResponse, error) { +func (c *logsServiceClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindResponse, error) { out := new(FindResponse) - err := c.cc.Invoke(ctx, LogService_Find_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, LogsService_Find_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *logServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { +func (c *logsServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { out := new(DeleteResponse) - err := c.cc.Invoke(ctx, LogService_Delete_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, LogsService_Delete_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -// LogServiceServer is the server API for LogService service. -// All implementations must embed UnimplementedLogServiceServer +// LogsServiceServer is the server API for LogsService service. +// All implementations must embed UnimplementedLogsServiceServer // for forward compatibility -type LogServiceServer interface { +type LogsServiceServer interface { // Метод для записи логов Log(context.Context, *LogRequest) (*LogResponse, error) // Метод для поиска логов по заданным параметрам Find(context.Context, *FindRequest) (*FindResponse, error) // Метод для удаления логов по заданным параметрам Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) - mustEmbedUnimplementedLogServiceServer() + mustEmbedUnimplementedLogsServiceServer() } -// UnimplementedLogServiceServer must be embedded to have forward compatible implementations. -type UnimplementedLogServiceServer struct { +// UnimplementedLogsServiceServer must be embedded to have forward compatible implementations. +type UnimplementedLogsServiceServer struct { } -func (UnimplementedLogServiceServer) Log(context.Context, *LogRequest) (*LogResponse, error) { +func (UnimplementedLogsServiceServer) Log(context.Context, *LogRequest) (*LogResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Log not implemented") } -func (UnimplementedLogServiceServer) Find(context.Context, *FindRequest) (*FindResponse, error) { +func (UnimplementedLogsServiceServer) Find(context.Context, *FindRequest) (*FindResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Find not implemented") } -func (UnimplementedLogServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { +func (UnimplementedLogsServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") } -func (UnimplementedLogServiceServer) mustEmbedUnimplementedLogServiceServer() {} +func (UnimplementedLogsServiceServer) mustEmbedUnimplementedLogsServiceServer() {} -// UnsafeLogServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to LogServiceServer will +// UnsafeLogsServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LogsServiceServer will // result in compilation errors. -type UnsafeLogServiceServer interface { - mustEmbedUnimplementedLogServiceServer() +type UnsafeLogsServiceServer interface { + mustEmbedUnimplementedLogsServiceServer() } -func RegisterLogServiceServer(s grpc.ServiceRegistrar, srv LogServiceServer) { - s.RegisterService(&LogService_ServiceDesc, srv) +func RegisterLogsServiceServer(s grpc.ServiceRegistrar, srv LogsServiceServer) { + s.RegisterService(&LogsService_ServiceDesc, srv) } -func _LogService_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _LogsService_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LogRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(LogServiceServer).Log(ctx, in) + return srv.(LogsServiceServer).Log(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: LogService_Log_FullMethodName, + FullMethod: LogsService_Log_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LogServiceServer).Log(ctx, req.(*LogRequest)) + return srv.(LogsServiceServer).Log(ctx, req.(*LogRequest)) } return interceptor(ctx, in, info, handler) } -func _LogService_Find_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _LogsService_Find_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(FindRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(LogServiceServer).Find(ctx, in) + return srv.(LogsServiceServer).Find(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: LogService_Find_FullMethodName, + FullMethod: LogsService_Find_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LogServiceServer).Find(ctx, req.(*FindRequest)) + return srv.(LogsServiceServer).Find(ctx, req.(*FindRequest)) } return interceptor(ctx, in, info, handler) } -func _LogService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _LogsService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(LogServiceServer).Delete(ctx, in) + return srv.(LogsServiceServer).Delete(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: LogService_Delete_FullMethodName, + FullMethod: LogsService_Delete_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LogServiceServer).Delete(ctx, req.(*DeleteRequest)) + return srv.(LogsServiceServer).Delete(ctx, req.(*DeleteRequest)) } return interceptor(ctx, in, info, handler) } -// LogService_ServiceDesc is the grpc.ServiceDesc for LogService service. +// LogsService_ServiceDesc is the grpc.ServiceDesc for LogsService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var LogService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "logs.LogService", - HandlerType: (*LogServiceServer)(nil), +var LogsService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "logs.LogsService", + HandlerType: (*LogsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Log", - Handler: _LogService_Log_Handler, + Handler: _LogsService_Log_Handler, }, { MethodName: "Find", - Handler: _LogService_Find_Handler, + Handler: _LogsService_Find_Handler, }, { MethodName: "Delete", - Handler: _LogService_Delete_Handler, + Handler: _LogsService_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, -- GitLab