worker

package
Version: v0.0.0-...-4895fb0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(wg *sync.WaitGroup, isConcurrent bool, totalSize int) (chan<- Downloader, chan Result)

NewPool create job input channels and worker for processing downloads

Types

type Downloader

type Downloader interface {
	Download(dst io.Writer) error
	FullName() string
}

Downloader is interface that wraps basic download methods

type Result

type Result struct {
	Error error
}

Result is struct for worker job result

type WriteCounter

type WriteCounter struct {
	Bar *mpb.Bar
}

WriteCounter implements writing progress to progress bar

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL