Closed dhruvsinghal closed 9 years ago
@pengwynn PTAL.
Also, I'm just curious as to why the service is initialized to a single URL. Won't that prevent the service from being reused? Also, why is it the responsibility of the user code to fill in the placeholders in the URL? Shouldn't it be parameters to the respective service calls (like UserSearch, CodeSearch, etc.)?
Also, I'm just curious as to why the service is initialized to a single URL. Won't that prevent the service from being reused?
@dhruvsinghal It's a tradeoff. By accepting URLs, the client promotes passing around Hypermedia link relations, like those we get from the API root.
Shouldn't it be parameters to the respective service calls (like UserSearch, CodeSearch, etc.)?
I think we've got the same params for all four search flavors: q
, page
, sort
, and order
. Those could be named parameters or a SearchParameters
struct I suppose.
@dhruvsinghal This is looking good. I'm tempted to implement another search type on this same branch before merging, just to see how our pattern will emerge.
@jingweno: any feedback?
@pengwynn Sure, I'll implement another search, or if you want I can implement all the four searches on this branch itself.
@pengwynn PTAL. I've implemented issue search as well.
@pengwynn @jingweno, I propose the following restructuring of the SearchService
Go API:
Client
object, obtain a SearchService
object by calling Search()
UserSearch
on the SearchService
object.Does thais sound reasonable?
In general it looks good except for some minor issues. Cheers!
@jingweno Thanks for your comments!
@jingweno and @pengwynn PTAL.
:+1: :shipit:
@jingweno Should I merge this branch into master?
Gonna go ahead and merge this since it follows the same pattern as the other API methods.
@jingweno I'd like to explore how we can better support query params in methods like this. /cc https://github.com/octokit/go-octokit/issues/72
@pengwynn
I'd like to explore how we can better support query params in methods like this. /cc #72
Yeah, this is a miss in the current design. Let's chat more about it in #72.
@pengwynn I have implemented the user search. Please have a look.