buffered_reader_at

package
v0.51.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedReaderAt

type BufferedReaderAt struct {
	// contains filtered or unexported fields
}

BufferedReaderAt enhances io.ReaderAt with caching, page alignment, and concurrency.

TODO: implement time and size based cache eviction, memory budget

func NewBufferedReaderAt

func NewBufferedReaderAt(reader io.ReaderAt, pageSize int64) *BufferedReaderAt

NewBufferedReaderAt creates a new BufferedReaderAt with the specified page size

func (*BufferedReaderAt) ReadAt

func (br *BufferedReaderAt) ReadAt(p []byte, off int64) (n int, err error)

ReadAt reads from the underlying io.ReaderAt into p, implementing caching, page alignment, and preventing overlapping cache pages. Supports concurrent requests.

type SliceReaderAt

type SliceReaderAt interface {
	// SliceReadAt reads a slice of data from the requested location.
	// NOTE: the returned slice may start before or after the requested location and length.
	// NOTE: this may return a completely different range than what you asked for!
	SliceReadAt(offset, length int64) (dataOffset int64, data []byte, err error)
}

SliceReaderAt supports reading data at a larger range than the buffer provided to ReadAt.

Jump to

Keyboard shortcuts

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