Documentation
¶
Index ¶
- Constants
- func CopyWithCtx(ctx context.Context, dst io.Writer, src io.Reader) (int64, error)
- type PathWithArgs
- func (p PathWithArgs) FileSize() (int64, error)
- func (p PathWithArgs) IsCopy() bool
- func (p PathWithArgs) Origin() string
- func (p PathWithArgs) Range() (*RangeHeader, error)
- func (p PathWithArgs) SetFileSize(s string)
- func (p PathWithArgs) SetIsCopy()
- func (p PathWithArgs) SetOrigin(origin string)
- func (p PathWithArgs) SetRange(r string)
- func (p PathWithArgs) SetShowCorrupted()
- func (p PathWithArgs) ShowCorrupted() bool
- func (p PathWithArgs) String() string
- type RangeHeader
Constants ¶
View Source
const ContentLengthKey = contextKey("contentLength")
View Source
const IsCopy = contextKey("isCopy")
View Source
const Origin = contextKey("origin")
View Source
const RangeKey = contextKey("rangeKey")
View Source
const ShowCorrupted = contextKey("showCorrupted")
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PathWithArgs ¶
type PathWithArgs struct {
Path string
// contains filtered or unexported fields
}
func NewPathWithArgs ¶
func NewPathWithArgs(path string) PathWithArgs
func NewPathWithArgsFromString ¶
func NewPathWithArgsFromString(s string) (PathWithArgs, error)
func (PathWithArgs) FileSize ¶
func (p PathWithArgs) FileSize() (int64, error)
func (PathWithArgs) IsCopy ¶
func (p PathWithArgs) IsCopy() bool
func (PathWithArgs) Origin ¶
func (p PathWithArgs) Origin() string
func (PathWithArgs) Range ¶
func (p PathWithArgs) Range() (*RangeHeader, error)
func (PathWithArgs) SetFileSize ¶
func (p PathWithArgs) SetFileSize(s string)
func (PathWithArgs) SetIsCopy ¶
func (p PathWithArgs) SetIsCopy()
func (PathWithArgs) SetOrigin ¶
func (p PathWithArgs) SetOrigin(origin string)
func (PathWithArgs) SetRange ¶
func (p PathWithArgs) SetRange(r string)
func (PathWithArgs) SetShowCorrupted ¶
func (p PathWithArgs) SetShowCorrupted()
func (PathWithArgs) ShowCorrupted ¶
func (p PathWithArgs) ShowCorrupted() bool
func (PathWithArgs) String ¶
func (p PathWithArgs) String() string
type RangeHeader ¶
func FixRangeHeader ¶
func FixRangeHeader(rh *RangeHeader, size int64) *RangeHeader
FixRangeHeader looks through the slice of options and adjusts any RangeHeader~s found that request a fetch from the end into an absolute fetch using the size passed in and makes sure the range does not exceed filesize.
func ParseRangeHeader ¶
func ParseRangeHeader(s string) (po *RangeHeader, err error)
ParseRangeHeader parses a RangeHeader from a Range: header. It only accepts single ranges.
func (*RangeHeader) Decode ¶
func (o *RangeHeader) Decode(size int64) (offset, limit int64)
Decode interprets the RangeOption into an offset and a limit
The offset is the start of the stream and the limit is how many bytes should be read from it. If the limit is -1 then the stream should be read to the end.
Click to show internal directories.
Click to hide internal directories.