downloader

package
v0.0.0-...-539a64a Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Servers []nntp.Config `yaml:"servers"`
}

type DownloadFileRequest

type DownloadFileRequest struct {
	Info   *nzb.File
	Folder string
	// contains filtered or unexported fields
}

type Downloader

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

func New

func New(conf *Config) *Downloader

func (*Downloader) Download

func (d *Downloader) Download(ctx context.Context, n *nzb.Nzb) error

type FileWorker

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

func (*FileWorker) WriteAt

func (w *FileWorker) WriteAt(p []byte, off int64) (n int, err error)

WriteAt implements io.WriterAt.

type Job

type Job struct {
	Name string
	// Ctx     context.Context
	Groups  []string
	Segment *nzb.Segment
	Decode  decoder.Decoder
	Buff    []byte

	OnDone func(error)
	// contains filtered or unexported fields
}

type Queue

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

func (*Queue) Add

func (q *Queue) Add(j *Job)

func (*Queue) Get

func (q *Queue) Get() *Job

func (*Queue) Len

func (q *Queue) Len() int

Jump to

Keyboard shortcuts

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