application

package
v0.0.0-...-1bd92a5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadTorrentStatus

type DownloadTorrentStatus int
const (
	TorrentDownloadTimeout DownloadTorrentStatus = 0
	TorrentDownloaded      DownloadTorrentStatus = 1
	TorrentStatusUnknown   DownloadTorrentStatus = 2
)

type DownloadTorrentUsecase

type DownloadTorrentUsecase struct {
	fx.In
	Repo         TorrentRepository
	Downloader   TorrentDownloader
	Transmission TransmissionService
	Link         ViewTorrentInUILink
}

func (*DownloadTorrentUsecase) Execute

func (u *DownloadTorrentUsecase) Execute(torrentID int, notifier Notifier) error

type Filepath

type Filepath string
type Link struct {
	Text string
	Url  string
}

type Notification

type Notification struct {
	Text string
	Link *Link
}

type Notifier

type Notifier interface {
	Notify(notification Notification) error
	NotifyText(text string, args ...interface{}) error
	NotifyLink(text string, link *Link) error
}

type TorrentDownloader

type TorrentDownloader interface {
	Download(torrent *domain.Torrent) (Filepath, error)
}

type TorrentRepository

type TorrentRepository interface {
	FindByName(ctx context.Context, name string) ([]domain.Torrent, error)
	FindByID(ctx context.Context, id int) (*domain.Torrent, error)
}

type TransmissionService

type TransmissionService interface {
	AddTorrent(filepath Filepath) (TransmissionTorrentId, error)
	WaitDone(torrentID TransmissionTorrentId) DownloadTorrentStatus
}

type TransmissionTorrentId

type TransmissionTorrentId int64
type ViewTorrentInUILink string

Jump to

Keyboard shortcuts

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