Documentation ¶
Overview ¶
Package headers provides functionality for HTTP Headers not provided by the builtin net/http package
Index ¶
- Constants
- func AddProxyHeaders(remoteAddr string, headers http.Header)
- func AddResponseHeaders(headers http.Header)
- func ExtractHeader(headers http.Header, header string) (string, bool)
- func Merge(dst, src http.Header)
- func RemoveClientHeaders(headers http.Header)
- func SetResultsHeader(headers http.Header, engine, status, ffstatus string, ...)
- func String(h http.Header) string
- func UpdateHeaders(headers http.Header, updates map[string]string)
Constants ¶
const ( // ValueApplicationJSON represents the HTTP Header Value of "application/json" ValueApplicationJSON = "application/json" // ValueMaxAge represents the HTTP Header Value of "max-age" ValueMaxAge = "max-age" // ValueMultipartFormData represents the HTTP Header Value of "multipart/form-data" ValueMultipartFormData = "multipart/form-data" // ValueMustRevalidate represents the HTTP Header Value of "must-revalidate" ValueMustRevalidate = "must-revalidate" // ValueNoCache represents the HTTP Header Value of "no-cache" ValueNoCache = "no-cache" // ValueNoStore represents the HTTP Header Value of "no-store" ValueNoStore = "no-store" // ValueNoTransform represents the HTTP Header Value of "no-transform" ValueNoTransform = "no-transform" // ValuePrivate represents the HTTP Header Value of "private" ValuePrivate = "private" // ValueProxyRevalidate represents the HTTP Header Value of "proxy-revalidate" ValueProxyRevalidate = "proxy-revalidate" // ValuePublic represents the HTTP Header Value of "public" ValuePublic = "public" ValueSharedMaxAge = "s-maxage" // ValueTextPlain represents the HTTP Header Value of "text/plain" ValueTextPlain = "text/plain" // ValueXFormURLEncoded represents the HTTP Header Value of "application/x-www-form-urlencoded" ValueXFormURLEncoded = "application/x-www-form-urlencoded" // ValueMultipartByteRanges represents the HTTP Header prefix for a Multipart Byte Range response ValueMultipartByteRanges = "multipart/byteranges; boundary=" // NameCacheControl represents the HTTP Header Name of "Cache-Control" NameCacheControl = "Cache-Control" // NameAllowOrigin represents the HTTP Header Name of "Access-Control-Allow-Origin" NameAllowOrigin = "Access-Control-Allow-Origin" // NameContentType represents the HTTP Header Name of "Content-Type" NameContentType = "Content-Type" // NameContentEncoding represents the HTTP Header Name of "Content-Encoding" NameContentEncoding = "Content-Encoding" // NameContentLength represents the HTTP Header Name of "Content-Length" NameContentLength = "Content-Length" // NameAuthorization represents the HTTP Header Name of "Authorization" NameAuthorization = "Authorization" // NameContentRange represents the HTTP Header Name of "Content-Range" NameContentRange = "Content-Range" // NameTricksterResult represents the HTTP Header Name of "X-Trickster-Result" NameTricksterResult = "X-Trickster-Result" // NameVia represents the HTTP Header Name of "Via" NameVia = "Via" // NameXForwardedFor represents the HTTP Header Name of "X-Forwarded-For" NameXForwardedFor = "X-Forwarded-For" // NameAcceptEncoding represents the HTTP Header Name of "Accept-Encoding" NameAcceptEncoding = "Accept-Encoding" // NameSetCookie represents the HTTP Header Name of "Set-Cookie" NameSetCookie = "Set-Cookie" // NameRange represents the HTTP Header Name of "Range" NameRange = "Range" // NameTransferEncoding represents the HTTP Header Name of "Transfer-Encoding" NameTransferEncoding = "Transfer-Encoding" // NameIfModifiedSince represents the HTTP Header Name of "If-Modified-Since" NameIfModifiedSince = "If-Modified-Since" // NameIfUnmodifiedSince represents the HTTP Header Name of "If-Unodified-Since" NameIfUnmodifiedSince = "If-Unmodified-Since" // NameIfNoneMatch represents the HTTP Header Name of "If-None-Match" NameIfNoneMatch = "If-None-Match" // NameIfMatch represents the HTTP Header Name of "If-Match" NameIfMatch = "If-Match" // NameDate represents the HTTP Header Name of "date" NameDate = "Date" // NamePragma represents the HTTP Header Name of "pragma" NamePragma = "Pragma" // NameLastModified represents the HTTP Header Name of "last-modified" NameLastModified = "Last-Modified" // NameExpires represents the HTTP Header Name of "expires" NameExpires = "Expires" // NameETag represents the HTTP Header Name of "etag" NameETag = "Etag" )
Variables ¶
This section is empty.
Functions ¶
func AddProxyHeaders ¶
AddProxyHeaders injects standard Trickster headers into proxied upstream HTTP requests
func AddResponseHeaders ¶
AddResponseHeaders injects standard Trickster headers into downstream HTTP responses
func ExtractHeader ¶
ExtractHeader returns the value for the provided header name, and a boolean indicating if the header was present
func Merge ¶
Merge merges the source http.Header map into destination map. If a key exists in both maps, the source value wins. If the destination map is nil, the source map will not be merged
func RemoveClientHeaders ¶
RemoveClientHeaders strips certain headers from the HTTP request to facililate acceleration
func SetResultsHeader ¶
func SetResultsHeader(headers http.Header, engine, status, ffstatus string, fetched timeseries.ExtentList)
SetResultsHeader adds a response header summarizing Trickster's handling of the HTTP request
Types ¶
This section is empty.