Documentation ¶
Overview ¶
Package grpcx provides helper types and functions to work with gRPC.
Index ¶
- func LogStreamInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func LogUnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (resp any, err error)
- func RealIP(ctx context.Context) (string, error)
- func TimeoutStreamInterceptor(timeout time.Duration) grpc.StreamServerInterceptor
- type Logger
- func (l Logger) Error(args ...any)
- func (l Logger) Errorf(format string, args ...any)
- func (l Logger) Errorln(args ...any)
- func (l Logger) Fatal(args ...any)
- func (l Logger) Fatalf(format string, args ...any)
- func (l Logger) Fatalln(args ...any)
- func (l Logger) Info(args ...any)
- func (l Logger) Infof(format string, args ...any)
- func (l Logger) Infoln(args ...any)
- func (Logger) V(l int) bool
- func (l Logger) Warning(args ...any)
- func (l Logger) Warningf(format string, args ...any)
- func (l Logger) Warningln(args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogStreamInterceptor ¶ added in v0.4.0
func LogStreamInterceptor( srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler, ) error
LogStreamInterceptor logs gRPC streams.
func LogUnaryInterceptor ¶ added in v0.4.0
func LogUnaryInterceptor( ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, ) (resp any, err error)
LogUnaryInterceptor logs gRPC calls.
func TimeoutStreamInterceptor ¶ added in v0.4.0
func TimeoutStreamInterceptor(timeout time.Duration) grpc.StreamServerInterceptor
TimeoutStreamInterceptor returns a new unary server interceptor for timeout.
Types ¶
Click to show internal directories.
Click to hide internal directories.