Documentation ¶
Index ¶
- Constants
- type Database
- func (db *Database) Close() error
- func (db *Database) CreateGame(blackUserID, whiteUserID int64) (gameID int64, err error)
- func (db *Database) CreateMove(gameID, userID int64, x, y int) error
- func (db *Database) CreateUser(username, email, passwordBcrypt string) (*model.User, error)
- func (db *Database) CreateUserOauth(username string, email *string, oauthID string, service oauth.Service) (*model.User, error)
- func (db *Database) DeclineGameInvitation(userID int64, gameID int64) error
- func (db *Database) DeleteGame(gameID int64) error
- func (db *Database) FindUsers(username string) ([]*model.User, error)
- func (db *Database) FinishGameWithWinner(gameID, winnerID int64) error
- func (db *Database) GameHistory(username string) ([]model.GameHistoryItem, error)
- func (db *Database) GetGameByID(gameID int64) (*model.Game, error)
- func (db *Database) GetGameMovesByID(gameID int64) ([]model.Move, error)
- func (db *Database) GetPlayingGame(userID int64) (*model.PlayingGame, error)
- func (db *Database) GetUserByID(userID int64) (*model.User, error)
- func (db *Database) GetUserByLogin(login string) (*model.User, error)
- func (db *Database) IsGameMember(userID, gameID int64) (bool, error)
- func (db *Database) IsPlaying(userID int64) (bool, error)
- func (db *Database) ReadConfig() (*config.Config, error)
- func (db *Database) StartGame(gameID int64) error
- func (db *Database) Top10() ([]*model.User, error)
Constants ¶
View Source
const DefaultQueryTimeout = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) CreateGame ¶
func (*Database) CreateUser ¶
func (*Database) CreateUserOauth ¶
func (*Database) DeclineGameInvitation ¶
func (*Database) DeleteGame ¶
func (*Database) FinishGameWithWinner ¶
func (*Database) GameHistory ¶
func (db *Database) GameHistory(username string) ([]model.GameHistoryItem, error)
func (*Database) GetGameMovesByID ¶
func (*Database) GetPlayingGame ¶
func (db *Database) GetPlayingGame(userID int64) (*model.PlayingGame, error)
func (*Database) GetUserByLogin ¶
func (*Database) IsGameMember ¶
Click to show internal directories.
Click to hide internal directories.