downloading

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 9 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 *api.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 *api.Download) bool

Has returns whether the list has a given download

func (*DownloadList) List

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

List returns a slice copy of the list

func (*DownloadList) Remove

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

Remove removes a download from the list

type Manager

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

Manager which synchronises downloads from Mangadex

func NewManager

func NewManager(c *mangadex.Client, root string, store *bolt.DB, workers int) *Manager

func (*Manager) Cancel

func (m *Manager) Cancel()

func (*Manager) DeleteFinishedTasks

func (m *Manager) DeleteFinishedTasks() error

func (*Manager) Downloads

func (m *Manager) Downloads() ([]*api.Download, func())

func (*Manager) Pause

func (m *Manager) Pause()

func (*Manager) Paused

func (m *Manager) Paused() bool

func (*Manager) Resume

func (m *Manager) Resume()

func (*Manager) RetryFailedTasks

func (m *Manager) RetryFailedTasks()

func (*Manager) StartDownload

func (m *Manager) StartDownload(manga string, ch *mangadex.Chapter)

type Pool

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

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

func NewPool

func NewPool() *Pool

func (Pool) Get

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

func (Pool) Put

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

Jump to

Keyboard shortcuts

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