Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoOverlap = errors.New("invalid range: failed to overlap")
ErrNoOverlap is returned by ParseRange if first-byte-pos of all of the byte-range-spec values is greater than the content size.
Functions ¶
func GetContentRange ¶
Example:
"Content-Range": "bytes 100-200/1000" "Content-Range": "bytes 100-200/*"
Types ¶
type KeepAlive ¶
func NewKeepAlive ¶
type Range ¶
type Range struct {
Start, Length int64
}
Range specifies the byte range to be sent to the client.
func MustParseRange ¶
func ParseRange ¶
ParseRange parses a Range header string as per RFC 7233. ErrNoOverlap is returned if none of the ranges overlap. Example:
"Range": "bytes=100-200" "Range": "bytes=-50" "Range": "bytes=150-" "Range": "bytes=0-0,-1"
copy from go/1.15.2 net/http/fs.go ParseRange
type RateLimit ¶
RateLimit is a wrapper for rate.Limit, support json and yaml unmarshal function yaml example 1:
rate_limit: 2097152 # 2MiB
yaml example 2:
rate_limit: 2MiB
func (*RateLimit) UnmarshalJSON ¶
func (*RateLimit) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.