Skip to content

yyoshiki41/parallel-dl

Repository files navigation

parallel-dl

parallel-dl is a library for downloading files in parallel.

godoc build codecov go report

  • Go 1.7 or newer

Features

parallel-dl allows you to control these features:

  • HTTP Timeouts
  • Maximum number of concurrent requests
  • Maximum number of errors before giving up the whole requests
  • Maximum number of retries before giving up a request

API

  • Download()

That's all !

Examples

opt := &paralleldl.Options{
	Output:           "/path/to/download",
	MaxConcurrents:   2,
	MaxErrorRequests: 1,
	MaxAttempts:      4,
}
client, err := paralleldl.New(opt)
if err != nil {
	log.Fatal(err)
}

lists := []string{
	"http://example.com/file1",
	"http://example.com/file2",
	"http://example.com/file3",
	"http://example.com/file4",
}
errCnt := client.Download(lists)

Minimum Options

opt := &paralleldl.Options{
	Output: "/path/to/download",
}

License


The MIT License

Author

Yoshiki Nakagawa