Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicate = errors.New("beer already exists")
ErrDuplicate is used when a beer already exists.
Functions ¶
This section is empty.
Types ¶
type Beer ¶
type Beer struct { Name string `json:"name"` Brewery string `json:"brewery"` Abv float32 `json:"abv"` ShortDesc string `json:"short_description"` }
Beer defines the properties of a beer to be added
type Repository ¶
type Repository interface { // AddBeer saves a given beer to the repository. AddBeer(Beer) error // GetAllBeers returns all beers saved in storage. GetAllBeers() []listing.Beer }
Repository provides access to beer repository.
type Service ¶
Service provides beer adding operations.
func NewService ¶
func NewService(r Repository) Service
NewService creates an adding service with the necessary dependencies
Click to show internal directories.
Click to hide internal directories.