Skip to content

Commit

Permalink
Rate limits (#442)
Browse files Browse the repository at this point in the history
* Initial

* using master

* Use IDL 3.4.0

* v3.4.25
  • Loading branch information
phliar authored May 5, 2020
1 parent 9027abb commit 02cd50b
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 88 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changelog

## v3.4.25 (unreleased)
## v3.4.26 (unreleased)
- Nothing changed yet.

## v3.4.24 (unreleased)
## v3.4.25 (2020-05-05)
- Add the RateLimit error.

## v3.4.24 (2020-05-04)
- Update the copyright messages to 2020.
- Temporarily remove the Docstore reserved word list

Expand Down
13 changes: 13 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ func ErrorIsAlreadyExists(err error) bool {
return ok
}

// ErrRateLimited is an error returned when the rate limit is exceeded.
type ErrRateLimited struct{}

func (*ErrRateLimited) Error() string {
return "rate limited"
}

// ErrorIsRateLimited is an error returned when the rate limit is exceeded.
func ErrorIsRateLimited(err error) bool {
_, ok := errors.Cause(err).(*ErrRateLimited)
return ok
}

// Client defines the methods to operate with DOSA entities
type Client interface {
// GetRegistrar returns the registrar
Expand Down
140 changes: 58 additions & 82 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import:
- package: github.com/gofrs/uuid
version: ^3.1.0
- package: github.com/uber/dosa-idl
version: ^3.3.1
version: ^3.4.0
subpackages:
- .gen/dosa
- .gen/dosa/dosaclient
Expand Down
3 changes: 1 addition & 2 deletions mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
package dosa

// VERSION indicates the dosa client version
const VERSION = "3.4.24"
const VERSION = "3.4.25"

0 comments on commit 02cd50b

Please sign in to comment.