Documentation
¶
Index ¶
- func CalculateScore(time int, errors int, text string) (int, int)
- func CloseGameSession(sessionId string)
- func CreateSession(online bool, language string) (entities.GameSession, error)
- func DeleteOldSessionsForUser(userId string)
- func FindOpenSession(online bool, language string) (entities.GameSession, bool)
- func GetPlayback(id string) (map[string]interface{}, bool)
- func GetResultData(id string) (entities.GameResult, bool)
- func GetSession(sessionId string) (entities.GameSession, error)
- func MarkSessionFinished(sessionId string)
- func OpenGameSession(sessionId string)
- func SaveGuestResult(identifier string, sessionId string, mistakes map[string]int, wpm int, ...) (map[string]interface{}, bool)
- func SavePlayback(id string, playback []map[string]interface{})
- func SaveResult(user *entities.User, sessionId string, mistakes map[string]int, wpm int, ...) (entities.GameResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseGameSession ¶
func CloseGameSession(sessionId string)
func CreateSession ¶
func CreateSession(online bool, language string) (entities.GameSession, error)
func DeleteOldSessionsForUser ¶
func DeleteOldSessionsForUser(userId string)
func FindOpenSession ¶
func FindOpenSession(online bool, language string) (entities.GameSession, bool)
Fetches the open session from database if exists
func GetPlayback ¶
func GetResultData ¶
func GetResultData(id string) (entities.GameResult, bool)
func GetSession ¶
func GetSession(sessionId string) (entities.GameSession, error)
func MarkSessionFinished ¶
func MarkSessionFinished(sessionId string)
func OpenGameSession ¶
func OpenGameSession(sessionId string)
func SaveGuestResult ¶
func SaveGuestResult(identifier string, sessionId string, mistakes map[string]int, wpm int, accuracy int, gameTime int, place int, ip string, country string) (map[string]interface{}, bool)
Saves guest game results to the database. It'll be only used for internal purposes, such as stats
func SavePlayback ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.