MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / WithMiddlewares

Function WithMiddlewares

runtime/mux.go:124–128  ·  view source on GitHub ↗

WithMiddlewares sets server middleware for all handlers. This is useful as an alternative to gRPC interceptors when using the direct-to-implementation registration methods and cannot rely on gRPC interceptors. It's recommended to use gRPC interceptors instead if possible.

(middlewares ...Middleware)

Source from the content-addressed store, hash-verified

122// interceptors when using the direct-to-implementation registration methods and cannot rely
123// on gRPC interceptors. It's recommended to use gRPC interceptors instead if possible.
124func WithMiddlewares(middlewares ...Middleware) ServeMuxOption {
125 return func(serveMux *ServeMux) {
126 serveMux.middlewares = append(serveMux.middlewares, middlewares...)
127 }
128}
129
130// WithDisableChunkedEncoding disables the Transfer-Encoding: chunked header
131// for streaming responses. This is useful for streaming implementations that use

Callers 1

Calls

no outgoing calls

Tested by 1