Documentation ¶
Index ¶
- func MakeGetBeerEndpoint(s Service) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func MakeGetBeerReviewsEndpoint(s Service) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func MakeGetBeersEndpoint(s Service) func(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type Handler
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeGetBeerEndpoint ¶
func MakeGetBeerEndpoint(s Service) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
MakeAddBeeEndpoint creates a handler for GET /beers/:id requests
func MakeGetBeerReviewsEndpoint ¶
func MakeGetBeerReviewsEndpoint(s Service) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
MakeGetBeerReviewsEndpoint creates a handler for GET /beers/:id/reviews requests
func MakeGetBeersEndpoint ¶
func MakeGetBeersEndpoint(s Service) func(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
MakeAddBeerEndpoint creates a handler for GET /beers requests
Types ¶
type Handler ¶
type Handler func(http.ResponseWriter, *http.Request, httprouter.Params)
type Service ¶
type Service interface { GetBeers() []beers.Beer GetBeer(int) (beers.Beer, error) GetBeerReviews(int) ([]reviews.Review, error) }
Service provides beer or review listing operations
func NewService ¶
func NewService(bR beers.Repository, rR reviews.Repository) Service
NewService creates an adding service with the necessary dependencies
Click to show internal directories.
Click to hide internal directories.