Documentation ¶
Index ¶
- type CardService
- type Cards
- type ChatService
- type Chats
- type Deps
- type GameService
- func (g *GameService) CheckIfGameShouldBeFinished(ctx context.Context, telegramChatID int64) (bool, error)
- func (g *GameService) FinishGame(ctx context.Context, telegramChatID int64) (*core.Game, core.UsersStatistics, error)
- func (g *GameService) NewGame(ctx context.Context, telegramChatID int64) (*core.Game, error)
- type Games
- type Logger
- type PlayerService
- func (p *PlayerService) AddNewPlayer(ctx context.Context, telegramChatID int64, player core.Player) error
- func (p *PlayerService) GetPlayer(ctx context.Context, telegramChatID int64, username string) (*core.Player, error)
- func (p *PlayerService) StopDrawing(ctx context.Context, telegramChatID int64, player *core.Player) error
- type Players
- type Services
- type StatisticService
- type Statistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CardService ¶
type CardService struct {
// contains filtered or unexported fields
}
func NewCardService ¶
func NewCardService(logger Logger, repo repository.Cards, playerService Players, numOfDecks int) *CardService
func (*CardService) DrawCardFromDeckToDealer ¶
func (*CardService) DrawCardFromDeckToPlayer ¶
type ChatService ¶
type ChatService struct {
// contains filtered or unexported fields
}
func NewChatService ¶
func NewChatService(logger Logger, repo repository.Chats) *ChatService
func (*ChatService) CheckChatExists ¶
func (c *ChatService) CheckChatExists(ctx context.Context, telegramChatID int64) error
func (*ChatService) RegisterChat ¶
func (c *ChatService) RegisterChat(ctx context.Context, telegramChatID int64) error
type Deps ¶
type Deps struct { Config *config.Config Repository *repository.Repository Logger }
type GameService ¶
type GameService struct {
// contains filtered or unexported fields
}
func NewGameService ¶
func NewGameService( logger Logger, repo repository.Games, statisticService Statistics, cardService Cards, ) *GameService
func (*GameService) CheckIfGameShouldBeFinished ¶
func (*GameService) FinishGame ¶
func (g *GameService) FinishGame( ctx context.Context, telegramChatID int64, ) (*core.Game, core.UsersStatistics, error)
type PlayerService ¶
type PlayerService struct {
// contains filtered or unexported fields
}
func NewPlayerService ¶
func NewPlayerService(logger Logger, repo repository.Players) *PlayerService
func (*PlayerService) AddNewPlayer ¶
func (*PlayerService) StopDrawing ¶
type StatisticService ¶
type StatisticService struct {
// contains filtered or unexported fields
}
func NewStatisticService ¶
func NewStatisticService(logger Logger, repo repository.Statistic) *StatisticService
func (*StatisticService) GetStatistics ¶
func (s *StatisticService) GetStatistics( ctx context.Context, telegramChatID int64, ) (core.UsersStatistics, error)
func (*StatisticService) IncrementStatistic ¶
func (s *StatisticService) IncrementStatistic( ctx context.Context, telegramChatID int64, gameResult core.UsersStatistics, ) error
type Statistics ¶
Click to show internal directories.
Click to hide internal directories.