chunkedreader

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package chunkedreader provides functionality for reading a stream in chunks.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorFileClosed  = errors.New("file already closed")
	ErrorInvalidSeek = errors.New("invalid seek position")
)

io related errors returned by ChunkedReader

Functions

This section is empty.

Types

type ChunkedReader

type ChunkedReader interface {
	io.Reader
	io.Seeker
	io.Closer
	fs.RangeSeeker
	Open() (ChunkedReader, error)
}

ChunkedReader describes what a chunked reader can do.

func New

func New(ctx context.Context, o fs.Object, initialChunkSize int64, maxChunkSize int64, streams int) ChunkedReader

New returns a ChunkedReader for the Object.

An initialChunkSize of <= 0 will disable chunked reading. If maxChunkSize is greater than initialChunkSize, the chunk size will be doubled after each chunk read with a maximum of maxChunkSize. A Seek or RangeSeek will reset the chunk size to it's initial value

Jump to

Keyboard shortcuts

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