transfer

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadList

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

DownloadList keeps track of the queued and active downloads in the download manager

func NewDownloadList

func NewDownloadList() *DownloadList

func (*DownloadList) Add

func (dl *DownloadList) Add(d *mangadex.Download)

Add adds a download to the list

func (*DownloadList) Cancel

func (dl *DownloadList) Cancel()

Cancel cancels all currently running downloads and removes them from the list

func (*DownloadList) Has

func (dl *DownloadList) Has(d *mangadex.Download) bool

Has returns whether the list has a given download

func (*DownloadList) List

func (dl *DownloadList) List() []*mangadex.Download

List returns a slice copy of the list

func (*DownloadList) Remove

func (dl *DownloadList) Remove(d *mangadex.Download)

Remove removes a download from the list

type Manager

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

func NewManager

func NewManager(libraryPath string, workers int, store *storage.Store, done func() error, sbInterval time.Duration) *Manager

func (*Manager) CancelDownloads

func (m *Manager) CancelDownloads()

func (*Manager) CheckSubscriptions

func (m *Manager) CheckSubscriptions() error

func (*Manager) DeleteAllDownloads

func (m *Manager) DeleteAllDownloads() error

func (*Manager) DeleteSuccessfulDownloads

func (m *Manager) DeleteSuccessfulDownloads() error

func (*Manager) GetAllDownloads

func (m *Manager) GetAllDownloads() ([]*mangadex.Download, func(), error)

func (Manager) Pause

func (c Manager) Pause()

Pause sets the controller to a paused state

func (*Manager) Paused

func (m *Manager) Paused() bool

func (*Manager) Queue

func (m *Manager) Queue(mangaTitle string, ch mangadex.Chapter, createSubscription bool)

func (Manager) Resume

func (c Manager) Resume()

Resume wakes up all goroutines waiting on the controller and continues their execution

func (*Manager) RetryFailedDownloads

func (m *Manager) RetryFailedDownloads() error

func (Manager) WaitIfPaused

func (c Manager) WaitIfPaused()

WaitIfPaused causes the goroutine to wait if it is paused, until the Resume() function is called to continue execution

func (*Manager) Waiting

func (m *Manager) Waiting() bool

type Pool

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

Pool implements a sync.Pool to improve performance when creating new []*Download for sending to each user

func NewPool

func NewPool() *Pool

func (Pool) Get

func (p Pool) Get() []*mangadex.Download

func (Pool) Put

func (p Pool) Put(dl []*mangadex.Download)

Jump to

Keyboard shortcuts

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