Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ProjectsURL is the URL path to manage Projects ProjectsURL = "/" + apiVersion + "/projects" // PullRequestsURL is the URL path to manage Pull Requests PullRequestsURL = "/" + apiVersion + "/pull_requests" // UsersURL is the URL path to manage Users UsersURL = "/" + apiVersion + "/users" )
Variables ¶
This section is empty.
Functions ¶
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, status int, payload interface{})
WriteResponse writes a payload to the provided writer
Types ¶
type API ¶
type API interface {
Controllers() []Controller
}
API defines a set of controllers which constitute the whole API of the application
type Controller ¶
type Controller interface {
Routes() []Route
}
Controller defines a set of HTTP routes
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse defines an error response payload
type HandleFunc ¶
type HandleFunc func(w http.ResponseWriter, r *http.Request)
HandleFunc defines a function type needed for Route constructions
type Route ¶
type Route struct { Path string Method string HandleFunc HandleFunc }
Route defines a route that will be attached to a router
Click to show internal directories.
Click to hide internal directories.