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 FullMethod(service, method string) string
- 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 ClientReportable
- 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 FullMethod ¶
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 ClientReportable ¶
type NoopReporter ¶
type NoopReporter struct{}
func (NoopReporter) PostMsgReceive ¶
func (NoopReporter) PostMsgReceive(interface{}, error, time.Duration)
func (NoopReporter) PostMsgSend ¶
func (NoopReporter) PostMsgSend(interface{}, error, time.Duration)
Directories ¶
Path | Synopsis |
---|---|
logging is a "parent" package for gRPC logging middlewares.
|
logging is a "parent" package for gRPC logging middlewares. |
`ratelimit` a generic server-side ratelimit middleware for gRPC.
|
`ratelimit` a generic server-side ratelimit middleware for gRPC. |
`recovery` are interceptors that recover from gRPC handler panics.
|
`recovery` are interceptors that recover from gRPC handler panics. |
`retry` provides client-side request retry logic for gRPC.
|
`retry` provides client-side request retry logic for gRPC. |
`tags` adds a Tag object to the context that can be used by other middleware to add context about a request.
|
`tags` adds a Tag object to the context that can be used by other middleware to add context about a request. |
tracing is a "parent" package for gRPC logging middlewares.
|
tracing is a "parent" package for gRPC logging middlewares. |
`validator` is a generic request contents validator server-side middleware for gRPC.
|
`validator` is a generic request contents validator server-side middleware for gRPC. |