aria2dl

package
v0.54.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Progress

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

func (*Progress) OnDone

func (p *Progress) OnDone(ctx context.Context, task *Task, err error)

OnDone implements ProgressTracker.

func (*Progress) OnProgress

func (p *Progress) OnProgress(ctx context.Context, task *Task, status *aria2.Status)

OnProgress implements ProgressTracker.

func (*Progress) OnStart

func (p *Progress) OnStart(ctx context.Context, task *Task)

OnStart implements ProgressTracker.

type ProgressTracker

type ProgressTracker interface {
	OnStart(ctx context.Context, task *Task)
	OnProgress(ctx context.Context, task *Task, status *aria2.Status)
	OnDone(ctx context.Context, task *Task, err error)
}

func NewProgress

func NewProgress(msgID int, userID int64) ProgressTracker

type Task

type Task struct {
	ID string

	GID         string
	URIs        []string
	Aria2Client *aria2.Client
	Storage     storage.Storage
	StorPath    string
	Progress    ProgressTracker
	// contains filtered or unexported fields
}

func NewTask

func NewTask(
	id string,
	ctx context.Context,
	gid string,
	uris []string,
	aria2Client *aria2.Client,
	stor storage.Storage,
	storPath string,
	progressTracker ProgressTracker,
) *Task

func (*Task) Execute

func (t *Task) Execute(ctx context.Context) error

Execute implements core.Executable.

func (*Task) TaskID

func (t *Task) TaskID() string

TaskID implements core.Executable.

func (*Task) Title

func (t *Task) Title() string

Title implements core.Executable.

func (*Task) Type

func (t *Task) Type() tasktype.TaskType

Type implements core.Executable.

Jump to

Keyboard shortcuts

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