Documentation ¶
Index ¶
- type Config
- type MarsClient
- type Service
- func (s *Service) CreateGame(ctx context.Context, users []*storage.User, settings mars.GameSettings) error
- func (s *Service) GetUserGames(inctx context.Context, userId string) ([]*UserGame, error)
- func (s *Service) NotifyGameFinished(ctx context.Context, gameId string) error
- func (s *Service) ProcessElo(ctx context.Context) error
- func (s *Service) ProcessFinishedGames(ctx context.Context) error
- type Storage
- type UserGame
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarsClient ¶
type MarsClient interface { CreateGame(ctx context.Context, game mars.CreateGameRequest) (mars.CreateGameResponse, error) GetGame(ctx context.Context, req mars.GetGameRequest) (mars.GetGameResponse, error) GetPlayerUrl(playerId string) string WaitingFor(ctx context.Context, req mars.WaitingForRequest) (mars.WaitingForResponse, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(cfg Config, storage Storage, mars MarsClient) *Service
func (*Service) CreateGame ¶
func (*Service) GetUserGames ¶
func (*Service) NotifyGameFinished ¶ added in v0.3.21
func (*Service) ProcessElo ¶ added in v0.3.16
type Storage ¶
type Storage interface { CreateGame(ctx context.Context, game *storage.Game) error GetActiveGames(ctx context.Context) ([]*storage.Game, error) GetGamesByUserId(ctx context.Context, userId string, finishedWindow time.Duration) ([]*storage.Game, error) UpdateElo(ctx context.Context, updater storage.EloUpdater) error UpdateGameResults(ctx context.Context, gameId string, results *storage.GameResults) error }
Click to show internal directories.
Click to hide internal directories.