Documentation ¶
Index ¶
Constants ¶
View Source
const ( ActionDownload = "download" StatusDownloadSuccessful = "success" StatusDownloadFailed = "failed" ActionDeclare = "declare" StatusDeclareSuccessful = "success" StatusDeclareFailed = "failed" StatusCodeOK = 10000 StatusCodeFailed = 20000 )
Variables ¶
This section is empty.
Functions ¶
func Downloading ¶
func Downloading() bool
Types ¶
type DownloadCallBackContent ¶
type DownloadPart ¶
type DownloadPart struct {
// contains filtered or unexported fields
}
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
one download task <=> one Downloader
func InitDownloader ¶
func InitDownloader(downloadURL, targetFile, targetPath, token, minerID string, partSize, maxWorkers, sectorID int, decompression, depart bool, ctx context.Context) *Downloader
todo: too many params
func (*Downloader) DownloadFile ¶
func (d *Downloader) DownloadFile() error
type Transformer ¶
type Transformer struct { sync.Mutex CacheDir string SealedDir string MaxDownloader int MaxDownloadRetry int // contains filtered or unexported fields }
var ( ErrRetryExceed = errors.New("retry exceed") GlobalTransformer *Transformer )
func InitTransformer ¶
func InitTransformer(conf config.Config, ctx context.Context) *Transformer
func (*Transformer) CallBack ¶
func (t *Transformer) CallBack(content DownloadCallBackContent) error
func (*Transformer) DeclareSector ¶
func (t *Transformer) DeclareSector(sectorID int) error
func (*Transformer) Run ¶
func (t *Transformer) Run(buf chan types.Sector)
todo: run code need improve
func (*Transformer) UnProcessing ¶
func (t *Transformer) UnProcessing(sectorID int)
Click to show internal directories.
Click to hide internal directories.