biz

package
v0.0.0-...-2004213 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 8 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type DownloadManager

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

func NewDownloadManager

func NewDownloadManager(repo DownloadManagerRepo, logger log.Logger) *DownloadManager

func (*DownloadManager) AddTask

func (*DownloadManager) DeleteTask

func (a *DownloadManager) DeleteTask(ctx context.Context, id int32) error

func (*DownloadManager) GetDownloadTaskInfoByAnimeId

func (a *DownloadManager) GetDownloadTaskInfoByAnimeId(ctx context.Context, id string) (*dtoDownloadmanager.DownloadTaskInfo, error)

func (*DownloadManager) GetDownloadTaskInfoById

func (a *DownloadManager) GetDownloadTaskInfoById(ctx context.Context, id int32) (*dtoDownloadmanager.DownloadTaskInfo, error)

func (*DownloadManager) ListTask

func (*DownloadManager) Scan

func (a *DownloadManager) Scan(ctx context.Context) ([]*DownloadTask, error)

func (*DownloadManager) ScanTaskAndDownload

func (a *DownloadManager) ScanTaskAndDownload(ctx context.Context) ([]*DownloadTask, error)

func (*DownloadManager) UpdateTaskInfo

func (a *DownloadManager) UpdateTaskInfo(ctx context.Context, taskInfo *dtoDownloadmanager.DownloadTaskInfo) error

type DownloadManagerRepo

type DownloadManagerRepo interface {
	CreateDownloadTask(ctx context.Context, id int32, latestChapter int32, MagnetLink string) error
	GetAnimeMagnets(ctx context.Context) ([]*dtoSpider.AnimeMagnet, error)
	AddTaskInfo(context.Context, *dtoDownloadmanager.DownloadTaskInfo) error
	DeleteTask(ctx context.Context, id int32) error
	GetDownloadTaskInfos() []*dtoDownloadmanager.DownloadTaskInfo
	UpdateLatestChapter(ctx context.Context, id, latestChapter int32) error
	UpdateTaskInfo(ctx context.Context, taskInfo *dtoDownloadmanager.DownloadTaskInfo) error
	GetDownloadTaskInfoById(id int32) *dtoDownloadmanager.DownloadTaskInfo
	GetDownloadTaskInfoByAnimeId(id string) *dtoDownloadmanager.DownloadTaskInfo
}

type DownloadTask

type DownloadTask struct {
	TaskId       int32
	TaskName     string
	ChapterStart int32 // 存在 一个连接包含多集的情况,使用ChapterStart和ChapterEnd来表达
	ChapterEnd   int32
	MagnetLink   string
	StorePath    string
	AnimeId      string
}

Jump to

Keyboard shortcuts

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