cachereader

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL