Versions in this module Expand all Collapse all v1 v1.0.0 Jan 20, 2026 Changes in this version + const DefaultProtocolCacheTime + var ErrContentRangeHeaderNotFound = errors.New("Content-Range header not found") + var ErrContentRangeInvalidEndValue = errors.New("Content-Range invalid end value") + var ErrContentRangeInvalidFormat = errors.New("Content-Range invalid format") + var ErrContentRangeInvalidStartValue = errors.New("Content-Range invalid start value") + var ErrContentRangeInvalidTotalValue = errors.New("Content-Range invalid total value") + var ErrRangeHeaderInvalidFormat = errors.New("header Range invalid format") + var ErrRangeHeaderNotFound = errors.New("header Range not found") + var ErrRangeHeaderUnsatisfiable = errors.New("header Range unsatisfiable") + var Parse = parser.Parse + var SingleRange = parser.SingleParse + func BuildHeaderRange(start, end, totalSize uint64) string + func ClientIP(remoteAddr string, header http.Header) string + func CopyHeader(dst, src http.Header) + func CopyHeadersWithout(dst, src http.Header, excludeKeys ...string) + func CopyTrailer(dst, src http.Header) + func IsChunked(h http.Header) bool + func NewBizError(code int, headers http.Header) error + func ParseCacheTime(withKey string, src http.Header) (time.Duration, bool) + func PrintRoutes(mux *http.ServeMux) + func RemoveHopByHopHeaders(h http.Header) + func ResponseHeaderSize(code int, hdr http.Header) uint64 + func Scheme(r *http.Request) string + func WithTracer(req *http.Request) *http.Request + type BizError interface + Code func() int + Headers func() http.Header + func ParseBizError(err error) (BizError, bool) + type ContentRange struct + Length int64 + ObjSize uint64 + Start int64 + func ParseContentRange(header http.Header) (ContentRange, error) + func (cr *ContentRange) String() string + type Parser interface + Parse func(header string, size uint64) ([]*Range, error) + SingleParse func(header string, size uint64) (*Range, error) + func NewUnsatisfiableParser() Parser + type Range struct + End int64 + Start int64 + func NewRequestRange(start, end int64) *Range + func UnsatisfiableMultiRange(header string) ([]*Range, error) + func (r *Range) ContentRange(size uint64) string + func (r *Range) Length() int64 + func (r *Range) MimeHeader(contentType string, size uint64) textproto.MIMEHeader + func (r *Range) RangeLength(totalSize int64) int64 + func (r *Range) String() string + type ResponseRecorder struct + func NewResponseRecorder(w http.ResponseWriter) *ResponseRecorder + func (r *ResponseRecorder) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (r *ResponseRecorder) SentBytes() uint64 + func (r *ResponseRecorder) Size() uint64 + func (r *ResponseRecorder) Status() int + func (r *ResponseRecorder) Write(b []byte) (n int, err error) + func (r *ResponseRecorder) WriteHeader(s int)