ergast

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Circuit

type Circuit struct {
	Name     string
	Location GeoCoordinate
	Country  string
	Locality string
}

Circuit contains information about an F1 Circuit.

type Constructor added in v0.2.0

type Constructor struct {
	Id          string `json:"constructorId"`
	Url         string `json:"url"`
	Name        string `json:"name"`
	Nationality string `json:"nationality"`
}

Constructor has constructor information from a driver standings JSON response.

type ConstructorStanding added in v0.3.0

type ConstructorStanding struct {
	Position        string      `json:"position"`
	Points          string      `json:"points"`
	Wins            string      `json:"wins"`
	ConstructorInfo Constructor `json:"Constructor"`
}

ConstructorStanding contains the JSON response structure from a Get request to the constructor standings URI.

func ConstructorStandings added in v0.3.0

func ConstructorStandings() ([]ConstructorStanding, error)

ConstructorStandings will return the current constructor standings for the current season.

type Driver added in v0.2.0

type Driver struct {
	Id          string `json:"driverId"`
	Url         string `json:"url"`
	Code        string `json:"code"`
	FirstName   string `json:"givenName"`
	LastName    string `json:"familyName"`
	DateOfBirth string `json:"dateOfBirth"`
	Nationality string `json:"nationality"`
}

Driver contains driver information from the race schedule JSON response.

type DriverStanding added in v0.2.0

type DriverStanding struct {
	Position     string        `json:"position"`
	Points       string        `json:"points"`
	Wins         string        `json:"wins"`
	DriverInfo   Driver        `json:"Driver"`
	Constructors []Constructor `json:"Constructors"`
}

DriverStanding contains the JSON response structure from a Get request to the driver standings URI.

func DriverStandings added in v0.2.0

func DriverStandings() ([]DriverStanding, error)

DriverStandings will return the current driver standings for the current season.

type GeoCoordinate

type GeoCoordinate struct {
	Latitude  float64
	Longitude float64
}

GeoCoordinate describes the location where the circuit is.

type Race

type Race struct {
	RoundNumber         int
	Name                string
	CircuitInfo         Circuit
	FirstPracticeStart  time.Time
	SprintRaceStart     time.Time
	SecondPracticeStart time.Time
	ThirdPracticeStart  time.Time
	QualifyingStart     time.Time
	RaceStart           time.Time
}

Race has all pertinent infromation about an F1 Race.

func NextRace

func NextRace() (*Race, error)

func RaceSchedule

func RaceSchedule() ([]Race, error)

RaceSchedule will return the race schedule for the current year.

Jump to

Keyboard shortcuts

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