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