scoreboards

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToScoreByName

func AddToScoreByName(username, scoreboardName string, scoreToAdd float32) error

AddToScoreByName increases the score value for a given username and scoreboard name TODO: this could be achieved with less queries

func CurrentGuessScoreboard

func CurrentGuessScoreboard() string

func CurrentMilesScoreboard

func CurrentMilesScoreboard() string

func GetScoreByName

func GetScoreByName(username, scoreboardName string) (float32, error)

GetScoreByName returns the score value for a given username and scoreboard name TODO: this could be achieved with a single query

func TopUsers

func TopUsers(scoreboardName string, size int) [][]string

Types

type Score

type Score struct {
	ID           uint16    `db:"id"`
	UserID       uint16    `db:"user_id"`
	ScoreboardID uint16    `db:"scoreboard_id"`
	Value        float32   `db:"value"`
	DateCreated  time.Time `db:"date_created"`
}

Score represents a user's score on a scoreboard

type Scoreboard

type Scoreboard struct {
	ID          uint16    `db:"id"`
	Name        string    `db:"name"`
	DateCreated time.Time `db:"date_created"`
}

Scoreboard represents a bucket of scores, and has a name to identify it

Jump to

Keyboard shortcuts

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