Skip to content

Commit

Permalink
Added state query option
Browse files Browse the repository at this point in the history
  • Loading branch information
djthorpe committed Jun 30, 2021
1 parent 4c9c028 commit 63b1e06
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/client/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ func OptUpdatedAfter(value time.Time) RequestOpt {
}
}

// OptState appends state query onto the request
func OptState(value string) RequestOpt {
return func(r *http.Request) error {
params := r.URL.Query()
params.Set("state", value)
r.URL.RawQuery = params.Encode()
return nil
}
}

// OptRateLimit sets the limit on number of requests per second
// and the API will sleep when exceeded. For account tokens this is 1 per second
func OptRateLimit(value float32) ClientOpt {
Expand Down

0 comments on commit 63b1e06

Please sign in to comment.