Documentation
¶
Overview ¶
Package httprange parses and validates exact HTTP byte ranges.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalid = errors.New("invalid byte range") ErrUnsatisfiable = errors.New("unsatisfiable byte range") )
Functions ¶
func UnsatisfiedContentRange ¶
UnsatisfiedContentRange returns the Content-Range value for a 416 response.
Types ¶
type ContentRange ¶
ContentRange is a satisfied HTTP Content-Range value.
func ParseContentRange ¶
func ParseContentRange(value string) (ContentRange, error)
ParseContentRange parses Content-Range: bytes N-M/TOTAL.
type Range ¶
Range is an exact inclusive byte range.
func ParseExact ¶
ParseExact parses a single bytes=N-M range. Open-ended, suffix, and multipart ranges are deliberately rejected.
func (Range) HeaderValue ¶
HeaderValue returns the HTTP Range header value.
func (Range) ValidateSize ¶
ValidateSize verifies that the entire range is within an object of size.
Click to show internal directories.
Click to hide internal directories.