grpc_middleware

package
v1.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheUnaryInterceptor

func CacheUnaryInterceptor(cache cache.Cacher, logger *zap.Logger) grpc.UnaryServerInterceptor

CacheUnaryInterceptor caches the response of a request if the request is cacheable. TODO: we could clean this up by using generics in 1.18+ to avoid the type switch/duplicate code.

func ErrorUnaryInterceptor

func ErrorUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

ErrorUnaryInterceptor intercepts known errors and returns the appropriate GRPC status code

func EvaluationUnaryInterceptor

func EvaluationUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

EvaluationUnaryInterceptor sets required request/response fields. Note: this should be added before any caching interceptor to ensure the request id/response fields are unique.

func ValidationUnaryInterceptor

func ValidationUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

ValidationUnaryInterceptor validates incoming requests

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL