Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CollectionBeer identifier for the JSON collection of beers CollectionBeer = "beers" // CollectionReview identifier for the JSON collection of reviews CollectionReview = "reviews" )
Variables ¶
This section is empty.
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 storage form of a beer
type Review ¶
type Review struct { ID string `json:"id"` BeerID int `json:"beer_id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Score int `json:"score"` Text string `json:"text"` Created time.Time `json:"created"` }
Review defines the storage form of a beer review
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage stores beer data in JSON files
func (*Storage) GetAllBeers ¶
GetAll returns all beers
func (*Storage) GetAllReviews ¶
GetAll returns all reviews for a given beer
Click to show internal directories.
Click to hide internal directories.