encoding

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const IdentityContentEncoding = "identity"

IdentityContentEncoding is the HTTP Content-Encoding token meaning no transformation.

Variables

This section is empty.

Functions

func DecompressResponseBody added in v2.0.2

func DecompressResponseBody(ce string, body []byte) ([]byte, error)

DecompressResponseBody removes Content-Encoding layers from body using the raw Content-Encoding header value (for example http.Header.Get). An empty ce returns body unchanged. Codings are applied in reverse listed order per RFC 9110.

func MergeCommaSeparated

func MergeCommaSeparated(s1, s2 string) string

MergeCommaSeparated accepts two strings, both representing a comma-separated list of values, which are split into their constituted values and returned as a merged, dupe-killed list of values, separated by comma and space. The returned order is all unique values in s1, followed by the unique values from s2 not present in s1

Example Input: s1="zstd, gzip,deflate, gzip" s2="br,gzip, deflate" Example Output: "zstd, gzip, deflate, br"

func MergeDelimeterSeparated

func MergeDelimeterSeparated(s1, s2, delimiter string, pad bool) string

MergeDelimeterSeparated accepts two strings, both representing a delimiter- separated list of values, which are split into their constituted values on the delimiter and returned as a merged, dupe-killed list. Whitespace on either side of the delimiter are trimmed. This is a simple replacement and does not recognize escape sequences, etc. When pad is true, the merged list will include a space following each delimiter instance.

Types

This section is empty.

Directories

Path Synopsis
Package gzip provides gzip capabilities for byte slices
Package gzip provides gzip capabilities for byte slices
Package zlib provides zlib (RFC 1950) capabilities for byte slices.
Package zlib provides zlib (RFC 1950) capabilities for byte slices.

Jump to

Keyboard shortcuts

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