parsed

package
v0.44.5 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: 28 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 {
	MessageID int
	ChatID    int64
	// contains filtered or unexported fields
}

func NewProgress

func NewProgress(messageID int, chatID int64) *Progress

func (*Progress) OnDone

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

func (*Progress) OnProgress

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

func (*Progress) OnStart

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

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)
}

type ResourceInfo

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

type Task

type Task struct {
	ID       string
	Ctx      context.Context
	Stor     storage.Storage
	StorPath string
	// contains filtered or unexported fields
}

func NewTask

func NewTask(
	id string,
	ctx context.Context,
	stor storage.Storage,
	storPath string,
	item *parser.Item,
	progressTracker ProgressTracker,
) *Task

func (*Task) Downloaded

func (t *Task) Downloaded() int64

func (*Task) DownloadedBytes

func (t *Task) DownloadedBytes() int64

func (*Task) Execute

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

func (*Task) Processing

func (t *Task) Processing() map[string]ResourceInfo

func (*Task) Site

func (t *Task) Site() string

func (*Task) StorageName

func (t *Task) StorageName() string

func (*Task) StoragePath

func (t *Task) StoragePath() string

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

func (*Task) TotalResources

func (t *Task) TotalResources() int64

func (*Task) Type

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

type TaskInfo

type TaskInfo interface {
	TaskID() string
	Site() string
	TotalResources() int64
	Downloaded() int64
	TotalBytes() int64
	DownloadedBytes() int64
	Processing() map[string]ResourceInfo
	StorageName() string
	StoragePath() string
}

Jump to

Keyboard shortcuts

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