analysis

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectEventIdsForDrivers

func CollectEventIdsForDrivers(pool *pgxpool.Pool, driverNames []string) (map[string][]int, error)

func CollectEventIdsForTeams

func CollectEventIdsForTeams(pool *pgxpool.Pool, teamNames []string) (map[string][]int, error)

func SearchDriversInTeams

func SearchDriversInTeams(pool *pgxpool.Pool, teams []string) (map[string][]DbDriverSummary, error)

teams contains the exact team names for which the drivers should be collected.

func SearchTeamsForDrivers

func SearchTeamsForDrivers(pool *pgxpool.Pool, drivers []string) (map[string][]DbTeamSummary, error)

teams contains the exact team names for which the drivers should be collected.

Types

type CarInfo

type CarInfo struct {
	Name     string `json:"name"`
	CarNum   string `json:"carNum"`
	CarClass string `json:"carClass"`
	Drivers  []struct {
		SeatTime []struct {
			EnterCarTime float64 // unit: sessionTime
			LeaveCarTime float64 // unit: sessionTime
		}
		DriverName string `json:"driverName"`
	}
}

type DbAnalysis

type DbAnalysis struct {
	ID      int `json:"id"`
	EventId int `json:"eventId"`
	// TODO: Cars
	CarInfo []CarInfo
	CarLaps []struct {
		CarNum string
		Laps   []struct {
			LapNo   int
			LapTime float64
		}
	}
	RaceOrder []string // last computed race order (contain carNums)
}

func GetAnalysisForEvent

func GetAnalysisForEvent(pool *pgxpool.Pool, eventId int) (*DbAnalysis, error)

func GetAnalysisForEvents

func GetAnalysisForEvents(pool *pgxpool.Pool, eventIds []int) ([]DbAnalysis, error)

type DbDriverSummary

type DbDriverSummary struct {
	Name     string   `json:"name"`
	CarNum   []string `json:"carNum"`
	CarClass []string `json:"carClass"`
	Teams    []string `json:"drivers"`
	EventIds []int    `json:"eventId"`
}

func SearchDrivers

func SearchDrivers(pool *pgxpool.Pool, arg string) ([]DbDriverSummary, error)

type DbTeamInEvent

type DbTeamInEvent struct {
	Name     string `json:"name"`
	CarNum   string `json:"carNum"`
	CarClass string `json:"carClass"`
	Drivers  []struct {
		DriverName string `json:"driverName"`
	}
}

type DbTeamSummary

type DbTeamSummary struct {
	Name     string   `json:"name"`
	CarNum   []string `json:"carNum"`
	CarClass []string `json:"carClass"`
	Drivers  []string `json:"drivers"`
	EventIds []int    `json:"eventId"`
}

func SearchTeams

func SearchTeams(pool *pgxpool.Pool, arg string) ([]DbTeamSummary, error)

Jump to

Keyboard shortcuts

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