🧱 Chunk is a download manager for slow and unstable servers

Moves to Tangled

+23 -51
-1
.github/FUNDING.yml
··· 1 - github: [cuducos]
-11
.github/workflows/gofmt.yaml
··· 1 - name: Format 2 - on: [push, pull_request] 3 - jobs: 4 - format: 5 - runs-on: ubuntu-latest 6 - steps: 7 - - uses: actions/checkout@v6 8 - - uses: actions/setup-go@v6 9 - with: 10 - go-version: "1.25" 11 - - run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
-13
.github/workflows/golint.yaml
··· 1 - name: Lint 2 - on: [push, pull_request] 3 - jobs: 4 - lint: 5 - runs-on: ubuntu-latest 6 - steps: 7 - - uses: actions/checkout@v6 8 - - uses: actions/setup-go@v6 9 - with: 10 - go-version: "1.25.x" 11 - - uses: golangci/golangci-lint-action@v9 12 - with: 13 - version: v2
-16
.github/workflows/tests.yaml
··· 1 - name: Tests 2 - on: [push, pull_request] 3 - jobs: 4 - test: 5 - strategy: 6 - fail-fast: false 7 - matrix: 8 - os: ["windows-latest", "ubuntu-latest", "macOS-latest"] 9 - go: ["1.24.x", "1.25.x"] 10 - runs-on: ${{ matrix.os }} 11 - steps: 12 - - uses: actions/checkout@v6 13 - - uses: actions/setup-go@v6 14 - with: 15 - go-version: ${{ matrix.go }} 16 - - run: "go test --race ."
+15
.tangled/workflows/tests.yaml
··· 1 + when: 2 + - event: ["push"] 3 + branch: ["main"] 4 + engine: "nixery" 5 + dependencies: 6 + nixpkgs: 7 + - go 8 + - golangci-lint 9 + steps: 10 + - name: Formatting 11 + command: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi 12 + - name: Linter 13 + command: golangci-lint run ./... 14 + - name: Tests 15 + command: go test -v -race ./...
+5 -7
README.md
··· 1 1 # Chunk 2 2 3 - [![Tests](https://github.com/cuducos/chunk/actions/workflows/tests.yaml/badge.svg)](https://github.com/cuducos/chunk/actions/workflows/tests.yaml) 4 - [![Format](https://github.com/cuducos/chunk/actions/workflows/gofmt.yaml/badge.svg)](https://github.com/cuducos/chunk/actions/workflows/gofmt.yaml) 5 - [![Lint](https://github.com/cuducos/chunk/actions/workflows/golint.yaml/badge.svg)](https://github.com/cuducos/chunk/actions/workflows/golint.yaml) 6 - [![GoDoc](https://godoc.org/github.com/cuducos/chunk?status.svg)](https://godoc.org/github.com/cuducos/chunk) 3 + [![GoDoc](https://godoc.org/tangled.org/cuducos.me/chunk?status.svg)](https://godoc.org/tangled.org/cuducos.me/chunk) 4 + [![Sponsors](https://img.shields.io/github/sponsors/cuducos)](https://github.com/sponsors/cuducos) 7 5 8 6 Chunk is a download tool for slow and unstable servers. 9 7 ··· 11 9 12 10 ### CLI 13 11 14 - Install it with `go install github.com/cuducos/chunk/cmd/chunk@latest` then: 12 + Install it with `go install tangled.org/cuducos.me/chunk/cmd/chunk@latest` then: 15 13 16 14 ```console 17 15 $ chunk <URLs> ··· 21 19 22 20 ### API 23 21 24 - The [`Download`](https://pkg.go.dev/github.com/cuducos/chunk#Download) method returns a channel with [`DownloadStatus`](https://pkg.go.dev/github.com/cuducos/chunk#DownloadStatus) statuses. This channel is closed once all downloads are finished, but the user is in charge of handling errors. 22 + The [`Download`](https://pkg.go.dev/tangled.org/cuducos.me/chunk#Download) method returns a channel with [`DownloadStatus`](https://pkg.go.dev/tangled.org/cuducos.me/chunk#DownloadStatus) statuses. This channel is closed once all downloads are finished, but the user is in charge of handling errors. 25 23 26 24 #### Simplest use case 27 25 ··· 67 65 68 66 ## Why? 69 67 70 - The idea of the project emerged as it was difficult for [Minha Receita](https://github.com/cuducos/minha-receita) to handle the download of [37 files that adds up to just approx. 5Gb](https://www.gov.br/receitafederal/pt-br/assuntos/orientacao-tributaria/cadastros/consultas/dados-publicos-cnpj). Most of the download solutions out there (e.g. [`got`](https://github.com/melbahja/got)) seem to be prepared for downloading large files, not for downloading from slow and unstable servers — which is the case at hand. 68 + The idea of the project emerged as it was difficult for [Minha Receita](https://codeberg.org/cuducos/minha-receita) to handle the download of [37 files that adds up to just approx. 5Gb](https://www.gov.br/receitafederal/pt-br/assuntos/orientacao-tributaria/cadastros/consultas/dados-publicos-cnpj). Most of the download solutions out there (e.g. [`got`](https://github.com/melbahja/got)) seem to be prepared for downloading large files, not for downloading from slow and unstable servers — which is the case at hand. 71 69
+1 -1
cmd/chunk/download_progress.go
··· 5 5 "fmt" 6 6 "time" 7 7 8 - "github.com/cuducos/chunk" 8 + "tangled.org/cuducos.me/chunk" 9 9 ) 10 10 11 11 func humanSize(s float64) string {
+1 -1
cmd/chunk/main.go
··· 6 6 "os" 7 7 "time" 8 8 9 - "github.com/cuducos/chunk" 10 9 "github.com/spf13/cobra" 10 + "tangled.org/cuducos.me/chunk" 11 11 ) 12 12 13 13 func checkOutputDir() error {
+1 -1
go.mod
··· 1 - module github.com/cuducos/chunk 1 + module tangled.org/cuducos.me/chunk 2 2 3 3 go 1.25 4 4