when initializing a slice of concrete structs, it's not necessary to
declare the type of each item in the slice, since the compiler knows
what you mean.
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#22
Repository service:
ListLanguages : Allows a user to list the languages for a repository
Activity service:
ListStarred : Allows a user to list the starred repositories for a user
Since the library has received external contributions, Google is no
longer the sole copyright holder. Update the boilerplate at the top of
each file to reflect that, and add AUTHORS and CONTRIBUTORS files to
track this information.
Also properly return a 204 response on methods that don't include a
response body. This has no actual effect on current tests, but more
accurately reflects what the GitHub API really returns and might make a
difference in the future.
- standardize on "url_" for internal vars rather than "urls" or "url"
- move var definition closer to first use in several tests
- add .gitignore for test binary
This commit adds the core library funcationality and establishes the
general calling style and testing structure. Only a few GitHub API
methods related to organizations and repositories are included in this
first commit, mainly to cement the calling style.