Documentation ¶
Overview ¶
Package events is responsible for notifying clients
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PublishError ¶
func PublishError(subscribers []Subscriber, message string)
PublishError publishes the Error event
func PublishGameFinished ¶
func PublishGameFinished(gameFinished GameFinished)
PublishGameFinished publishes the GameFinished event
func PublishRoundFinished ¶
func PublishRoundFinished(roundFinished RoundFinished)
PublishRoundFinished publishes the RoundFinished event
func PublishStartGame ¶
func PublishStartGame(startGame StartGame)
PublishStartGame publishes the StartGame event
Types ¶
type GameFinished ¶
type GameFinished struct { GameID uuid.UUID PlayerResults []PlayerResult Winner string }
GameFinished is an intermediate structure for the GameFinished event
type PlayerResult ¶
type PlayerResult struct { Status string Score string Subscriber Subscriber }
PlayerResult holds the data specific to a player in the context of a RoundFinished or GameFinished event
type RoundFinished ¶
type RoundFinished struct { GameID uuid.UUID CurrentRound int NextRound int PlayerResults []PlayerResult Winner string Moves map[string]interface{} }
RoundFinished is an intermediate structure for the RoundFinished event
Click to show internal directories.
Click to hide internal directories.