Documentation ¶
Index ¶
- func CommandStatsMessageProducer(ctx context.Context, format string, level logrus.Level, code codes.Code, ...)
- func StreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandStatsMessageProducer ¶
func CommandStatsMessageProducer(ctx context.Context, format string, level logrus.Level, code codes.Code, err error, fields logrus.Fields)
CommandStatsMessageProducer hooks into grpc_logrus to add more fields.
It replaces github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus.DefaultMessageProducer.
We cannot use ctxlogrus.AddFields() as it is not concurrency safe, and we may be logging concurrently. Conversely, command.Stats.Fields() is protected by a lock and can safely be called here.
func StreamInterceptor ¶
func StreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamInterceptor returns a Stream Interceptor
func UnaryInterceptor ¶
func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryInterceptor returns a Unary Interceptor
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.