httphdr
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package httphdr implements functionality for parsing and formattingstandard HTTP headers.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcFormatContentRange¶
FormatContentRange parses a "Content-Range" header perRFC 7233, section 4.2.It only handles "Content-Range" headers where the units is "bytes".The "Content-Range" header is usually only specified in HTTP responses.
If start and length are non-positive, then it encodes just the completeLength,which must be a non-negative value.
Otherwise, it encodes the start and length as a byte-range,and optionally emits the complete length if it is non-negative.The length must be positive (asRFC 7233 uses inclusive end offsets).
funcFormatRange¶
FormatRange formats a "Range" header perRFC 7233, section 3.It only handles "Range" headers where the units is "bytes".The "Range" header is usually only specified in GET requests.
funcParseContentRange¶
ParseContentRange parses a "Content-Range" header perRFC 7233, section 4.2.It only handles "Content-Range" headers where the units is "bytes".The "Content-Range" header is usually only specified in HTTP responses.
If only the completeLength is specified, then start and length are both zero.
Otherwise, the parses the start and length and the optional completeLength,which is -1 if unspecified. The start is non-negative and the length is positive.
Types¶
typeRange¶
type Range struct {// Start is the starting offset.// It is zero if Length is negative; it must not be negative.Startint64// Length is the length of the content.// It is zero if the length extends to the end of the content.// It is negative if the length is relative to the end (e.g., last 5 bytes).Lengthint64}Range is a range of bytes within some content.
funcParseRange¶
ParseRange parses a "Range" header perRFC 7233, section 3.It only handles "Range" headers where the units is "bytes".The "Range" header is usually only specified in GET requests.