chunkreaderat

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

README

ChunkReaderAt

Go Reference

A go library to cache a ReaderAt interface with chunks

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAssertion      = errors.New("assertion error")
	ErrNegativeOffset = errors.New("bytes.Reader.ReadAt: negative offset")
	ErrBufferSize     = errors.New("bufferSize can't be <= 0")
)

Functions

This section is empty.

Types

type ChunkReaderAt

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

ChunkReaderAt implement io.ReaderAt interface

func NewChunkReaderAt

func NewChunkReaderAt(rd io.ReaderAt, size, chunkSize int64, bufferSize int) (*ChunkReaderAt, error)

NewChunkReaderAt create a new ChunkReaderAt rd is a source io.ReaderAt + a Size() function mandatory for zip manipulation. chunkSize is the size of a chunk put in cache. bufferSize is the number of chunk stored in cache with an ARC eviction mecanism.

func (*ChunkReaderAt) ReadAt

func (r *ChunkReaderAt) ReadAt(b []byte, offset int64) (int, error)

func (*ChunkReaderAt) Size added in v0.2.0

func (r *ChunkReaderAt) Size() int64

Size return size of source

Jump to

Keyboard shortcuts

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