Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use go-querystring for constructing URLs #56

Closed
wants to merge 4 commits into from

Conversation

willnorris
Copy link
Collaborator

This demonstrates the use of go-querystring (which isn't actually published yet... I'm still waiting on an internal code review at Google) to construct request URLs. This also starts using ListOptions as an embedded struct inside our other Options structs that include pagination.

I ended up creating a new library rather than using uritemplates like I had originally mentioned in #50. A number of GitHub's API URLs have different bases depending on whether or not you are making a request on behalf of the authenticated user (e.g. /user/repos vs /users/foo/repos), which made using uritemplates a little awkward. Additionally, using uritemplates would still require changes in two places whenever a new parameter gets added... once in the Options struct, and once in the uri template string. Writing a custom library for this means we can drive everything from tags on the struct fields, which I really like.

@ktoso: see what you think, since you were previously working to clean up this code as well.

willnorris and others added 4 commits September 9, 2013 15:17
we're not actually testing if empty values are being omitted yet, but
udpate testFormValues to easily check this in the future
@ktoso
Copy link
Contributor

ktoso commented Sep 10, 2013

I took a look yesterday in fact... Seems nice - I'd like to see the impl though - which I see today I can already it seems - so will do that :-)

willnorris added a commit that referenced this pull request Sep 24, 2013
this is a breaking change for a handful of Option structs that were
defining the Page option directly (they now embed ListOptions).

finishes fixing #56
@willnorris willnorris deleted the opts branch April 7, 2014 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants