Skip to content

Commit 9e5e84b

Browse files
committed
Migrate to Go module v2 for semver-correct major release
Update module path to github.com/uploadcare/uploadcare-go/v2 and rewrite all import paths across 44 files. Set ClientVersion to 2.0.0 to align with the release tag (was 0.1.0 since v1.0, never updated).
1 parent 82f79a1 commit 9e5e84b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+128
-104
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 0.2.0
2+
3+
BREAKING CHANGES:
4+
5+
* Target REST API v0.7 (previously v0.5)
6+
* Remove `ImageInfo` and `VideoMeta` fields from `file.BasicFileInfo` — use `ContentInfo.Image` and `ContentInfo.Video`
7+
* Remove `RecognitionInfo` field from `file.Info` — use `AppData`
8+
* Add `Metadata` and `AppData` fields to `file.Info`
9+
* Remove `group.Store()` method (endpoint removed in v0.7)
10+
* Remove `file.Copy()` method and `file.CopyParams` type — use `LocalCopy()` and `RemoteCopy()`
11+
* Remove `file.OrderBySizeAsc` and `file.OrderBySizeDesc` constants (not supported in v0.7)
12+
* Remove `APIv05` and `APIv06` constants
13+
* Minimum Go version is now 1.25
14+
15+
IMPROVEMENTS:
16+
17+
* Add `UserAgent` field to `ucare.Config` for custom agent identification
18+
* Replace `http.NewRequest` + `WithContext` with `http.NewRequestWithContext`
19+
* Throttle retry loops now respect context cancellation
20+
* Replace `ioutil` usage with `io` equivalents
21+
* Replace `go-env` dependency with `os.Getenv`
22+
* Update `stretchr/testify` to v1.10.0
23+
* Update CI: Go 1.25, modern GitHub Actions versions, remove deprecated golint
24+
* Integration tests skip gracefully when credentials are not set
25+
* Fix errors in package documentation examples
26+
127
## 1.2.1 (September 1, 2020)
228

329
IMPROVEMENTS:

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Golang API client for Uploadcare
22

33
![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)
4-
[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://pkg.go.dev/github.com/uploadcare/uploadcare-go/ucare)
5-
![](https://github.com/uploadcare/uploadcare-go/workflows/test/badge.svg)
4+
[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://pkg.go.dev/github.com/uploadcare/uploadcare-go/v2/ucare)
5+
![](https://github.com/uploadcare/uploadcare-go/v2/workflows/test/badge.svg)
66

77
Uploadcare Golang API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
88

@@ -21,18 +21,18 @@ Go 1.25
2121
Install uploadcare-go with:
2222

2323
```
24-
go get -u -v github.com/uploadcare/uploadcare-go/...
24+
go get -u -v github.com/uploadcare/uploadcare-go/v2/...
2525
```
2626

2727
Then import it using:
2828

2929
```go
3030
import (
31-
"github.com/uploadcare/uploadcare-go/ucare"
32-
"github.com/uploadcare/uploadcare-go/file"
33-
"github.com/uploadcare/uploadcare-go/group"
34-
"github.com/uploadcare/uploadcare-go/upload"
35-
"github.com/uploadcare/uploadcare-go/conversion"
31+
"github.com/uploadcare/uploadcare-go/v2/ucare"
32+
"github.com/uploadcare/uploadcare-go/v2/file"
33+
"github.com/uploadcare/uploadcare-go/v2/group"
34+
"github.com/uploadcare/uploadcare-go/v2/upload"
35+
"github.com/uploadcare/uploadcare-go/v2/conversion"
3636
)
3737
```
3838

@@ -58,7 +58,7 @@ if err != nil {
5858

5959
## Usage
6060

61-
For a comprehensive list of examples, check out the [API documentation](https://pkg.go.dev/github.com/uploadcare/uploadcare-go/ucare).
61+
For a comprehensive list of examples, check out the [API documentation](https://pkg.go.dev/github.com/uploadcare/uploadcare-go/v2/ucare).
6262
Below are a few usage examples:
6363

6464
Getting a list of files:
@@ -127,11 +127,11 @@ if err != nil {
127127

128128
## Useful links
129129

130-
[Golang API client documentation](https://pkg.go.dev/github.com/uploadcare/uploadcare-go/ucare)
130+
[Golang API client documentation](https://pkg.go.dev/github.com/uploadcare/uploadcare-go/v2/ucare)
131131
[Uploadcare documentation](https://uploadcare.com/docs/?utm_source=github&utm_medium=referral&utm_campaign=uploadcare-go)
132132
[Upload API reference](https://uploadcare.com/api-refs/upload-api/?utm_source=github&utm_medium=referral&utm_campaign=uploadcare-go)
133133
[REST API reference](https://uploadcare.com/api-refs/rest-api/?utm_source=github&utm_medium=referral&utm_campaign=uploadcare-go)
134-
[Changelog](https://github.com/uploadcare/uploadcare-go/blob/master/CHANGELOG.md)
134+
[Changelog](https://github.com/uploadcare/uploadcare-go/v2/blob/master/CHANGELOG.md)
135135
[Contributing guide](https://github.com/uploadcare/.github/blob/master/CONTRIBUTING.md)
136-
[Security policy](https://github.com/uploadcare/uploadcare-go/security/policy)
136+
[Security policy](https://github.com/uploadcare/uploadcare-go/v2/security/policy)
137137
[Support](https://github.com/uploadcare/.github/blob/master/SUPPORT.md)

conversion/conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"net/http"
77

8-
"github.com/uploadcare/uploadcare-go/internal/codec"
8+
"github.com/uploadcare/uploadcare-go/v2/internal/codec"
99
)
1010

1111
// Params holds conversion job params

conversion/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package conversion
22

33
import (
4-
"github.com/uploadcare/uploadcare-go/uclog"
4+
"github.com/uploadcare/uploadcare-go/v2/uclog"
55
)
66

77
var log uclog.Logger

conversion/service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package conversion
33
import (
44
"context"
55

6-
"github.com/uploadcare/uploadcare-go/internal/config"
7-
"github.com/uploadcare/uploadcare-go/internal/svc"
8-
"github.com/uploadcare/uploadcare-go/ucare"
6+
"github.com/uploadcare/uploadcare-go/v2/internal/config"
7+
"github.com/uploadcare/uploadcare-go/v2/internal/svc"
8+
"github.com/uploadcare/uploadcare-go/v2/ucare"
99
)
1010

1111
// Service describes all conversion related API

file/batch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"net/http"
66

7-
"github.com/uploadcare/uploadcare-go/internal/codec"
7+
"github.com/uploadcare/uploadcare-go/v2/internal/codec"
88
)
99

1010
type batchParams []string

file/copy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"net/http"
66

7-
"github.com/uploadcare/uploadcare-go/internal/codec"
8-
"github.com/uploadcare/uploadcare-go/ucare"
7+
"github.com/uploadcare/uploadcare-go/v2/internal/codec"
8+
"github.com/uploadcare/uploadcare-go/v2/ucare"
99
)
1010

1111
// LocalCopyParams is used when copy original files or their modified

file/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"net/http"
88

9-
"github.com/uploadcare/uploadcare-go/internal/config"
9+
"github.com/uploadcare/uploadcare-go/v2/internal/config"
1010
)
1111

1212
// Info acquires some file-specific info

file/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"net/http"
77
"time"
88

9-
"github.com/uploadcare/uploadcare-go/internal/codec"
9+
"github.com/uploadcare/uploadcare-go/v2/internal/codec"
1010
)
1111

1212
// ListParams holds all possible params for for the List method

file/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package file
22

33
import (
4-
"github.com/uploadcare/uploadcare-go/uclog"
4+
"github.com/uploadcare/uploadcare-go/v2/uclog"
55
)
66

77
var log uclog.Logger

0 commit comments

Comments
 (0)