Documentation ¶
Index ¶
- func ContentEncodingFromCompressionType(compressionType CompressionType) string
- func DropPort(ipport string) string
- func NewBrotliEncodingWriter(w io.Writer, compressionLevel int) io.Writer
- func NewGzipDecodingReader(body io.ReadCloser) (io.ReadCloser, error)
- func NewGzipEncodingWriter(w io.Writer, compressionLevel int) (io.Writer, error)
- func RequestIP(req *http.Request) string
- func StringInSlice(slice []string, s string) bool
- type CompressionType
- type Recompression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentEncodingFromCompressionType ¶ added in v1.1.0
func ContentEncodingFromCompressionType(compressionType CompressionType) string
func NewBrotliEncodingWriter ¶ added in v1.1.0
func NewGzipDecodingReader ¶ added in v1.1.0
func NewGzipDecodingReader(body io.ReadCloser) (io.ReadCloser, error)
func NewGzipEncodingWriter ¶ added in v1.1.0
func RequestIP ¶
RequestIP parses CF-Connecting-IP, X-Real-Ip and X-Forwarded-For headers to determine the original client IP
func StringInSlice ¶
StringInSlice looks for a string in a slice
Types ¶
type CompressionType ¶ added in v1.1.0
type CompressionType int
const ( CompressionTypeNone CompressionType = 0 CompressionTypeGzip CompressionType = 1 CompressionTypeBrotli CompressionType = 2 )
type Recompression ¶ added in v1.1.0
type Recompression struct { Add CompressionType Remove CompressionType }
func GetRecompression ¶ added in v1.1.0
func GetRecompression(acceptEncoding string, contentEncoding string, contentType string) Recompression
Click to show internal directories.
Click to hide internal directories.