https://github.com/bleenco/go-resumable
Go library providing multiple simultaneous and resumable uploads.
https://github.com/bleenco/go-resumable
Last synced: 6 months ago
JSON representation
Go library providing multiple simultaneous and resumable uploads.
- Host: GitHub
- URL: https://github.com/bleenco/go-resumable
- Owner: bleenco
- License: mit
- Created: 2017-11-01T08:35:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T22:33:04.000Z (almost 8 years ago)
- Last Synced: 2025-03-22T22:24:00.934Z (7 months ago)
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 41
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-resumable
It's a Go library providing multiple simultaneous and resumable uploads.
Library is designed to introduce fault-tolerance into the upload of large files throught HTTP.
This is done by splitting each file into small chunks; whenever the upload of a chunk fails, uploading is retried until the procedure completes.
This allows uploads to automatically resume uploading after a network connection is lost either locally or to the server.
Additionally, it allows users to pause, resume and even recover uploads without losing state.### Demo
In this demo upload is paused for 2 seconds after initial second, then it uploads till 100%.
Please check [here](https://github.com/bleenco/go-resumable/blob/master/examples/progress.go) for full code sample.
![]()
### Installation
```sh
$ go get -v https://github.com/bleenco/go-resumable
```### Usage
```go
import (
"net/http""github.com/bleenco/go-resumable"
)func main() {
httpClient := &http.Client{}
url := "http://example.com/upload"
filePath := "/path/to/file/to/upload.zip"
chunkSize := int(1 * (1 << 20)) // 1MB
client := resumable.New(url, filePath, httpClient, chunkSize)client.Init()
client.Start()resumable.WG.Wait() // this is important
}
```### Licence
MIT