Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadWithContext ¶
func DownloadWithContext(ctx context.Context, dl *DownloadTask) (err error)
Types ¶
type DownloadTask ¶ added in v1.0.7
func NewDownloadTask ¶ added in v1.0.8
func NewDownloadTask(link, path string) *DownloadTask
type DownloadTasks ¶ added in v1.0.8
type DownloadTasks struct {
// contains filtered or unexported fields
}
func Batch ¶
func Batch(tasks *DownloadTasks, concurrent int, eachTimeout time.Duration) *DownloadTasks
func NewDownloadTasks ¶ added in v1.0.8
func NewDownloadTasks() *DownloadTasks
func (*DownloadTasks) Add ¶ added in v1.0.8
func (d *DownloadTasks) Add(link, path string)
func (*DownloadTasks) ForEach ¶ added in v1.0.8
func (d *DownloadTasks) ForEach(f func(t *DownloadTask))
type Get ¶ added in v1.0.7
type Get struct { OnEachStart func(t *DownloadTask) OnEachStop func(t *DownloadTask) OnEachSkip func(t *DownloadTask) Header http.Header Client http.Client }
func (*Get) Batch ¶ added in v1.0.7
func (g *Get) Batch(tasks *DownloadTasks, concurrent int, eachTimeout time.Duration) *DownloadTasks
func (*Get) Download ¶ added in v1.0.7
func (g *Get) Download(task *DownloadTask, timeout time.Duration) (err error)
func (*Get) DownloadWithContext ¶ added in v1.0.7
func (g *Get) DownloadWithContext(ctx context.Context, task *DownloadTask) (err error)
Click to show internal directories.
Click to hide internal directories.