Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupRoutes ¶
func SetupRoutes(r chi.Router, rh RestHandler)
SetupRoutes provides the routes for this REST API.
Types ¶
type MapStore ¶
type MapStore struct {
// contains filtered or unexported fields
}
func (*MapStore) CreatePuppy ¶
CreatePuppy create a new puppy and store in mapStore.
func (MapStore) DeletePuppy ¶
DeletePuppy delete the puppy given the id.
type RestHandler ¶
type RestHandler struct {
// contains filtered or unexported fields
}
RestHandler provides a puppy storer to store the puppies
func NewRestHandler ¶
func NewRestHandler(storer Storer) *RestHandler
NewRestHandler is a factory method that makes new storer
func (*RestHandler) HandleDelete ¶
func (rh *RestHandler) HandleDelete(w http.ResponseWriter, r *http.Request)
HandleDelete deletes the puppy with by id and display the results.
func (*RestHandler) HandleGet ¶
func (rh *RestHandler) HandleGet(w http.ResponseWriter, r *http.Request)
HandleGet gets the puppy by id and displays the results.
func (*RestHandler) HandlePost ¶
func (rh *RestHandler) HandlePost(w http.ResponseWriter, r *http.Request)
HandlePost post a new puppy and then display the results.
func (*RestHandler) HandlePut ¶
func (rh *RestHandler) HandlePut(w http.ResponseWriter, r *http.Request)
HandlePut updates the existing puppy with new fields in the payload.
type SyncStore ¶
type SyncStore struct {
// contains filtered or unexported fields
}
func (*SyncStore) CreatePuppy ¶
CreatePuppy create a new puppy and store in mapStore.
func (*SyncStore) DeletePuppy ¶
DeletePuppy delete the puppy given the id.
Click to show internal directories.
Click to hide internal directories.