reviewing

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

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultReviews = []Review{
	{BeerID: 1, FirstName: "Joe", LastName: "Tribiani", Score: 5, Text: "This is good but this is not pizza!"},
	{BeerID: 2, FirstName: "Chandler", LastName: "Bing", Score: 1, Text: "I would SO NOT drink this ever again."},
	{BeerID: 1, FirstName: "Ross", LastName: "Geller", Score: 4, Text: "Drank while on a break, was pretty good!"},
	{BeerID: 2, FirstName: "Phoebe", LastName: "Buffay", Score: 2, Text: "Wasn't that great, so I gave it to my smelly cat."},
	{BeerID: 1, FirstName: "Monica", LastName: "Geller", Score: 5, Text: "AMAZING! Like Chandler's jokes!"},
	{BeerID: 2, FirstName: "Rachel", LastName: "Green", Score: 5, Text: "So yummy, just like my beef and custard trifle."},
}

Functions

This section is empty.

Types

type Event

type Event int

Event defines possible outcomes from the "adding actor"

const (
	// Done means finished processing successfully
	Done Event = iota

	// Failed means processing did not finish successfully
	Failed

	// We could also have a Queued Event which would mean queued for processing
	Queued
)

type Payload

type Payload []Review

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(Payload) <-chan Event
}

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