encoding

package module
v0.0.0-...-6ddeb91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 3 Imported by: 2

README

Encoding

Parsing HTTP Accept-Encoding headers

Points to note:

  • This code only cares whether a useragent supports a compression method or not. So q values of 0 means explictly unsupported, and positive q values means supported.
  • Parse() is allocation free.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoding

type Encoding uint8

Encoding represents a specific encoding/compression algorithm

const (
	Identity Encoding = iota
	Deflate
	Compress
	Gzip
	Brotli
	Zstd
)

func (Encoding) String

func (e Encoding) String() string

type EncodingSet

type EncodingSet uint32

EncodingSet a set of Encodings

func Parse

func Parse(acceptEncoding string) EncodingSet

Parse parses an Accept-Encoding client request header and returns the set of supported encodings

func (EncodingSet) Contains

func (es EncodingSet) Contains(e Encoding) bool

Contains returns true if EncodingSet es contains Encoding e, false otherwise.

func (EncodingSet) String

func (es EncodingSet) String() string

Directories

Path Synopsis
example module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL