downloader

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

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

func New

func New(opts Options) *Downloader

func (*Downloader) Download

func (d *Downloader) Download(ctx context.Context, limit int) error

type Elem added in v0.13.1

type Elem interface {
	File() File
	To() io.WriterAt

	AsTakeout() bool
}

type File added in v0.13.1

type File interface {
	Location() tg.InputFileLocationClass
	Size() int64
	DC() int
}

type Iter

type Iter interface {
	Next(ctx context.Context) bool
	Value() Elem
	Err() error
}

type Options added in v0.7.0

type Options struct {
	Pool     dcpool.Pool
	PartSize int
	Threads  int
	Iter     Iter
	Progress Progress
}

type Progress added in v0.13.1

type Progress interface {
	OnAdd(elem Elem)
	OnDownload(elem Elem, state ProgressState)
	OnDone(elem Elem, err error)
}

type ProgressState added in v0.13.1

type ProgressState struct {
	Downloaded int64
	Total      int64
}

Jump to

Keyboard shortcuts

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