Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f16388f238 | ||
![]() |
52eff84151 | ||
![]() |
03267ade9d | ||
![]() |
729681251c |
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.16
|
go-version: 1.17
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v ./...
|
run: go build -v ./...
|
||||||
|
2
.github/workflows/golangci-lint.yml
vendored
2
.github/workflows/golangci-lint.yml
vendored
@@ -15,4 +15,4 @@ jobs:
|
|||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
with:
|
with:
|
||||||
version: v1.37
|
version: v1.41.1
|
@@ -119,6 +119,7 @@ type Artist struct {
|
|||||||
ResourceURL string `json:"resource_url"`
|
ResourceURL string `json:"resource_url"`
|
||||||
URI string `json:"uri"`
|
URI string `json:"uri"`
|
||||||
URLs []string `json:"urls"`
|
URLs []string `json:"urls"`
|
||||||
|
Groups []Member `json:"groups,omitempty"`
|
||||||
DataQuality string `json:"data_quality"`
|
DataQuality string `json:"data_quality"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -105,6 +105,8 @@ func request(path string, params url.Values, resp interface{}) error {
|
|||||||
switch response.StatusCode {
|
switch response.StatusCode {
|
||||||
case http.StatusUnauthorized:
|
case http.StatusUnauthorized:
|
||||||
return ErrUnauthorized
|
return ErrUnauthorized
|
||||||
|
case http.StatusTooManyRequests:
|
||||||
|
return ErrTooManyRequests
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unknown error: %s", response.Status)
|
return fmt.Errorf("unknown error: %s", response.Status)
|
||||||
}
|
}
|
||||||
|
@@ -16,10 +16,11 @@ func (e *Error) Error() string {
|
|||||||
|
|
||||||
// APIErrors
|
// APIErrors
|
||||||
var (
|
var (
|
||||||
ErrUnauthorized = &Error{"authentication required"}
|
|
||||||
ErrCurrencyNotSupported = &Error{"currency does not supported"}
|
ErrCurrencyNotSupported = &Error{"currency does not supported"}
|
||||||
ErrUserAgentInvalid = &Error{"invalid user-agent"}
|
|
||||||
ErrInvalidReleaseID = &Error{"invalid release id"}
|
ErrInvalidReleaseID = &Error{"invalid release id"}
|
||||||
ErrInvalidSortKey = &Error{"invalid sort key"}
|
ErrInvalidSortKey = &Error{"invalid sort key"}
|
||||||
ErrInvalidUsername = &Error{"invalid username"}
|
ErrInvalidUsername = &Error{"invalid username"}
|
||||||
|
ErrTooManyRequests = &Error{"too many requests"}
|
||||||
|
ErrUnauthorized = &Error{"authentication required"}
|
||||||
|
ErrUserAgentInvalid = &Error{"invalid user-agent"}
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user