Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("beer not found")
ErrNotFound is used when a beer could not be found.
Functions ¶
This section is empty.
Types ¶
type Beer ¶
type Beer struct { ID int `json:"id"` Name string `json:"name"` Brewery string `json:"brewery"` Abv float32 `json:"abv"` ShortDesc string `json:"short_description"` Created time.Time `json:"created"` }
Beer defines the properties of a beer to be listed
type Repository ¶
type Repository interface { // GetBeer returns the beer with given ID. GetBeer(int) (Beer, error) // GetAllBeers returns all beers saved in storage. GetAllBeers() []Beer // GetAllReviews returns a list of all reviews for a given beer ID. GetAllReviews(int) []Review }
Repository provides access to the beer and review storage.
Click to show internal directories.
Click to hide internal directories.