Documentation ¶
Index ¶
- Constants
- Variables
- type Category
- type Clue
- type CluesParams
- type Game
- type JeppDB
- func (db *JeppDB) CountClues() (int64, error)
- func (db *JeppDB) GetCategories(limit int64) ([]Category, error)
- func (db *JeppDB) GetCategoriesForGame(gameID int64) ([]Category, error)
- func (db *JeppDB) GetCategory(categoryID int64) (*Category, error)
- func (db *JeppDB) GetCategoryByName(categoryName string) (*Category, error)
- func (db *JeppDB) GetCategoryClueCount(categoryID int64) (int64, error)
- func (db *JeppDB) GetCategoryGameCount(categoryID int64) (int64, error)
- func (db *JeppDB) GetClue(clueID int64) (*Clue, error)
- func (db *JeppDB) GetClues(params CluesParams) ([]Clue, error)
- func (db *JeppDB) GetGame(gameID int64) (*Game, error)
- func (db *JeppDB) GetGames(limit int64) ([]Game, error)
- func (db *JeppDB) GetGamesBySeason(seasonID int64) ([]Game, error)
- func (db *JeppDB) GetRandomCategory() (*Category, error)
- func (db *JeppDB) GetRandomCategoryMany(limit int64) ([]Category, error)
- func (db *JeppDB) GetRandomClue() (*Clue, error)
- func (db *JeppDB) GetRandomClueMany(limit int64) ([]Clue, error)
- func (db *JeppDB) GetRandomGame() (*Game, error)
- func (db *JeppDB) GetRandomGameMany(limit int64) ([]Game, error)
- func (db *JeppDB) GetSeasons() ([]Season, error)
- func (db *JeppDB) InsertCategory(name string) (*Category, error)
- func (db *JeppDB) InsertClue(c *Clue) error
- func (db *JeppDB) InsertGame(g *Game) error
- func (db *JeppDB) InsertSeason(s *Season) error
- func (db *JeppDB) UpdateCategory(c *Category) error
- func (db *JeppDB) UpdateClue(c *Clue) error
- type Round
- type Season
Constants ¶
const TIME_FORMAT = "Monday, January 2, 2006"
TIME_FORMAT is the format used for friendly date strings. This is the format used by j-archive.
Variables ¶
var RoundMap = map[string]int{ "J": int(Jeopardy), "DJ": int(DoubleJeopardy), "FJ": int(FinalJeopardy), "TB": int(FinalJeopardy), }
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { CategoryID int64 `db:"category_id" json:"categoryId" example:"765"` Name string `db:"name" json:"name" example:"State Capitals"` }
Category represents a jeopardy category in the database.
type Clue ¶
type Clue struct { ClueID int64 `db:"clue_id" json:"clueId" example:"804002032"` GameID int64 `db:"game_id" json:"gameId" example:"8040"` CategoryID int64 `db:"category_id" json:"categoryId" example:"3462"` Question string `db:"question" json:"question" example:"This is the question."` Answer string `db:"answer" json:"answer" example:"This is the answer."` }
Clue represents a jeopardy clue in the database.
type Game ¶
type Game struct { GameID int64 `db:"game_id" json:"gameId" example:"8040"` SeasonID int64 `db:"season_id" json:"seasonId" example:"38"` ShowNum int64 `db:"show_num" json:"showNum" example:"4532"` GameDate time.Time `db:"game_date" json:"gameDate" example:"2019-01-01"` TapedDate time.Time `db:"taped_date" json:"tapedDate" example:"2019-01-01"` }
Game represents a single game of Jeopardy.
type JeppDB ¶
func (*JeppDB) CountClues ¶ added in v0.1.0
CountClues returns the number of clues in the database.
func (*JeppDB) GetCategories ¶ added in v0.1.0
GetCategories returns all categories in the database.
func (*JeppDB) GetCategoriesForGame ¶ added in v0.1.0
GetCategoriesForGame returns all categories for a given game.
func (*JeppDB) GetCategory ¶ added in v0.1.0
GetCategory returns the category with the given ID.
func (*JeppDB) GetCategoryByName ¶ added in v0.1.0
func (*JeppDB) GetCategoryClueCount ¶ added in v0.1.0
GetCategoryClueCount returns the number of clues a category has appeared in.
func (*JeppDB) GetCategoryGameCount ¶ added in v0.1.0
GetCategoryGameCount returns the number of games a category has appeared in.
func (*JeppDB) GetClues ¶ added in v0.1.0
func (db *JeppDB) GetClues(params CluesParams) ([]Clue, error)
ListClues returns a list of clues in the database, defaults to returning values ordered by game id descending.
func (*JeppDB) GetGames ¶ added in v0.1.0
GetGames returns a list of games in the database, defaults to returning values ordered by game date, with most recent first, limited to 100 results.
TODO: have this take a "lastClueID" arg or something for dumb pagination.
func (*JeppDB) GetGamesBySeason ¶ added in v0.1.0
GetGamesBySeason returns a list of games in the database for a given season.
func (*JeppDB) GetRandomCategory ¶ added in v0.1.0
GetRandomCategory returns a single category from the database.
func (*JeppDB) GetRandomCategoryMany ¶ added in v0.1.0
GetRandomCategoryMany returns `limit` random categories from the database.
func (*JeppDB) GetRandomClue ¶ added in v0.1.0
GetClue returns a single clue from the database.
func (*JeppDB) GetRandomClueMany ¶ added in v0.1.0
GetRandomClueMany returns `limit` random clues from the database.
func (*JeppDB) GetRandomGame ¶ added in v0.1.0
GetRandomGame returns a single game from the database.
func (*JeppDB) GetRandomGameMany ¶ added in v0.1.0
GetRandomGameMany returns `limit` random games from the database.
func (*JeppDB) GetSeasons ¶ added in v0.1.0
GetSeasons returns a list of seasons in the database, defaults to returning values ordered by season id, with most recent first.
func (*JeppDB) InsertCategory ¶ added in v0.1.0
InsertCategory inserts a category into the database.
func (*JeppDB) InsertClue ¶ added in v0.1.0
InsertClue inserts a clue into the database.
func (*JeppDB) InsertGame ¶ added in v0.1.0
InsertGame inserts a game into the database.
func (*JeppDB) InsertSeason ¶ added in v0.1.0
InsertSeason inserts a season into the database.
func (*JeppDB) UpdateCategory ¶ added in v0.1.0
UpdateCategory updates a category in the database.
func (*JeppDB) UpdateClue ¶ added in v0.1.0
UpdateClue updates a category in the database.
type Round ¶
type Round int // 0 = Jeopardy, 1 = Double Jeopardy, 2 = Final Jeopardy
TODO: this is silly, should fix it