diskcache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskCacheHandler

type DiskCacheHandler struct {
	// cache page size. 0 will use the default page size.
	// This value should only be changed before the cache handler
	// is PageSize set
	PageSize int
	// contains filtered or unexported fields
}

DiskCacheHandler caches reads to an *os.File

func NewDiskCache

func NewDiskCache(f *os.File, fileSize int64) *DiskCacheHandler

NewDiskCache returns a CacheHandler strategy that caches reads to f. fileSize should be the size in bytes of the upstream object that is being cached. The state of the cache is stored in memory so it is not safe to share a cache file between different readers.

func (*DiskCacheHandler) Get

func (h *DiskCacheHandler) Get(p []byte, off int64, fetcher io.ReaderAt) (int, error)

Jump to

Keyboard shortcuts

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