Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLazyOpener ¶
func NewLazyOpener(open func() (io.Reader, error)) io.ReadCloser
NewLazyOpener returns a lazy io.Reader based on `open`.
Types ¶
type CachingReader ¶
type CachingReader struct {
// contains filtered or unexported fields
}
CachingReader is a lazily caching wrapper of an io.Reader.
The wrapped io.Reader is only read from on demand, not upfront.
func NewCachingReader ¶
func NewCachingReader(r io.Reader) *CachingReader
NewCachingReader buffers reads from r.
r is only read from when Read() is called.
func (*CachingReader) NewReader ¶
func (cr *CachingReader) NewReader() io.Reader
NewReader returns a new io.Reader that reads cr from offset 0.
type LazyOpener ¶
type LazyOpener struct {
// contains filtered or unexported fields
}
LazyOpener is a lazy io.Reader.
LazyOpener will use a given open function to derive an io.Reader when Read is first called on the LazyOpener.
type LazyOpenerAt ¶
type LazyOpenerAt struct {
// contains filtered or unexported fields
}
LazyOpenerAt is a lazy io.ReaderAt.
LazyOpenerAt will use a given open function to derive an io.ReaderAt when ReadAt is first called.
func (*LazyOpenerAt) Close ¶
func (loa *LazyOpenerAt) Close() error
Close implements io.Closer.Close.
type ReadAtCloser ¶
ReadAtCloser is an io.ReaderAt and an io.Closer.
func NewLazyOpenerAt ¶
func NewLazyOpenerAt(open func() (io.ReaderAt, error)) ReadAtCloser
NewLazyOpenerAt returns a lazy io.ReaderAt based on `open`.