BodyDumpConfig defines the config for BodyDump middleware.
| 17 | |
| 18 | // BodyDumpConfig defines the config for BodyDump middleware. |
| 19 | type BodyDumpConfig struct { |
| 20 | // Skipper defines a function to skip middleware. |
| 21 | Skipper Skipper |
| 22 | |
| 23 | // Handler receives request, response payloads and handler error if there are any. |
| 24 | // Required. |
| 25 | Handler BodyDumpHandler |
| 26 | |
| 27 | // MaxRequestBytes limits how much of the request body to dump. |
| 28 | // If the request body exceeds this limit, only the first MaxRequestBytes |
| 29 | // are dumped. The handler callback receives truncated data. |
| 30 | // Default: 5 * MB (5,242,880 bytes) |
| 31 | // Set to -1 to disable limits (not recommended in production). |
| 32 | MaxRequestBytes int64 |
| 33 | |
| 34 | // MaxResponseBytes limits how much of the response body to dump. |
| 35 | // If the response body exceeds this limit, only the first MaxResponseBytes |
| 36 | // are dumped. The handler callback receives truncated data. |
| 37 | // Default: 5 * MB (5,242,880 bytes) |
| 38 | // Set to -1 to disable limits (not recommended in production). |
| 39 | MaxResponseBytes int64 |
| 40 | } |
| 41 | |
| 42 | // BodyDumpHandler receives the request and response payload. |
| 43 | type BodyDumpHandler func(c *echo.Context, reqBody []byte, resBody []byte, err error) |
nothing calls this directly
no outgoing calls
no test coverage detected