package
5.30.0
Repository: https://github.com/go-playground/pkg.git
Documentation: pkg.go.dev

# Functions

AcceptedLanguages returns an array of accepted languages denoted by the Accept-Language header sent by the browser.
Attachment is a helper method for returning an attachment file to be downloaded, if you with to open inline see function Inline.
ClientIP implements the best effort algorithm to return the real client IP, it parses X-Real-IP and X-Forwarded-For in order to work properly with reverse-proxies such us: nginx or haproxy.
Decode takes the request and attempts to discover its content type via the http headers and then decode the request body into the provided struct.
DecodeForm parses the requests form data into the provided struct.
DecodeJSON decodes the request body into the provided struct and limits the request size via an ioext.LimitReader using the maxBytes param.
DecodeMultipartForm parses the requests form data into the provided struct.
DecodeQueryParams takes the URL Query params flag.
DecodeResponse takes the response and attempts to discover its content type via the http headers and then decode the request body into the provided type.
DecodeResponseAny takes the response and attempts to discover its content type via the http headers and then decode the request body into the provided type.
DecodeXML decodes the request body into the provided struct and limits the request size via an ioext.LimitReader using the maxBytes param.
DoRetryable will execute the provided functions code and automatically retry before returning the result.
DoRetryableResponse will execute the provided functions code and automatically retry before returning the *http.Response.
HasRetryAfter parses the Retry-After header and returns the duration if possible.
Inline is a helper method for returning a file inline to be rendered/opened by the browser.
IsNonRetryableStatusCode returns true if the provided status code should generally not be retryable.
IsRetryableStatusCode returns true if the provided status code is considered retryable.
JSON marshals provided interface + returns JSON + status code.
JSONBytes returns provided JSON response with status code.
JSONP sends a JSONP response with status code and uses `callback` to construct the JSONP payload.
JSONStream uses json.Encoder to stream the JSON response body.
NewRetryer returns a new `Retryer` with sane default values.
QualityValue accepts a values to add/concatenate a quality values to and the quality values itself.
No description provided by the author
XML marshals provided interface + returns XML + status code.
XMLBytes returns provided XML response with status code.

# Constants

HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
Accept-Encoding values.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
HTTP Header keys.
Accept-Encoding values.
HTTP Header keys.
Accept-Encoding values.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
Accept-Encoding values.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
Accept-Encoding values.
HTTP Header keys.
Accept-Encoding values.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Charset values.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
Mime Type values for the Content-Type HTTP header.
QueryParamsOption's.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
QualityValueFormat is a format string helper for Quality Values.
QueryParamsOption's.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
Mime Type values for the Content-Type HTTP header.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
Charset values.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.

# Variables

DefaultFormDecoder of this package, which is configurable.
DefaultFormEncoder of this package, which is configurable.

# Structs

ErrRetryableStatusCode can be used to indicate a retryable HTTP status code was encountered as an error.
ErrStatusCode can be used to treat/indicate a status code as an error and ability to indicate if it is retryable.
ErrUnexpectedResponse can be used to indicate an unexpected response was encountered as an error and provide access to the *http.Response.
Retryer is used to retry any fallible operation.

# Interfaces

FormDecoder is the type used for decoding a form for use.
FormEncoder is the type used for encoding form data.

# Type aliases

BuildRequestFn is a function used to rebuild an HTTP request for use in retryable code.
BuildRequestFn2 is a function used to rebuild an HTTP request for use in retryable code.
DecodeAnyFn is a function used to decode the response body into the desired type.
IsRetryableStatusCodeFn is a function used to determine if the provided status code is considered retryable.
IsRetryableStatusCodeFn2 is a function used to determine if the provided status code is considered retryable.
QueryParamsOption represents the options for including query parameters during Decode helper functions.