repo

package
v0.0.0-...-cba693c Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCurrentGameNotFound = errors.New("current game not found")
)
View Source
var ErrEmailUniqConstraint = errors.New("email already exists")

Functions

This section is empty.

Types

type AuthRepository

type AuthRepository struct {
	// contains filtered or unexported fields
}

func NewAuthRepository

func NewAuthRepository(pgDb *bun.DB) *AuthRepository

func (AuthRepository) Create

func (r AuthRepository) Create(user *entity.User) error

func (AuthRepository) FindBy

func (r AuthRepository) FindBy(email string) (*entity.User, error)

func (AuthRepository) FindById

func (r AuthRepository) FindById(id int64) (*entity.User, error)

type GameRepository

type GameRepository struct {
	// contains filtered or unexported fields
}

func NewGameRepository

func NewGameRepository(pgDb *bun.DB) *GameRepository

func (*GameRepository) AddGuessForCurrentGame

func (r *GameRepository) AddGuessForCurrentGame(currentUser *entity.User, word *entity.Word) (*entity.Game, error)

func (*GameRepository) CreateGame

func (r *GameRepository) CreateGame(word *entity.Word, currentUser *entity.User) (*entity.Game, error)

func (*GameRepository) FindCurrentGame

func (r *GameRepository) FindCurrentGame(currentUser *entity.User) (*entity.Game, error)

func (*GameRepository) FindRandomWord

func (r *GameRepository) FindRandomWord() (*entity.Word, error)

func (*GameRepository) FindWord

func (r *GameRepository) FindWord(word string) (*entity.Word, error)

func (*GameRepository) IsCurrentGameExists

func (r *GameRepository) IsCurrentGameExists(currentUser *entity.User) (bool, error)

func (*GameRepository) SaveWords

func (r *GameRepository) SaveWords(words []string) error

Jump to

Keyboard shortcuts

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