Documentation ¶
Overview ¶
Package downloader is responsible for Weles system's job artifact downloading.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrQueueFull is returned when download queue is full. ErrQueueFull = errors.New("downlad queue is full") )
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader implements ArtifactDownloader interface.
func NewDownloader ¶
func NewDownloader(notification chan weles.ArtifactStatusChange, workerCount, queueCap int, ) *Downloader
NewDownloader returns Downloader initialized with default queue length
func (*Downloader) CheckInCache ¶
func (d *Downloader) CheckInCache(URI weles.ArtifactURI) (weles.ArtifactInfo, error)
CheckInCache is part of implementation of ArtifactDownloader interface. TODO implement.
func (*Downloader) Close ¶
func (d *Downloader) Close()
Close is part of implementation of ArtifactDownloader interface. It waits for running download jobs to stop and closes used channels.
func (*Downloader) Download ¶
func (d *Downloader) Download(URI weles.ArtifactURI, path weles.ArtifactPath, ch chan weles.ArtifactStatusChange) error
Download is part of implementation of ArtifactDownloader interface. It puts new downloadJob on the queue.
Click to show internal directories.
Click to hide internal directories.