diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 1a36a55..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [cuducos] diff --git a/.github/workflows/gofmt.yaml b/.github/workflows/gofmt.yaml deleted file mode 100644 index 309e93d..0000000 --- a/.github/workflows/gofmt.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Format -on: [push, pull_request] -jobs: - format: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 - with: - go-version: "1.25" - - run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi diff --git a/.github/workflows/golint.yaml b/.github/workflows/golint.yaml deleted file mode 100644 index 27d6844..0000000 --- a/.github/workflows/golint.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: Lint -on: [push, pull_request] -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 - with: - go-version: "1.25.x" - - uses: golangci/golangci-lint-action@v9 - with: - version: v2 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml deleted file mode 100644 index dd82cc2..0000000 --- a/.github/workflows/tests.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Tests -on: [push, pull_request] -jobs: - test: - strategy: - fail-fast: false - matrix: - os: ["windows-latest", "ubuntu-latest", "macOS-latest"] - go: ["1.24.x", "1.25.x"] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 - with: - go-version: ${{ matrix.go }} - - run: "go test --race ." diff --git a/.tangled/workflows/tests.yaml b/.tangled/workflows/tests.yaml new file mode 100644 index 0000000..f9cbcbe --- /dev/null +++ b/.tangled/workflows/tests.yaml @@ -0,0 +1,15 @@ +when: + - event: ["push"] + branch: ["main"] +engine: "nixery" +dependencies: + nixpkgs: + - go + - golangci-lint +steps: + - name: Formatting + command: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi + - name: Linter + command: golangci-lint run ./... + - name: Tests + command: go test -v -race ./... diff --git a/README.md b/README.md index 0bc51cf..d419962 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # Chunk -[![Tests](https://github.com/cuducos/chunk/actions/workflows/tests.yaml/badge.svg)](https://github.com/cuducos/chunk/actions/workflows/tests.yaml) -[![Format](https://github.com/cuducos/chunk/actions/workflows/gofmt.yaml/badge.svg)](https://github.com/cuducos/chunk/actions/workflows/gofmt.yaml) -[![Lint](https://github.com/cuducos/chunk/actions/workflows/golint.yaml/badge.svg)](https://github.com/cuducos/chunk/actions/workflows/golint.yaml) -[![GoDoc](https://godoc.org/github.com/cuducos/chunk?status.svg)](https://godoc.org/github.com/cuducos/chunk) +[![GoDoc](https://godoc.org/tangled.org/cuducos.me/chunk?status.svg)](https://godoc.org/tangled.org/cuducos.me/chunk) +[![Sponsors](https://img.shields.io/github/sponsors/cuducos)](https://github.com/sponsors/cuducos) Chunk is a download tool for slow and unstable servers. @@ -11,7 +9,7 @@ Chunk is a download tool for slow and unstable servers. ### CLI -Install it with `go install github.com/cuducos/chunk/cmd/chunk@latest` then: +Install it with `go install tangled.org/cuducos.me/chunk/cmd/chunk@latest` then: ```console $ chunk @@ -21,7 +19,7 @@ Use `--help` for detailed instructions. ### API -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. +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. #### Simplest use case @@ -67,5 +65,5 @@ In order to avoid unnecessary stress on the server, `chunk` relies not only on H ## Why? -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. +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. diff --git a/cmd/chunk/download_progress.go b/cmd/chunk/download_progress.go index 85db47e..1c5a57c 100644 --- a/cmd/chunk/download_progress.go +++ b/cmd/chunk/download_progress.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/cuducos/chunk" + "tangled.org/cuducos.me/chunk" ) func humanSize(s float64) string { diff --git a/cmd/chunk/main.go b/cmd/chunk/main.go index 82d3907..2fbbdfe 100644 --- a/cmd/chunk/main.go +++ b/cmd/chunk/main.go @@ -6,8 +6,8 @@ import ( "os" "time" - "github.com/cuducos/chunk" "github.com/spf13/cobra" + "tangled.org/cuducos.me/chunk" ) func checkOutputDir() error { diff --git a/go.mod b/go.mod index 4b43557..42c8f71 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cuducos/chunk +module tangled.org/cuducos.me/chunk go 1.25