Skip to content

Commit

Permalink
chore: use go1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
Azhovan committed Aug 25, 2024
1 parent ebeb20c commit 2ac8252
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
go-version: '1.22'

- name: Test
run: go test -v ./...
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,33 @@ With a focus on reliability and flexibility, it's particularly adept at handling
## Download

```shell
go install github.com/Azhovan/durable-resume@main
go install github.com/azhovan/durable-resume@latest
```

## Usage
The following command download and save the context of the given file in the remote address in the current directory
and in a file called `some-files.pdf`
```shell
exmapleURL=https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
./dr download -u $exmapleURL --out=$(pwd) -f some-files
$ durable-resume download -u $exmapleURL --out=$(pwd) -f some-files


# see help
$ durable-resume download -h

download remote file and store it in a local directory

Usage:
dr download --url [ADDRESS] --out [DIRECTORY] [flags]

Flags:
-f, --file string The downloaded file name
-h, --help help for download
-o, --out string The local file target directory to save file.
-n, --segment-count int The number of segments for download a file. (default 4)
-s, --segment-size int The size of each segment for download a file.
-u, --url string The remote file address to download.

```


Expand Down
2 changes: 1 addition & 1 deletion cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func newDownloadCmd(output io.Writer) *cobra.Command {
cmd.Flags().StringVarP(&opts.remoteURL, "url", "u", "", "The remote file address to download.")
cmd.Flags().StringVarP(&opts.dstDIR, "out", "o", "", "The local file target directory to save file.")
cmd.Flags().Int64VarP(&opts.segSize, "segment-size", "s", 0, "The size of each segment for download a file.")
cmd.Flags().IntVarP(&opts.segCount, "segment-count", "n", download.DefaultNumberOfSegments, "The number of segments for download a file.")
cmd.Flags().IntVarP(&opts.segCount, "segment-count", "n", download.DefaultNumberOfSegments, "The number of segments to use for file download. This is auto-adjusted if not explicitly provided.")
cmd.Flags().StringVarP(&opts.filename, "file", "f", "", "The downloaded file name")

return cmd
Expand Down

0 comments on commit 2ac8252

Please sign in to comment.