Documentation ¶
Index ¶
- func ContextWithHandle(ctx context.Context) context.Context
- func FromContext(ctx context.Context) *dispatch.ResponseMeta
- func SetInContext(ctx context.Context, metadata *dispatch.ResponseMeta)
- func StreamServerInterceptor() grpc.StreamServerInterceptor
- func UnaryServerInterceptor() grpc.UnaryServerInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithHandle ¶
ContextWithHandle creates a new context with a location to store metadata returned from a dispatched request.
This should only be called in middleware or testing functions.
func FromContext ¶
func FromContext(ctx context.Context) *dispatch.ResponseMeta
FromContext returns any metadata that was stored in the context.
This is useful for testing that a handler is properly setting the context.
func SetInContext ¶
func SetInContext(ctx context.Context, metadata *dispatch.ResponseMeta)
SetInContext should be called in a gRPC handler to correctly set the response metadata for the dispatched request.
func StreamServerInterceptor ¶
func StreamServerInterceptor() grpc.StreamServerInterceptor
StreamServerInterceptor implements a gRPC Middleware for reporting usage metrics in both the trailer of the request, as well as to the registered prometheus metrics
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
UnaryServerInterceptor implements a gRPC Middleware for reporting usage metrics in both the trailer of the request, as well as to the registered prometheus metrics.
Types ¶
This section is empty.