downloader

package
v0.0.0-...-01b0788 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbortDownload

func AbortDownload(d downloadable.Downloadable)

func AddDownloader

func AddDownloader(d Downloader)

func AddTorrent

func AddTorrent(t Torrent) (string, error)

func AddTorrentMapping

func AddTorrentMapping(flemzerId string, downloaderId string)

func Download

func Download(d downloadable.Downloadable) error

func FillTorrentList

func FillTorrentList(list []Torrent) []Torrent

func GetTorrentStatus

func GetTorrentStatus(t *Torrent) error

func HandleTorrentDownload

func HandleTorrentDownload(ctxStore ContextStorage, d *downloadable.Downloadable, torrent *Torrent) (err error, aborted bool, torrentSkipped bool)

func MarkDownloadAsFailed

func MarkDownloadAsFailed(d downloadable.Downloadable)

func MoveItemToLibrary

func MoveItemToLibrary(d downloadable.Downloadable) error

func RemoveTorrent

func RemoveTorrent(t Torrent) error

func Reset

func Reset()

func SkipTorrent

func SkipTorrent(d downloadable.Downloadable)

func StartTorrent

func StartTorrent(t Torrent) error

func Status

func Status() ([]Module, error)

func WaitForDownload

func WaitForDownload(ctxStore ContextStorage, t *Torrent) (err error, aborted bool, torrentSkipped bool)

Types

type ContextStorage

type ContextStorage struct {
	Context     context.Context
	Cancel      func()
	SkipTorrent chan bool
}

type DownloadRoutineStruct

type DownloadRoutineStruct map[uint]ContextStorage
var EpisodeDownloadRoutines DownloadRoutineStruct
var MovieDownloadRoutines DownloadRoutineStruct

type Downloader

type Downloader interface {
	Init() error
	Status() (Module, error)
	GetName() string
	AddTorrent(t Torrent) (string, error)
	AddTorrentMapping(string, string)
	RemoveTorrent(t Torrent) error
	GetTorrentStatus(t *Torrent) error
}

func GetDownloader

func GetDownloader(name string) (Downloader, error)

GetDownloader returns the registered downloader with name "name". An non-nil error is returned if no registered downloader are found with the required name

Directories

Path Synopsis
impl

Jump to

Keyboard shortcuts

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