forked from google/go-github
-
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.
return Response object from all API functions
The truth is, this change makes me sad. It's a breaking change for all clients and it adds more complexity to the library surface. In most cases, clients will simply drop the Response object on the floor (which is actually all the library itself was doing before this change... now we're just pushing that off to the client). Initially, the Response object will be primarily of interest for functions that return paginated result sets, since the Response.NextPage field is the only way to know for sure if there are more pages that should be fetched. And this is really the cleanest way to get at that data, so in that respect this change isn't so bad. It's also worth noting that returning the raw Response object makes a lot more since in a GitHub library than it may in others, given how GitHub makes liberal (read: proper) use of HTTP request and response headers. Other APIs, like Google's various APIs for example, tend to push things like pagination links into the response body. While this is certainly less of a purist view in terms of REST, it does make the lives of client developers a lot easier, since then the response body contains everything you need to know. But whatever; this is how GitHub rolls, so we'll roll right along with them. (Somewhat ironically we are ignoring the RESTful links in the GitHub response bodies, since we're actually calling the API in an RPC style and don't do anything with those links.) We still don't have an easy way to set arbitrary request headers, but that's a problem for another day. Fixes google#22
- Loading branch information
1 parent
18ed217
commit a51d6b4
Showing
40 changed files
with
494 additions
and
512 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
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
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
Oops, something went wrong.