listing

package
v0.0.0-...-63f3735 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL