Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheReader ¶
type CacheReader struct {
// contains filtered or unexported fields
}
CacheReader is a reader that caches the data in a temporary file to allow multiple reads
func NewCacheReader ¶
func NewCacheReader(name string, rc io.ReadCloser) (*CacheReader, string, error)
NewCacheReader creates a new CacheReader from an io.ReadCloser When the reader is an os.File, it will be used directly Otherwise, the content will be copied into a temporary file, and the original reader will be closed
The Checksum is computed on the fly
func (*CacheReader) Close ¶
func (cr *CacheReader) Close() error
Close closes the temporary file only if it was created by NewCacheReader
func (*CacheReader) OpenFile ¶
func (cr *CacheReader) OpenFile() (*tempFile, error)
OpenFile creates a new file handler based on the temporary file
Click to show internal directories.
Click to hide internal directories.