MCPcopy
hub / github.com/labstack/echo / ContextTimeout

Function ContextTimeout

middleware/context_timeout.go:28–30  ·  view source on GitHub ↗

ContextTimeout returns a middleware which returns error (503 Service Unavailable error) to client when underlying method returns context.DeadlineExceeded error.

(timeout time.Duration)

Source from the content-addressed store, hash-verified

26// ContextTimeout returns a middleware which returns error (503 Service Unavailable error) to client
27// when underlying method returns context.DeadlineExceeded error.
28func ContextTimeout(timeout time.Duration) echo.MiddlewareFunc {
29 return ContextTimeoutWithConfig(ContextTimeoutConfig{Timeout: timeout})
30}
31
32// ContextTimeoutWithConfig returns a Timeout middleware with config.
33func ContextTimeoutWithConfig(config ContextTimeoutConfig) echo.MiddlewareFunc {

Callers 1

Calls 1

ContextTimeoutWithConfigFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…