download

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokenDownloadError added in v1.2.0

type BrokenDownloadError struct{}

func (BrokenDownloadError) Error added in v1.2.0

func (e BrokenDownloadError) Error() string

type CancelledDownloadError added in v1.2.0

type CancelledDownloadError string

func (CancelledDownloadError) Error added in v1.2.0

func (e CancelledDownloadError) Error() string

type Download

type Download struct {
	Id       string    `yaml:"id"`
	Name     string    `yaml:"name"`
	URL      string    `yaml:"url"`
	Size     int64     `yaml:"size"`
	Segments []Segment `yaml:"segments"`
}

func NewDownload

func NewDownload(rawUrl string, segmentsNum uint8) (*Download, error)

func (*Download) String

func (f *Download) String() string

type FilesystemError added in v1.2.0

type FilesystemError string

func (FilesystemError) Error added in v1.2.0

func (e FilesystemError) Error() string

type IOCopyError added in v1.2.0

type IOCopyError string

func (IOCopyError) Error added in v1.2.0

func (e IOCopyError) Error() string

type InvalidFilenameError added in v1.2.0

type InvalidFilenameError struct{}

func (InvalidFilenameError) Error added in v1.2.0

func (e InvalidFilenameError) Error() string

type Manager added in v1.2.0

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

func NewManager added in v1.2.0

func NewManager(fs afero.Fs) *Manager

func (*Manager) DeleteDownloadById added in v1.2.0

func (m *Manager) DeleteDownloadById(id string) error

func (*Manager) GetDownloadById added in v1.2.0

func (m *Manager) GetDownloadById(id string) (*Download, error)

func (*Manager) GetDownloadByUrl added in v1.2.0

func (m *Manager) GetDownloadByUrl(url string) (*Download, error)

func (*Manager) ListDownloads added in v1.2.0

func (m *Manager) ListDownloads() ([]*Download, error)

func (*Manager) StartDownload added in v1.2.0

func (m *Manager) StartDownload(file *Download, ctx context.Context) error

type NetworkError added in v1.2.0

type NetworkError string

func (NetworkError) Error added in v1.2.0

func (e NetworkError) Error() string

type NonexistentDownloadError added in v1.2.0

type NonexistentDownloadError struct{}

func (NonexistentDownloadError) Error added in v1.2.0

func (e NonexistentDownloadError) Error() string

type Segment added in v1.2.0

type Segment struct {
	Id    uint8 `yaml:"id"`
	Start int64 `yaml:"start"`
	End   int64 `yaml:"end"`
}

func (*Segment) Download added in v1.2.0

func (s *Segment) Download(url string, position int64, writer io.Writer, ctx context.Context) error

func (*Segment) Filename added in v1.2.0

func (s *Segment) Filename() string

type SegmentDownloader added in v1.2.0

type SegmentDownloader interface {
	Filename() string
	Download(writer io.Writer, offset int64, ctx context.Context)
}

type SegmentOverflowError added in v1.2.0

type SegmentOverflowError struct{}

func (SegmentOverflowError) Error added in v1.2.0

func (e SegmentOverflowError) Error() string

type WorkerError added in v1.2.0

type WorkerError string

func (WorkerError) Error added in v1.2.0

func (e WorkerError) Error() string

Jump to

Keyboard shortcuts

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