Documentation
¶
Index ¶
- type Progress
- type ProgressTracker
- type Task
- func (t *Task) Count() int
- func (t *Task) Execute(ctx context.Context) error
- func (t *Task) FailedFiles() []string
- func (t *Task) Processing() []TaskElementInfo
- func (t *Task) TaskID() string
- func (t *Task) Title() string
- func (t *Task) TotalSize() int64
- func (t *Task) Type() tasktype.TaskType
- func (t *Task) Uploaded() int64
- type TaskElement
- type TaskElementInfo
- type TaskInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 NewProgressTracker ¶
func NewProgressTracker(messageID int, chatID int64) ProgressTracker
type Task ¶
type Task struct {
ID string
Progress ProgressTracker
IgnoreErrors bool
// contains filtered or unexported fields
}
func NewTransferTask ¶
func NewTransferTask( id string, ctx context.Context, elems []TaskElement, progress ProgressTracker, ignoreErrors bool, ) *Task
func (*Task) FailedFiles ¶
func (*Task) Processing ¶
func (t *Task) Processing() []TaskElementInfo
type TaskElement ¶
type TaskElement struct {
ID string
SourceStorage storage.Storage
SourcePath string
FileInfo storagetypes.FileInfo
TargetStorage storage.Storage
TargetPath string
}
func NewTaskElement ¶
func NewTaskElement( sourceStorage storage.Storage, fileInfo storagetypes.FileInfo, targetStorage storage.Storage, targetPath string, ) *TaskElement
func (*TaskElement) FileName ¶
func (e *TaskElement) FileName() string
func (*TaskElement) FileSize ¶
func (e *TaskElement) FileSize() int64
func (*TaskElement) GetSourcePath ¶
func (e *TaskElement) GetSourcePath() string
func (*TaskElement) SourceStorageName ¶
func (e *TaskElement) SourceStorageName() string
type TaskElementInfo ¶
Click to show internal directories.
Click to hide internal directories.