db

package
v0.0.0-...-11d9664 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMarkovOccurences

func AddMarkovOccurences(ctx context.Context, ms []*models.Markov) error

func AddPlayerToQueue

func AddPlayerToQueue(ctx context.Context, p *models.Player, role models.Role, entryTime int) error

func CreateMatch

func CreateMatch(ctx context.Context, m *models.Match) error

func CreatePlayer

func CreatePlayer(ctx context.Context, discordID string) error

func CreatePrediction

func CreatePrediction(ctx context.Context, discordID string, matchID string, team int, amount int) error

func DeleteAllMarkov

func DeleteAllMarkov() error

func GetForwardsCountInQueue

func GetForwardsCountInQueue(ctx context.Context) (int, error)

func GetGoaliesCountInQueue

func GetGoaliesCountInQueue(ctx context.Context) (int, error)

func GetMarkovOccurencesAndTotal

func GetMarkovOccurencesAndTotal(ctx context.Context, word1 string, word2 string) ([]*models.Markov, error)

func GetMatchByID

func GetMatchByID(ctx context.Context, matchID string) (*models.Match, error)

func GetMatchByThreadID

func GetMatchByThreadID(ctx context.Context, threadID string) (*models.Match, error)

func GetOrCreatePlayerById

func GetOrCreatePlayerById(ctx context.Context, discordID string) (*models.Player, error)

func GetPlayerById

func GetPlayerById(ctx context.Context, discordID string) (*models.Player, error)

func GetPlayerByUsername

func GetPlayerByUsername(ctx context.Context, username string) (*models.Player, error)

func GetPlayersInQueue

func GetPlayersInQueue(ctx context.Context) ([]*models.QueuedPlayer, error)

func GetPlayersOrderedByCredits

func GetPlayersOrderedByCredits(ctx context.Context) ([]*models.Player, error)

func GetPlayersPredictionOnMatch

func GetPlayersPredictionOnMatch(ctx context.Context, match *models.Match) ([]*models.Prediction, error)

func GetPredictionsTotalOnMatch

func GetPredictionsTotalOnMatch(ctx context.Context, matchID string) (int, int, error)

func GetRunningMatchesOrderedByTimestamp

func GetRunningMatchesOrderedByTimestamp(ctx context.Context) ([]*models.Match, error)

func GetStartingMarkovOccurences

func GetStartingMarkovOccurences(ctx context.Context) ([]*models.Markov, error)

func GetWaitingForVotesMatches

func GetWaitingForVotesMatches(ctx context.Context) ([]*models.Match, error)

func Init

func Init()

func IsPlayerInMatch

func IsPlayerInMatch(ctx context.Context, p *models.Player) (bool, error)

func IsPlayerInQueue

func IsPlayerInQueue(ctx context.Context, p *models.Player) (bool, error)

func RemovePlayerFromQueue

func RemovePlayerFromQueue(ctx context.Context, p *models.Player) error

func UpdateMatch

func UpdateMatch(ctx context.Context, m *models.Match) error

func UpdatePlayer

func UpdatePlayer(ctx context.Context, p *models.Player) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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