Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPlayerID error = errors.New(`player id not valid`) ErrInvalidPlayerName error = errors.New(`player name not valid`) ErrPlayerNotFound error = errors.New(`player not found`) ErrPlayerAlreadyExists error = errors.New(`username already exists`) ErrInvalidGameID error = errors.New(`game id invalid`) ErrGameNotFound error = errors.New(`game not found`) ErrGameInitialSave error = errors.New(`game must be saved with no actions`) ErrGameActionsOutOfOrder error = errors.New(`game actions out of order`) ErrGameActionDecode error = errors.New(`game actions get decode`) ErrGameActionWrongGame error = errors.New(`game action for wrong game`) ErrGameActionWrongPlayer error = errors.New(`game action found for wrong player`) ErrInteractionNotFound error = errors.New(`interaction not found`) ErrInteractionAlreadyExists error = errors.New(`interaction already exists`) ErrInteractionUnexpected error = errors.New(`unexpected interaction`) )
Functions ¶
Types ¶
type DB ¶
type DB interface { // Close should be called to end this thread's access to the DB Close() error // Start will start a transaction on the database Start() error // Commit will commit a transaction, if one exists Commit() error // Rollback will rollback the transaction of changes on the database Rollback() error ServicesWrapper }
type GameService ¶
type InteractionService ¶
type InteractionService interface { Get(id model.PlayerID) (interaction.PlayerMeans, error) Create(pm interaction.PlayerMeans) error Update(pm interaction.PlayerMeans) error }
type PlayerService ¶
type ServicesWrapper ¶
type ServicesWrapper interface { CreatePlayer(p model.Player) error GetPlayer(id model.PlayerID) (model.Player, error) AddPlayerColorToGame(id model.PlayerID, color model.PlayerColor, gID model.GameID) error CreateGame(g model.Game) error GetGame(id model.GameID) (model.Game, error) GetGameAction(id model.GameID, numActions uint) (model.Game, error) SaveGame(g model.Game) error GetInteraction(id model.PlayerID) (interaction.PlayerMeans, error) SaveInteraction(pm interaction.PlayerMeans) error }
func NewServicesWrapper ¶
func NewServicesWrapper(gs GameService, ps PlayerService, is InteractionService) ServicesWrapper
Source Files ¶
Click to show internal directories.
Click to hide internal directories.