Documentation ¶
Overview ¶
Package encode implements an encoder middleware for Caddy. The initial enhancements related to Accept-Encoding, minimum content length, and buffer/writer pools were adapted from https://github.com/xi2/httpgzip then modified heavily to accommodate modular encoders and fix bugs. Code borrowed from that repository is Copyright (c) 2015 The Httpgzip Authors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encode ¶
type Encode struct { EncodingsRaw map[string]json.RawMessage `json:"encodings,omitempty"` Prefer []string `json:"prefer,omitempty"` MinLength int `json:"minimum_length,omitempty"` // contains filtered or unexported fields }
Encode is a middleware which can encode responses.
func (Encode) CaddyModule ¶
func (Encode) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Encode) UnmarshalCaddyfile ¶
UnmarshalCaddyfile sets up the handler from Caddyfile tokens. Syntax:
encode [<matcher>] <formats...> { gzip [<level>] zstd brotli [<quality>] }
Specifying the formats on the first line will use those formats' defaults.
Click to show internal directories.
Click to hide internal directories.