Versions in this module Expand all Collapse all v0 v0.0.0 Aug 29, 2016 Changes in this version + func Error(w http.ResponseWriter, err string, code int) + func NoContent(w http.ResponseWriter) + func TestEmptyResponse(t *testing.T, w *httptest.ResponseRecorder) + func TestErrorExpectedResponse(t *testing.T, router *mux.Router, operation, url, msg string, code int, ...) + func TestGetErrorExpectedResponse(t *testing.T, router *mux.Router, url, msg string, code int) + func TestHandlerFailsWithoutAuthenticatedUser(t *testing.T, handler func(w http.ResponseWriter, r *http.Request)) + func TestListBadRequests(t *testing.T, entity string, router *mux.Router) + func TestListFailsBadPage(t *testing.T, entity string, router *mux.Router, code int) + func TestListFailsPageTooBig(t *testing.T, entity string, router *mux.Router, code int) + func TestListValidResponse(t *testing.T, router *mux.Router, entity string, items []interface{}, ...) + func TestListValidResponseWithParams(t *testing.T, router *mux.Router, entity string, items []interface{}, ...) + func TestPostErrorExpectedResponse(t *testing.T, router *mux.Router, url, msg string, code int, data io.Reader) + func TestPutErrorExpectedResponse(t *testing.T, router *mux.Router, url, msg string, code int, data io.Reader) + func TestResponseBody(t *testing.T, w *httptest.ResponseRecorder, expected string) + func TestResponseForError(t *testing.T, w *httptest.ResponseRecorder, msg string, code int) + func TestResponseObject(t *testing.T, w *httptest.ResponseRecorder, expected interface{}, code int) + func UnauthorizedError(w http.ResponseWriter, err string) + func WriteJSON(w http.ResponseWriter, v interface{}, code int) + type ListResponse struct + Count uint + Page uint + func NewListResponse(count, page int, self, first, last, previous, next, embedName string, ...) *ListResponse + type Logger struct + func NewURLLogger() *Logger + func (l *Logger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) + type LookupStringIDResponse struct + CreatedAt string + ID string + Name string + UpdatedAt string + type LookupUintIDResponse struct + CreatedAt string + ID uint + Name string + UpdatedAt string