Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggerFromContext ¶
LoggerFromContext returns a logger set by grpc server interceptor on each incoming context
func ServerStreamWithContext ¶
func ServerStreamWithContext(stream grpc.ServerStream, ctx context.Context) grpc.ServerStream
ServerStreamWithContext return new grpc.ServerStream with a new context
Types ¶
type ClientInterceptor ¶ added in v0.2.8
type ClientInterceptor struct {
// contains filtered or unexported fields
}
ClientInterceptor is a gRPC client interceptor for logging, metrics, and tracing
func NewClientInterceptor ¶ added in v0.2.8
func NewClientInterceptor(logger *log.Logger, mf *metrics.Factory, tracer opentracing.Tracer) *ClientInterceptor
NewClientInterceptor creates a new instance of gRPC server interceptor
func (*ClientInterceptor) StreamInterceptor ¶ added in v0.2.8
func (i *ClientInterceptor) StreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, fullMethod string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
StreamInterceptor is the gRPC StreamClientInterceptor for logging, metrics, and tracing
func (*ClientInterceptor) UnaryInterceptor ¶ added in v0.2.8
func (i *ClientInterceptor) UnaryInterceptor(ctx context.Context, fullMethod string, req, res interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryInterceptor is the gRPC UnaryClientInterceptor for logging, metrics, and tracing
type ServerInterceptor ¶ added in v0.2.8
type ServerInterceptor struct {
// contains filtered or unexported fields
}
ServerInterceptor is a gRPC server interceptor for logging, metrics, and tracing
func NewServerInterceptor ¶ added in v0.2.8
func NewServerInterceptor(logger *log.Logger, mf *metrics.Factory, tracer opentracing.Tracer) *ServerInterceptor
NewServerInterceptor creates a new instance of gRPC server interceptor
func (*ServerInterceptor) StreamInterceptor ¶ added in v0.2.8
func (i *ServerInterceptor) StreamInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamInterceptor is the gRPC StreamServerInterceptor for logging, metrics, and tracing
func (*ServerInterceptor) UnaryInterceptor ¶ added in v0.2.8
func (i *ServerInterceptor) UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryInterceptor is the gRPC UnaryServerInterceptor for logging, metrics, and tracing