1
0
mirror of https://github.com/ggicci/httpin.git synced 2024-12-10 10:00:07 +02:00
httpin/options.go

13 lines
327 B
Go
Raw Normal View History

package httpin
type option func(*Engine)
2021-07-11 12:53:13 +02:00
// 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
}
}