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
paddy@4 1 package api
paddy@4 2
paddy@4 3 import (
paddy@4 4 "code.secondbit.org/api.hg"
paddy@4 5 "code.secondbit.org/ducky/subscriptions.hg"
paddy@4 6 )
paddy@4 7
paddy@16 8 // Response is used to structure the output returned as HTTP responses
paddy@16 9 // to requests.
paddy@4 10 type Response struct {
paddy@4 11 Subscriptions []subscriptions.Subscription `json:"subscriptions,omitempty"`
paddy@4 12 Errors []api.RequestError `json:"errors,omitempty"`
paddy@4 13 }