forked from ns1/ns1-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for setting URL parameters on client requests
Several NS1 API endpoints allow setting URL parameters to alter the behavior of the endpoint. For instance, a `limit` parameter can be set on the `/account/activity` endpoint to control how many events are returned in the response. This would be useful in ns1#233. This commit adds support for URL parameters by adding a new struct `Param` to the `rest` package, and updating `rest.client.Do()` and `rest.client.DoWithPagination()` to accept a variable amount of params. In order for higher level services based off of the common service to set url params, they will need to pass them through when invoking the client's `Do()` method, like so: ```golang resp, err := s.client.Do(req, &al, params...) ```
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters