1
0
mirror of https://github.com/ggicci/httpin.git synced 2024-12-02 09:01:33 +02:00
httpin/options.go
2021-07-11 18:53:13 +08:00

13 lines
327 B
Go

package httpin
type option func(*Engine)
// WithErrorStatusCode configures the HTTP status code sent to the client when
// decoding a request failed. Which is used in the `NewInput` middleware.
// The default value is 422.
func WithErrorStatusCode(code int) option {
return func(c *Engine) {
c.errorStatusCode = code
}
}