downloader

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const TempExt = ".tmp"

Variables

View Source
var ErrSkip = errors.New("skip")

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 Item

type Item struct {
	ID           int // unique in iter
	InputFileLoc tg.InputFileLocationClass
	Name         string
	Size         int64
	DC           int
}

type Iter

type Iter interface {
	Next(ctx context.Context) (*Item, error)
	Finish(ctx context.Context, id int) error
	Total(ctx context.Context) int
}

type Options

type Options struct {
	Pool       dcpool.Pool
	Dir        string
	RewriteExt bool
	SkipSame   bool
	PartSize   int
	Threads    int
	Iter       Iter
}

Jump to

Keyboard shortcuts

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