(s *Service)
| 44 | } |
| 45 | |
| 46 | func validateApiKeyMiddleware(s *Service) grpc.UnaryServerInterceptor { |
| 47 | return func( |
| 48 | ctx context.Context, |
| 49 | req interface{}, |
| 50 | info *grpc.UnaryServerInfo, |
| 51 | handler grpc.UnaryHandler, |
| 52 | ) (interface{}, error) { |
| 53 | if err := validateApiKey(ctx, s); err != nil { |
| 54 | return nil, err |
| 55 | } |
| 56 | |
| 57 | return handler(ctx, req) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func validateApiKeyStreamMiddleware(s *Service) grpc.StreamServerInterceptor { |
| 62 | return func( |
no test coverage detected