Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStatusRequestEntityTooLarge = errors.New("request entity too large")
)
Functions ¶
Types ¶
type BodyLimitConfig ¶
type BodyLimitConfig struct { Limit byteutil.Size // limit byte size of request body OnError http.HandlerFunc // custom error handler }
BodyLimitConfig is configuration of BodyLimit middleware.
type Middleware ¶
Middleware is http server middleware function.
func BodyLimitWithConfig ¶
func BodyLimitWithConfig(config BodyLimitConfig) Middleware
BodyLimitWithConfig is limiting body size.
func ContentEncoding ¶
func ContentEncoding(encodings ...encoding.Encoding) Middleware
ContentEncoding decodes the request data according to the Content-Encoding header, and encodes the response data according to the Accept-Encoding header.
func ContentType ¶
func ContentType(types ...string) Middleware
ContentType is checks the value of the Content-Type header and returns an error if it does not match. If the HTTP method is either GET, HEAD, CONNECT, OPTIONS, TRACE, the checking process will be skipped.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.