model

package
v0.7.0-PRE1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisCarInfo

type AnalysisCarInfo 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 AnalysisData

type AnalysisData map[string]interface{}

type AvgLapOverTime

type AvgLapOverTime struct {
	Timestamp   float64            `json:"timestamp"`
	SessionTime float64            `json:"sessionTime"`
	TimeOfDay   float64            `json:"timeOfDay"`
	TrackTemp   float64            `json:"trackTemp"`
	Laptimes    map[string]float64 `json:"laptimes"`
}

type Car

type Car struct {
	CarID        int    `json:"carId"`
	CarIdx       int    `json:"carIdx"`
	CarClassID   int    `json:"carClassId"`
	Name         string `json:"name"`
	CarNumber    string `json:"carNumber"`
	CarNumberRaw int    `json:"carNumberRaw"`
}

type CarClass

type CarClass struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type CarData

type CarData struct {
	Type      int        `json:"type"`
	Payload   CarPayload `json:"payload"`
	Timestamp float64    `json:"timestamp"`
}

type CarEntry

type CarEntry struct {
	Car     Car      `json:"car"`
	Team    Team     `json:"team"`
	Drivers []Driver `json:"drivers"`
}

type CarInfo

type CarInfo struct {
	Name          string  `json:"name"`
	NameShort     string  `json:"nameShort"`
	CarID         int     `json:"carId"`
	CarClassID    int     `json:"carClassId"`
	CarClassName  string  `json:"carClassName"`
	FuelPct       float64 `json:"fuelPct"`
	PowerAdjust   float64 `json:"powerAdjust"`
	WeightPenalty float64 `json:"weightPenalty"`
	DryTireSets   int     `json:"dryTireSets"`
}

type CarPayload

type CarPayload struct {
	Cars       []CarInfo  `json:"cars"`
	CarClasses []CarClass `json:"carClasses"`
	Entries    []CarEntry `json:"entries"`
}

type ClassSpeedmapData

type ClassSpeedmapData struct {
	Laptime     float64   `json:"laptime"`
	ChunkSpeeds []float64 `json:"chunkSpeeds"`
}

type DbAnalysis

type DbAnalysis struct {
	ID      int          `json:"id"`
	EventID int          `json:"eventId"`
	Data    AnalysisData `json:"data"`
}

type DbCar

type DbCar struct {
	ID      int     `json:"id"`
	EventID int     `json:"eventId"`
	Data    CarData `json:"data"`
}

type DbEvent

type DbEvent struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Key         string    `json:"eventKey"`
	Description string    `json:"description"`
	RecordStamp time.Time `json:"recordDate"`
	Data        EventData `json:"data"`
}

type DbEventExtra

type DbEventExtra struct {
	ID      int       `json:"id"`
	EventID int       `json:"eventId"`
	Data    ExtraInfo `json:"data"`
}

type DbSpeedmap

type DbSpeedmap struct {
	ID      int          `json:"id"`
	EventID int          `json:"eventId"`
	Data    SpeedmapData `json:"data"`
}

type DbState

type DbState struct {
	ID      int       `json:"id"`
	EventID int       `json:"eventId"`
	Data    StateData `json:"data"`
}

describes state of the race according to event manifests

type DbTeamInEvent

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

type DbTrack

type DbTrack struct {
	ID   int       `json:"id"`
	Data TrackInfo `json:"data"`
}

type DeltaPayload

type DeltaPayload struct {
	Cars    [][3]interface{} `json:"cars"`
	Session [][2]interface{} `json:"session"`
}

type Driver

type Driver struct {
	ID          int    `json:"id"`
	CarIdx      int    `json:"carIdx"`
	Name        string `json:"name"`
	IRating     int    `json:"iRating"`
	Initials    string `json:"initials"`
	LicLevel    int    `json:"licLevel"`
	LicSubLevel int    `json:"licSubLevel"`
	LicString   string `json:"licString"`
	AbbrevName  string `json:"abbrevName"`
}

type EventData

type EventData struct {
	Info       EventDataInfo `json:"info"`
	Manifests  Manifests     `json:"manifests"`
	ReplayInfo ReplayInfo    `json:"replayInfo"`
}

type EventDataInfo

type EventDataInfo struct {
	TrackId               int      `json:"trackId"`
	TrackDisplayName      string   `json:"trackDisplayName"`
	TrackDisplayShortName string   `json:"trackDisplayShortName"`
	TrackConfigName       string   `json:"trackConfigName"`
	TrackLength           float64  `json:"trackLength"`
	TrackPitSpeed         float64  `json:"trackPitSpeed"`
	Name                  string   `json:"name"`
	Description           string   `json:"description"`
	EventTime             string   `json:"eventTime"`
	RaceloggerVersion     string   `json:"raceloggerVersion"`
	TeamRacing            int      `json:"teamRacing"` // 0: false
	MultiClass            bool     `json:"multiClass"`
	NumCarTypes           int      `json:"numCarTypes"`
	NumCarClasses         int      `json:"numCarClasses"`
	IrSessionId           int      `json:"irSessionId"`
	Sectors               []Sector `json:"sectors"`
	Sessions              []struct {
		Num  int    `json:"num"`
		Name string `json:"name"`
	} `json:"sessions"`
}

type ExtraInfo

type ExtraInfo struct {
	Track TrackInfo `json:"track"`
}

type Manifests

type Manifests struct {
	Car     []string `json:"car"`
	Pit     []string `json:"pit"`
	Message []string `json:"message"`
	Session []string `json:"session"`
}

type MessageType

type MessageType int
const (
	MTEmpty      MessageType = 0
	MTState      MessageType = 1
	MTStateDelta MessageType = 2
	MTSpeedmap   MessageType = 3
	MTCar        MessageType = 4
)

type PitInfo

type PitInfo struct {
	Exit       float64 `json:"exit"`
	Entry      float64 `json:"entry"`
	LaneLength float64 `json:"laneLength"`
}

type ReplayInfo

type ReplayInfo struct {
	MinTimestamp   float64 `json:"minTimestamp"`
	MinSessionTime float64 `json:"minSessionTime"`
	MaxSessionTime float64 `json:"maxSessionTime"`
}

type Sector

type Sector struct {
	SectorNum      int     `json:"sectorNum"`
	SectorStartPct float64 `json:"sectorStartPct"`
}

type SpeedmapData

type SpeedmapData struct {
	Type      int             `json:"type"`
	Payload   SpeedmapPayload `json:"payload"`
	Timestamp float64         `json:"timestamp"`
}

type SpeedmapPayload

type SpeedmapPayload struct {
	Data        map[string]*ClassSpeedmapData `json:"data"`
	ChunkSize   int                           `json:"chunkSize"`
	TimeOfDay   float64                       `json:"timeOfDay"`
	TrackTemp   float64                       `json:"trackTemp"`
	TrackLength float64                       `json:"trackLength"`
	SessionTime float64                       `json:"sessionTime"`
	CurrentPos  float64                       `json:"currentPos"`
}

type StateData

type StateData struct {
	Type      int          `json:"type"`
	Payload   StatePayload `json:"payload"`
	Timestamp float64      `json:"timestamp"`
}

contains the state message sent by the client via WAMP

type StateDelta

type StateDelta struct {
	Type      int          `json:"type"`
	Payload   DeltaPayload `json:"payload"`
	Timestamp float64      `json:"timestamp"`
}

type StatePayload

type StatePayload struct {
	Cars     [][]interface{} `json:"cars"`
	Session  []interface{}   `json:"session"`
	Messages []interface{}   `json:"messages"`
}

these attributes contain generic data according to event manifests

type Team

type Team struct {
	ID     int    `json:"id"`
	CarIdx int    `json:"carIdx"`
	Name   string `json:"name"`
}

type TrackInfo

type TrackInfo struct {
	ID        int      `json:"trackId"`
	Name      string   `json:"trackDisplayName"`
	ShortName string   `json:"trackDisplayShortName"`
	Config    string   `json:"trackConfigName"`
	Length    float64  `json:"trackLength"`
	Pit       *PitInfo `json:"pit,omitempty"`
	Sectors   []Sector `json:"sectors"`
}

Jump to

Keyboard shortcuts

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