Documentation ¶
Index ¶
- func ReportLostPuppy(puppyID uint64, lostSvcURL string)
- 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 LostAPIHandler
- type LostPuppyRequest
- type Puppy
- type Storer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReportLostPuppy ¶
ReportLostPuppy sends an async http request to lost puppy service
Types ¶
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
APIHandler implements REST API handlers of Puppy.
func NewAPIHandler ¶
func NewAPIHandler(storer Storer, lostSvcURL string) *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.
type LostAPIHandler ¶
type LostAPIHandler struct{}
LostAPIHandler implements REST API handler of lost service.
func NewLostAPIHandler ¶
func NewLostAPIHandler() *LostAPIHandler
NewLostAPIHandler creates a LostAPIHandler.
func (*LostAPIHandler) HandlePostLostPuppy ¶
func (a *LostAPIHandler) HandlePostLostPuppy(w http.ResponseWriter, r *http.Request)
HandlePostLostPuppy handles http request to lost puppy service.
func (*LostAPIHandler) WireRoutes ¶
func (a *LostAPIHandler) WireRoutes(r chi.Router)
WireRoutes route requests to corresponding REST API handler method.
type LostPuppyRequest ¶
type LostPuppyRequest struct {
ID uint64 `json:"id"`
}