Documentation
¶
Index ¶
- Constants
- func GetDb(connStr string) *sql.DB
- func GetTotalRowsCount(db *sql.DB) (int, error)
- func GetWinningNumbersFor(viewName string, db *sql.DB) (map[int]int, error)
- func ImportLatest(db *sql.DB) error
- func ImportPicks(db *sql.DB, csvFile string) error
- func RefreshViews(db *sql.DB) error
- func ScrapeLiveDraws(db *sql.DB) error
- type API
- type Draw
- type Draws
- type TableResponse
Constants ¶
View Source
const ( // LowPick is the lowest pick number available LowPick = 1 // HighPick is the highest pick number available HighPick = 80 )
Variables ¶
This section is empty.
Functions ¶
func GetTotalRowsCount ¶
GetTotalRowsCount gets the total number of records in the database for pagination purposes
func GetWinningNumbersFor ¶
GetWinningNumbersFor retrieves a view in the database relating to the past winning numbers based on the viewname
func ImportLatest ¶
ImportLatest imports the latest entries from the API
func ImportPicks ¶
ImportPicks imports picks from a CSV
func RefreshViews ¶
RefreshViews will refresh the materialized views
func ScrapeLiveDraws ¶
ScrapeLiveDraws scrapes the live website for new draw data and inserts it into db
Types ¶
type Draw ¶
type Draw struct { DrawDate time.Time `json:"draw_date"` DrawNumber int `json:"draw_number"` DrawTime string `json:"draw_time"` WinningNumbers []int64 `json:"winning_numbers"` Extra int `json:"extra_multiplier"` }
Draw represents a quickdraw entry
func (Draw) CheckAndInsert ¶
CheckAndInsert checks if a draw exists and if it doesn't, inserts it into the database
func (*Draw) UnmarshalJSON ¶
UnmarshalJSON unmarshals custom into Draw struct
func (Draw) WinningNumbersString ¶
WinningNumbersString converts the winning numbers array to a string value
Click to show internal directories.
Click to hide internal directories.