directlinks

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name string
	URL  string
	Size int64
}

func (*File) FileName

func (f *File) FileName() string

func (*File) FileSize

func (f *File) FileSize() int64

type FileInfo

type FileInfo interface {
	FileName() string
	FileSize() int64
}

type Progress

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

func (*Progress) OnDone

func (p *Progress) OnDone(ctx context.Context, info TaskInfo, err error)

OnDone implements ProgressTracker.

func (*Progress) OnProgress

func (p *Progress) OnProgress(ctx context.Context, info TaskInfo)

OnProgress implements ProgressTracker.

func (*Progress) OnStart

func (p *Progress) OnStart(ctx context.Context, info TaskInfo)

OnStart implements ProgressTracker.

type ProgressTracker

type ProgressTracker interface {
	OnStart(ctx context.Context, info TaskInfo)
	OnProgress(ctx context.Context, info TaskInfo)
	OnDone(ctx context.Context, info TaskInfo, err error)
}

func NewProgress

func NewProgress(msgID int, userID int64) ProgressTracker

type Task

type Task struct {
	ID string

	Storage  storage.Storage
	StorPath string
	Progress ProgressTracker
	// contains filtered or unexported fields
}

func NewTask

func NewTask(
	id string,
	ctx context.Context,
	links []string,
	stor storage.Storage,
	storPath string,
	progressTracker ProgressTracker,
) *Task

func (*Task) DownloadedBytes

func (t *Task) DownloadedBytes() int64

DownloadedBytes implements TaskInfo.

func (*Task) Execute

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

func (*Task) Processing

func (t *Task) Processing() []FileInfo

Processing implements TaskInfo.

func (*Task) StorageName

func (t *Task) StorageName() string

StorageName implements TaskInfo.

func (*Task) StoragePath

func (t *Task) StoragePath() string

StoragePath implements TaskInfo.

func (*Task) TaskID

func (t *Task) TaskID() string

func (*Task) Title added in v0.43.0

func (t *Task) Title() string

Title implements core.Exectable.

func (*Task) TotalBytes

func (t *Task) TotalBytes() int64

TotalBytes implements TaskInfo.

func (*Task) TotalFiles

func (t *Task) TotalFiles() int

TotalFiles implements TaskInfo.

func (*Task) Type

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

type TaskInfo

type TaskInfo interface {
	TotalBytes() int64
	TotalFiles() int
	TaskID() string
	StorageName() string
	StoragePath() string
	DownloadedBytes() int64
	Processing() []FileInfo
}

Jump to

Keyboard shortcuts

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