Documentation ¶
Index ¶
- func ConfigureServer(handler *Handler) *mux.Router
- type Handler
- func (h *Handler) BookUpsert(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Index(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListBooks(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListMagazines(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListUserByID_Books(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListUserByID_Magazines(w http.ResponseWriter, r *http.Request)
- func (h *Handler) MagazineUpsert(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SwapBook(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SwapMagazine(w http.ResponseWriter, r *http.Request)
- func (h *Handler) UserUpsert(w http.ResponseWriter, r *http.Request)
- type Response
- type ResponseItemType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureServer ¶
ConfigureServer configures the routes of this server and binds handler functions to them
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler contains the handler and all its dependencies.
func NewHandler ¶
func NewHandler(bs *db.BookService, us *db.UserService, ms *db.MagazineService) *Handler
NewHandler initialises a new handler, given dependencies.
func (*Handler) BookUpsert ¶
func (h *Handler) BookUpsert(w http.ResponseWriter, r *http.Request)
BookUpsert is invoked by HTTP POST /books.
func (*Handler) Index ¶
func (h *Handler) Index(w http.ResponseWriter, r *http.Request)
Index is invoked by HTTP GET /.
func (*Handler) ListBooks ¶
func (h *Handler) ListBooks(w http.ResponseWriter, r *http.Request)
ListBooks is invoked by HTTP GET /books.
func (*Handler) ListMagazines ¶
func (h *Handler) ListMagazines(w http.ResponseWriter, r *http.Request)
ListMagazines is invoked by HTTP GET /magazines.
func (*Handler) ListUserByID_Books ¶
func (h *Handler) ListUserByID_Books(w http.ResponseWriter, r *http.Request)
ListUserByID_Books is invoked by HTTP GET /users/{id}/books.
func (*Handler) ListUserByID_Magazines ¶
func (h *Handler) ListUserByID_Magazines(w http.ResponseWriter, r *http.Request)
ListUserByID_Magazines is invoked by HTTP GET /users/{id}/magazines.
func (*Handler) MagazineUpsert ¶
func (h *Handler) MagazineUpsert(w http.ResponseWriter, r *http.Request)
MagazineUpsert is invoked by HTTP POST /magazines.
func (*Handler) SwapBook ¶
func (h *Handler) SwapBook(w http.ResponseWriter, r *http.Request)
SwapBook is invoked by POST /books/{id}
func (*Handler) SwapMagazine ¶
func (h *Handler) SwapMagazine(w http.ResponseWriter, r *http.Request)
SwapMagazine is invoked by POST /magazines/{id}
func (*Handler) UserUpsert ¶
func (h *Handler) UserUpsert(w http.ResponseWriter, r *http.Request)
UserUpsert is invoked by HTTP POST /users.