// AddInterceptors AddInterceptors: Add interceptors to the grpc server
AddInterceptors AddInterceptors: Add interceptors to the grpc server
// AddInterceptors AddInterceptors : Add interceptors to the grpc server
func AddInterceptors(logger *zap.Logger, tracer opentracing.Tracer, opts []grpc.ServerOption) []grpc.ServerOption {
	grpc_zap.ReplaceGrpcLoggerV2(logger)
	recoveryOptions := []grpc_recovery.Option{
		grpc_recovery.WithRecoveryHandler(grpcPanicsRecovery),
	}
	opts = append(opts, grpc_middleware.WithUnaryServerChain(
		grpc_recovery.UnaryServerInterceptor(recoveryOptions...),
		grpc_ctxtags.UnaryServerInterceptor(grpc_ctxtags.WithFieldExtractor(grpc_ctxtags.CodeGenRequestFieldExtractor)),
		grpc_opentracing.UnaryServerInterceptor(grpc_opentracing.WithTracer(tracer)),
		grpc_prometheus.UnaryServerInterceptor,
		grpc_zap.UnaryServerInterceptor(logger),
		grpc_auth.UnaryServerInterceptor(AuthMiddleware),
		grpc_validator.UnaryServerInterceptor(),
	))
	opts = append(opts, grpc_middleware.WithStreamServerChain(
		grpc_recovery.StreamServerInterceptor(recoveryOptions...),
		grpc_ctxtags.StreamServerInterceptor(grpc_ctxtags.WithFieldExtractor(grpc_ctxtags.CodeGenRequestFieldExtractor)),
		grpc_opentracing.StreamServerInterceptor(),
		grpc_prometheus.StreamServerInterceptor,
		grpc_auth.StreamServerInterceptor(AuthMiddleware),
		grpc_zap.StreamServerInterceptor(logger),
		grpc_validator.StreamServerInterceptor(),
	))
	return opts
}
func AddInterceptors ( logger * zap . Logger , tracer opentracing . Tracer , opts [ ] grpc . ServerOption ) [ ] grpc . ServerOption { grpc_zap . ReplaceGrpcLoggerV2 ( logger ) recoveryOptions := [ ] grpc_recovery . Option { grpc_recovery . WithRecoveryHandler ( grpcPanicsRecovery ) , } opts = append ( opts , grpc_middleware . WithUnaryServerChain ( grpc_recovery . UnaryServerInterceptor ( recoveryOptions ... ) , grpc_ctxtags . UnaryServerInterceptor ( grpc_ctxtags . WithFieldExtractor ( grpc_ctxtags . CodeGenRequestFieldExtractor ) ) , grpc_opentracing . UnaryServerInterceptor ( grpc_opentracing . WithTracer ( tracer ) ) , grpc_prometheus . UnaryServerInterceptor , grpc_zap . UnaryServerInterceptor ( logger ) , grpc_auth . UnaryServerInterceptor ( AuthMiddleware ) , grpc_validator . UnaryServerInterceptor ( ) , ) ) opts = append ( opts , grpc_middleware . WithStreamServerChain ( grpc_recovery . StreamServerInterceptor ( recoveryOptions ... ) , grpc_ctxtags . StreamServerInterceptor ( grpc_ctxtags . WithFieldExtractor ( grpc_ctxtags . CodeGenRequestFieldExtractor ) ) , grpc_opentracing . StreamServerInterceptor ( ) , grpc_prometheus . StreamServerInterceptor , grpc_auth . StreamServerInterceptor ( AuthMiddleware ) , grpc_zap . StreamServerInterceptor ( logger ) , grpc_validator . StreamServerInterceptor ( ) , ) ) return opts }
AddInterceptors AddInterceptors: Add interceptors to the grpc server
AddInterceptors AddInterceptors : Add interceptors to the grpc server
// Make sure that log statements internal to gRPC library are logged using the zapLogger as well. //grpc recovery options // Add unary interceptor //turns grpc panics into unknown error //for context tags //Adding prothesis monitoring //zap logger implementation //validate the incoming request - inbound in proto file //If request is not correct the error will be sent to client // Add stream interceptor (added as an example here) //context tag implementation //open tracing implementation //prom implementation //zap implementation //validate the incoming request - inbound in proto file //If request is not correct the error will be sent to client