Documentation ¶
Overview ¶
Package http_range implements http range parsing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoOverlap is returned by ParseRange if first-byte-pos of // all the byte-range-spec values is greater than the content size. ErrNoOverlap = errors.New("invalid range: failed to overlap") // ErrInvalid is returned by ParseRange on invalid input. ErrInvalid = errors.New("invalid range") )
Functions ¶
func ApplyRangeToHttpHeader ¶
ApplyRangeToHttpHeader for http request header
func ParseContentRange ¶
ParseContentRange this function parse content-range in http response
Types ¶
type Range ¶
Range specifies the byte range to be sent to the client.
func ParseRange ¶
ParseRange parses a Range header string as per RFC 7233. ErrNoOverlap is returned if none of the ranges overlap. ErrInvalid is returned if s is invalid range.
func (Range) ContentRange ¶
ContentRange returns Content-Range header value.
func (Range) MimeHeader ¶
func (r Range) MimeHeader(contentType string, size int64) textproto.MIMEHeader
Click to show internal directories.
Click to hide internal directories.