Documentation
¶
Overview ¶
Package httpreadat provides an io.ReaderAt for http requests using the Range header.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheHandler ¶
type CacheHandler interface {
// Get receives the original p and off passed to ReadAt.
// If the data is not available Get can call `fetcher.ReadAt`
// to make an http request. Get is allowed to make requests
// that are different from the original and can invoke fetcher
// multiple times.
Get(p []byte, off int64, fetcher io.ReaderAt) (int, error)
}
CacheHandler is the interface used for optional response caching.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithCacheHandler ¶
func WithCacheHandler(c CacheHandler) Option
func WithRoundTripper ¶
func WithRoundTripper(r http.RoundTripper) Option
type RangeReader ¶
type RangeReader struct {
// contains filtered or unexported fields
}
func New ¶
func New(url string, opts ...Option) *RangeReader
func (*RangeReader) Size ¶
func (rr *RangeReader) Size() (n int64, err error)
Click to show internal directories.
Click to hide internal directories.