issue create return web url (#257)

Update SDK

Use OptionalBool helper

Fix #254

Reviewed-on: https://gitea.com/gitea/tea/pulls/257
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-Authored-By: 6543 <6543@obermui.de>
Co-Committed-By: 6543 <6543@obermui.de>
This commit is contained in:
6543
2020-12-01 13:07:23 +08:00
committed by techknowlogick
parent e6fbba3f80
commit 476900ab41
14 changed files with 80 additions and 109 deletions

View File

@ -23,22 +23,22 @@ var jsonHeader = http.Header{"content-type": []string{"application/json"}}
// Version return the library version
func Version() string {
return "0.13.0"
return "0.14.0"
}
// Client represents a Gitea API client.
type Client struct {
url string
accessToken string
username string
password string
otp string
sudo string
debug bool
client *http.Client
ctx context.Context
serverVersion *version.Version
versionLock sync.RWMutex
url string
accessToken string
username string
password string
otp string
sudo string
debug bool
client *http.Client
ctx context.Context
serverVersion *version.Version
getVersionOnce sync.Once
}
// Response represents the gitea response
@ -56,7 +56,7 @@ func NewClient(url string, options ...func(*Client)) (*Client, error) {
for _, opt := range options {
opt(client)
}
if err := client.checkServerVersionGreaterThanOrEqual(version1_10_0); err != nil {
if err := client.checkServerVersionGreaterThanOrEqual(version1_11_0); err != nil {
return nil, err
}
return client, nil