ducky/subscriptions

Paddy 2015-10-04 Parent:36e90e828dd0

16:b063bc0a6e84 Go to Latest

ducky/subscriptions/api/response.go

Make api subpackage golint-passing. Add comments to all the exported functions, methods, and variables in the api subpackage, to make golint happy. Also, make the individual endpoints in the api subpackage unexported, as there's no real use case for exporting them. The handlers depend on the placeholders in the endpoint, so we need them to be controlled in unison, which means it's probably a bad idea to declare the route outside of the API package. And the only reason to expose the Handler is so people can declare custom endpoints.

History
     1.1 --- a/api/response.go	Wed Sep 30 01:33:53 2015 -0700
     1.2 +++ b/api/response.go	Sun Oct 04 21:58:07 2015 -0700
     1.3 @@ -5,6 +5,8 @@
     1.4  	"code.secondbit.org/ducky/subscriptions.hg"
     1.5  )
     1.6  
     1.7 +// Response is used to structure the output returned as HTTP responses
     1.8 +// to requests.
     1.9  type Response struct {
    1.10  	Subscriptions []subscriptions.Subscription `json:"subscriptions,omitempty"`
    1.11  	Errors        []api.RequestError           `json:"errors,omitempty"`