reviewing

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: 1 Imported by: 0

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 Repository

type Repository interface {
	// AddReview saves a given review.
	AddReview(Review) error
}

Repository provides access to the review storage.

type Review

type Review struct {
	BeerID    int    `json:"beer_id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Score     int    `json:"score"`
	Text      string `json:"text"`
}

Review defines a beer review

type Service

type Service interface {
	AddBeerReview(Review)
	AddSampleReviews([]Review)
}

Service provides reviewing operations.

func NewService

func NewService(r 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