A Go package that allows you to download multiple files concurrently.
Get Files, One Goroutine at a time
go get github.com/colt005/bulkIt
import "github.com/colt005/bulkIt"
c := &http.Client{}
maxThreads := 50
b := bulkIt.NewBulkIt(c,maxThreads)
package main
import (
"net/http"
"github.com/colt005/bulkIt"
)
func main() {
c := &http.Client{}
maxThreads := 10
b := bulkIt.NewBulkIt(c, maxThreads)
b.SaveFilesByUrls([]string{"https://www.sample-videos.com/img/Sample-jpg-image-1mb.jpg"}, "./")
}
Create a new bulkItClient.
- Params
- c - The bulkIt package's http client for sending out http requests.If you specify nil, the package will utilise the default http client.
- maxThreads - The maximum number of go routines that may be executed simultaneously to send out http requests. If the value is sepcified as 0, It will default to 30.
SaveFilesByUrls takes slice of urls and the path where the files need to be saved.