repository

package
v0.0.0-...-d73c5c4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cards

type Cards interface {
	AddCardToDealer(ctx context.Context, telegramChatID int64, card core.Card) error
	AddCardToPlayer(ctx context.Context, telegramChatID int64, username string, card core.Card) error
	DrawCardFromDeck(ctx context.Context, telegramChatID int64) (core.Card, error)
	SetNewDeck(ctx context.Context, telegramChatID int64, deck *core.Deck) error
}

type Chats

type Chats interface {
	CheckChatExists(ctx context.Context, telegramChatID int64) error
	RegisterChat(ctx context.Context, telegramChatID int64) error
}

type Games

type Games interface {
	GetActiveGame(ctx context.Context, telegramChatID int64) (*core.Game, error)
	NullActiveGame(ctx context.Context, telegramChatID int64) error
	SetActiveGame(ctx context.Context, telegramChatID int64, game core.Game) error
}

type Players

type Players interface {
	AddNewPlayer(ctx context.Context, telegramChatID int64, player core.Player) error
	GetPlayer(ctx context.Context, telegramChatID int64, username string) (*core.Player, error)
	SetPlayerStopAndBusted(ctx context.Context, telegramChatID int64, player *core.Player) error
}

type Repository

type Repository struct {
	Cards
	Chats
	Games
	Players
	Statistic
}

func NewRepository

func NewRepository(db *mongo.Client) *Repository

type Statistic

type Statistic interface {
	GetStatistics(ctx context.Context, telegramChatID int64) (core.UsersStatistics, error)
	SetStatistics(ctx context.Context, telegramChatID int64, stats core.UsersStatistics) error
}

Directories

Path Synopsis
Package mock_repository is a generated GoMock package.
Package mock_repository is a generated GoMock package.

Jump to

Keyboard shortcuts

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