Version: v0.0.0-...-bc4fcfc Latest Latest

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 7 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Beer

type Beer struct {
	ID        string
	Name      string
	Brewery   string
	Abv       float32
	ShortDesc string
	Created   time.Time

Beer defines the storage form of a beer

type Review

type Review struct {
	ID        string
	BeerID    string
	FirstName string
	LastName  string
	Score     int
	Text      string
	Created   time.Time

Review defines the storage form of a beer review

type Storage

type Storage struct {
	// contains filtered or unexported fields

Memory storage keeps data in memory

func (*Storage) AddBeer

func (m *Storage) AddBeer(b adding.Beer) error

Add saves the given beer to the repository

func (*Storage) AddReview

func (m *Storage) AddReview(r reviewing.Review) error

Add saves the given review in the repository

func (*Storage) GetAllBeers

func (m *Storage) GetAllBeers() []listing.Beer

GetAll return all beers

func (*Storage) GetAllReviews

func (m *Storage) GetAllReviews(beerID string) []listing.Review

GetAllReviews returns all reviews for a given beer

func (*Storage) GetBeer

func (m *Storage) GetBeer(id string) (listing.Beer, error)

Get returns a beer with the specified ID

Jump to

Keyboard shortcuts

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