Documentation ¶
Overview ¶
interceptor is an internal package used by higher level middlewares. It allows injecting custom code in various places of the gRPC lifecycle.
This particular package is intended for use by other middleware, metric, logging or otherwise. This allows code to be shared between different implementations.
Index ¶
- Variables
- func StreamClientInterceptor(reportable ClientReportable) grpc.StreamClientInterceptor
- func StreamServerInterceptor(reportable ServerReportable) grpc.StreamServerInterceptor
- func UnaryClientInterceptor(reportable ClientReportable) grpc.UnaryClientInterceptor
- func UnaryServerInterceptor(reportable ServerReportable) grpc.UnaryServerInterceptor
- type CallMeta
- type ClientReportable
- type CommonReportableFunc
- type GRPCType
- type NoopReporter
- type Reporter
- type ServerReportable
Constants ¶
This section is empty.
Variables ¶
var ( AllCodes = []codes.Code{ codes.OK, codes.Canceled, codes.Unknown, codes.InvalidArgument, codes.DeadlineExceeded, codes.NotFound, codes.AlreadyExists, codes.PermissionDenied, codes.Unauthenticated, codes.ResourceExhausted, codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.Unimplemented, codes.Internal, codes.Unavailable, codes.DataLoss, } )
Functions ¶
func StreamClientInterceptor ¶
func StreamClientInterceptor(reportable ClientReportable) grpc.StreamClientInterceptor
StreamClientInterceptor is a gRPC client-side interceptor that provides reporting for Stream RPCs.
func StreamServerInterceptor ¶
func StreamServerInterceptor(reportable ServerReportable) grpc.StreamServerInterceptor
StreamServerInterceptor is a gRPC server-side interceptor that provides reporting for Streaming RPCs.
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(reportable ClientReportable) grpc.UnaryClientInterceptor
UnaryClientInterceptor is a gRPC client-side interceptor that provides reporting for Unary RPCs.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(reportable ServerReportable) grpc.UnaryServerInterceptor
UnaryServerInterceptor is a gRPC server-side interceptor that provides reporting for Unary RPCs.
Types ¶
type CallMeta ¶
func NewClientCallMeta ¶
func NewClientCallMeta(fullMethod string, streamDesc *grpc.StreamDesc, reqOrNil any) CallMeta
func NewServerCallMeta ¶
func NewServerCallMeta(fullMethod string, streamInfo *grpc.StreamServerInfo, reqOrNil any) CallMeta
func (CallMeta) FullMethod ¶
type ClientReportable ¶
type CommonReportableFunc ¶
CommonReportableFunc helper allows an easy way to implement reporter with common client and server logic.
func (CommonReportableFunc) ClientReporter ¶
func (CommonReportableFunc) ServerReporter ¶
type NoopReporter ¶
type NoopReporter struct{}
func (NoopReporter) PostMsgReceive ¶
func (NoopReporter) PostMsgReceive(any, error, time.Duration)
func (NoopReporter) PostMsgSend ¶
func (NoopReporter) PostMsgSend(any, error, time.Duration)
Directories ¶
Path | Synopsis |
---|---|
Package auth is a middleware that authenticates incoming gRPC requests.
|
Package auth is a middleware that authenticates incoming gRPC requests. |
Package logging is a "parent" package for gRPC logging middlewares.
|
Package logging is a "parent" package for gRPC logging middlewares. |
Package protovalidate is a request validator that uses https://github.com/bufbuild/protovalidate-go under the hood.
|
Package protovalidate is a request validator that uses https://github.com/bufbuild/protovalidate-go under the hood. |
Package ratelimit is a middleware that limits the rate of requests.
|
Package ratelimit is a middleware that limits the rate of requests. |
Package realip is a middleware that extracts the real IP of requests based on header values.
|
Package realip is a middleware that extracts the real IP of requests based on header values. |
Package recovery is a middleware that recovers from panics and logs the panic message.
|
Package recovery is a middleware that recovers from panics and logs the panic message. |
Package retry provides client-side request retry logic for gRPC.
|
Package retry provides client-side request retry logic for gRPC. |
Package selector
|
Package selector |
Package timeout is a middleware that responds with a timeout error after the given duration.
|
Package timeout is a middleware that responds with a timeout error after the given duration. |
Package validator
|
Package validator |