game

package
v0.0.0-...-7d85d8e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidID = errors.New("game: invalid ID")
)

errors for package game

Functions

This section is empty.

Types

type Game

type Game struct {
	ID      ID
	Tickets []ticket.ID
	Numbers []int64
}

Game is the central class in the domain model.

func New

func New(id ID, tickets []ticket.ID, numbers []int64) *Game

New creates a new game.

type ID

type ID string

ID uniquely identifies a particular game.

type Repository

type Repository interface {
	Insert(context.Context, Game) (ID, error)
	Find(context.Context, ID) (Game, error)
	AddTicket(context.Context, ID, ticket.ID) error
	AddNumber(context.Context, ID, int64) error
}

Repository provides access a game store.

Jump to

Keyboard shortcuts

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