reader

package
v0.0.0-...-2ff8efa Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStreamAbandoned = errors.New("stream abandoned")
	ErrChunkTimeout    = errors.New("chunk fetch timed out")
)

Functions

func NewLinearReader

func NewLinearReader(ctx context.Context,
	client *tg.Client,
	cache cache.Cacher,
	file *schemas.FileOutFull,
	parts []types.Part,
	start,
	end int64,
	config *config.TGConfig,
	concurrency int,
) (io.ReadCloser, error)

Types

type ChunkSource

type ChunkSource interface {
	Chunk(ctx context.Context, offset int64, limit int64) ([]byte, error)
	ChunkSize(start, end int64) int64
}

type LinearReader

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

func (*LinearReader) Close

func (r *LinearReader) Close() error

func (*LinearReader) Read

func (r *LinearReader) Read(p []byte) (int, error)

type Range

type Range struct {
	Start, End int64
	PartNo     int64
}

Jump to

Keyboard shortcuts

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