data

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package data bundles the race highlights TSV and the static circuit dataset into the binary via go:embed. No filesystem path search is performed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HighlightsMap

func HighlightsMap() (map[int]map[int]string, error)

HighlightsMap returns a year→round→URL map built from the bundled TSV.

func PreRaceContextMap

func PreRaceContextMap() (map[[2]int]string, error)

PreRaceContextMap returns a (year,round)→context_text map for pre-race blurbs.

Types

type HighlightEntry

type HighlightEntry struct {
	Year     int
	Round    int
	RaceName string
	Title    string
	URL      string
}

HighlightEntry is one row from the highlights TSV.

func LoadHighlights

func LoadHighlights() ([]HighlightEntry, error)

LoadHighlights parses the bundled TSV and returns all valid entries. Rows with missing URL, missing round, or non-ok status are skipped.

type TrackInfo

type TrackInfo struct {
	CircuitID       string
	FullName        string
	Locality        string
	Country         string
	LengthKm        float64
	Laps            int // typical race distance
	Turns           int
	DRSZones        int
	LapRecordTime   string // "M:SS.mmm"
	LapRecordDriver string
	LapRecordYear   int
	Character       string // 1-2 sentence track vibe
}

TrackInfo holds static metadata for one F1 circuit. LapRecord is the all-time fastest race lap ever set at this venue.

func GetTrackInfo

func GetTrackInfo(circuitID string) *TrackInfo

GetTrackInfo looks up a circuit by its Ergast circuit_id. Returns nil for unknown circuits.

Jump to

Keyboard shortcuts

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