Documentation ¶
Index ¶
- type APIHandler
- func (a *APIHandler) HandleDeletePuppy(w http.ResponseWriter, r *http.Request)
- func (a *APIHandler) HandleGetPuppyByID(w http.ResponseWriter, r *http.Request)
- func (a *APIHandler) HandlePostPuppy(w http.ResponseWriter, r *http.Request)
- func (a *APIHandler) HandlePutPuppy(w http.ResponseWriter, r *http.Request)
- func (a *APIHandler) WireRoutes(r chi.Router)
- type ErrCode
- type Error
- type Puppy
- type Storer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
APIHandler implements REST API handlers of Puppy.
func NewAPIHandler ¶
func NewAPIHandler(storer Storer) *APIHandler
NewAPIHandler creates a APIHandler with given storer.
func (*APIHandler) HandleDeletePuppy ¶
func (a *APIHandler) HandleDeletePuppy(w http.ResponseWriter, r *http.Request)
HandleDeletePuppy deletes puppy in store by id.
func (*APIHandler) HandleGetPuppyByID ¶
func (a *APIHandler) HandleGetPuppyByID(w http.ResponseWriter, r *http.Request)
HandleGetPuppyByID retrieves puppy by id.
func (*APIHandler) HandlePostPuppy ¶
func (a *APIHandler) HandlePostPuppy(w http.ResponseWriter, r *http.Request)
HandlePostPuppy adds puppy into the store.
func (*APIHandler) HandlePutPuppy ¶
func (a *APIHandler) HandlePutPuppy(w http.ResponseWriter, r *http.Request)
HandlePutPuppy updates puppy in the store.
func (*APIHandler) WireRoutes ¶
func (a *APIHandler) WireRoutes(r chi.Router)
WireRoutes route requests to corresponding REST API handler method.
Click to show internal directories.
Click to hide internal directories.