package
5.1.6+incompatible
Repository: https://github.com/apache/trafficcontrol.git
Documentation: pkg.go.dev

# Functions

AcceptsGzip returns whether r accepts gzip encoding, per RFC7231§5.3.4.
CanCache returns whether an object can be cached per RFC 7234, based on the request headers, response headers, and response code.
CanReuseStored checks the constraints in RFC7234§4.
ETag takes the last time the object was modified, and returns an ETag string.
FormatHTTPDate formats t as an RFC7231§7.1.1 HTTP-date.
FreshFor gives a duration for which an HTTP response may still be cached - from the time of the request.
GetHTTPDate is a helper function which gets an HTTP date from the given map (which is typically a `http.Header` or `CacheControl`.
GetHTTPDeltaSeconds is a helper function which gets an HTTP Delta Seconds from the given map (which is typically a `http.Header` or `CacheControl`).
GetUnmodifiedTime gets the latest time out of the Etags (if present), or the If-Unmodified-Since (if present).
MimeTypesFromAccept constructs a *sorted* list of MimeTypes from the provided text, which is assumed to be from an HTTP 'Accept' header.
NewMimeType creates a new MimeType, initializing its Parameters map.
ParseCacheControl parses the Cache-Control header from the headers object, and returns the parsed map of cache control directives.
ParseETag takes a complete ETag header string, including the quotes (if the client correctly set them), and returns the last modified time encoded in the ETag.
ParseETags the latest time of any valid ETag, and whether a valid ETag was found.
ParseHTTPDate parses the given RFC7231§7.1.1 HTTP-date.
SortMimeTypes sorts the passed MimeTypes according to their "quality value".

# Constants

RFC7231§5.3.4.
RFC4627§6.
RFC2046§4.5.2.
RFC7234§5.2.
RFC6266.
RFC7231§3.1.2.2.
RFC7231§3.1.1.5.
RFC1341§7.2.
RFC2046§4.1.
RFC2483§5.
No description provided by the author
No description provided by the author
RFC7230§4.2.3.
No description provided by the author
RFC7232§3.3.
No description provided by the author
RFC7232§2.2.
ReuseCan indicates that the cached response may be served.
ReuseCannot indicates that the cached response must not be served.
ReuseMustRevalidate indicates that the cached response must be revalidated, and cannot be served stale if revalidation fails for some reason.
ReuseMustRevalidateCanStale indicates the response must be revalidated, but if the parent cannot be reached, may be served stale, per RFC7234§4.2.4.
RFC7231§7.1.4.

# Variables

CacheableRequestMethods is the list of all request methods which elicit cache-able responses.
CacheableResponseCodes provides fast lookup of whether a HTTP response code is cache-able by default.
MIME_CSS is a pre-defined MimeType for CSS data.
MIME_HTML is a pre-defined MimeType for HTML data.
MIME_JS is a pre-defined MimeType for JavaScript data.
MIME_JSON is a pre-defined MimeType for JSON data.
MIME_PLAINTEXT is a pre-defined MimeType for plain text data.
ValidHTTPCodes provides fast lookup of whether a HTTP response code is valid.

# Structs

EmailAddress is an alias of net/mail.Address that implements JSON encoding and decoding, as well as scanning from database driver values.
MimeType represents a "Media Type" as defined by RFC6838, along with some ease-of-use functionality.
URL is an alias of net/url.URL that implements JSON encoding and decoding, as well as scanning from database driver values.

# Type aliases

CacheControlMap is the parameters found in an HTTP Cache-Control header, each mapped to its specified value.
Reuse is an "enumerated" type describing the necessary behavior of a cache with regard to its cached objects.