package
1.0.33
Repository: https://github.com/eluv-io/common-go.git
Documentation: pkg.go.dev

# Functions

AdaptRange adapts offset and length of a [Byte Range] received in an HTTP Range header (or query) according to the instructions in [RFC 7233, section 4] given the actual total size of the content.
ArrayQueryWithSplit retrieves the given query parameter from the query as an array of strings.
BoolQuery retrieves the given query parameter from the query as a boolean.
ClientIP returns the client IP address for the given HTTP request.
DurationQuery retrieves the given query parameter from the query as a string.
ExtractCustomHeaders extracts custom HTTP headers prefixed with 'X-Content-Fabric-' and builds up a map with the remaining header name as key and the (first) header value.
Float64Query retrieves the given query parameter from the query as a float64.
FullRange returns a content range with the given total size and an adapted offset of 0 and an adapted len equal to the total size.
GetBytesRange extracts "byte range" as verbatim string from an HTTP Range Request (https://tools.ietf.org/html/rfc7233) The spec defines range requests with a special header "Range: bytes=x-y".
GetCombinedHeader returns all values of all header names as a single string, individual header values separated by ",".
No description provided by the author
No description provided by the author
GetDecryptionMode extracts the decryption mode from an X-Content-Fabric-Decryption-Mode header or the header-x_decryption_mode query parameter.
No description provided by the author
No description provided by the author
No description provided by the author
GetSetContentDisposition extracts the 'set-content-disposition' directive from X-Content-Fabric-Set-Content-Disposition header or the header-x_set_content_disposition query parameter.
IntQuery retrieves the given query parameter from the query as an integer.
No description provided by the author
Normalizes the given URL string into the format "scheme://host:port[/path]".
ParseByteRange parses a (single) [Byte Range] in the form "start-end" as defined for HTTP Range Request returns it as offset and size.
ParseServerError tries parsing an error response from a fabric API call and returns the result as error.
No description provided by the author
SetContentDisposition sets the Content-Disposition header as a filename attachment.
SetCustomCBORHeader sets the given key value pair as a custom header, prefixing the key with 'X-Content-Fabric-' and encoding the value in CBOR and then in base 64.
SetCustomHeader sets the given key value pair as a custom header, prefixing the key with 'X-Content-Fabric-' and encoding the string in base 64.
SetCustomHeader sets the given key-value pairs from the provided map as custom headers.
No description provided by the author
No description provided by the author
No description provided by the author
ShouldRetry returns true if a failed HTTP request should be retried, false otherwise.
StringQuery retrieves the given query parameter from the query as a string.
StringToBool converts a string to a boolean value.
ToRangeReader adapts off and siz to the given totalSize, positions the reader at the adapted offset and returns the adapted ContentRange.
UintPtrQuery returns a pointer to a uint for the given query parameter.
Unmarshal unmarshals the body of the HTTP request, using the correct JSON or XML unmarshaler depending on the "Content-Type" header of the request (JSON per default).
UnmarshalTo unmarshals the body of the HTTP request into the given target go structure, using the correct JSON or XML unmarshaler depending on the "Content-Type" header of the request (JSON per default).

# Constants

HTTP header for specifying mode for decryption.
No description provided by the author
HTTP header for directive to return a Content-Disposition header.

# Structs

No description provided by the author
No description provided by the author