Documentation
¶
Index ¶
- Constants
- type Car
- type CarClass
- type CarList
- type FuelReq
- type PitStrat
- type RaceClass
- type RaceInfo
- type RaceProgress
- type Setup
- type SetupCondition
- type SetupFile
- type SetupList
- type SetupType
- type SetupVote
- type Stint
- type StintAdjustment
- type StintAdjustmentType
- type StratType
- type Strategy
- type StrategyData
- type StrategyInfo
- type StrategyList
- type Track
- type TrackLayout
- type TrackLayoutList
- type TrackList
- type User
Constants ¶
View Source
const ( CarClassLMH CarClass = "LMH" CarClassLMDh CarClass = "LMDh" CarClassP2 CarClass = "P2" CarClassGTE CarClass = "GTE" CarClassGT3 CarClass = "GT3" RaceClassHypercar = "HYPERCAR" RaceClassLMP2 = "LMP2" RaceClassLMGTE = "LMGTE" RaceClassLMGT3 = "LMGT3" )
View Source
const ( SetupTypeSprint SetupType = "sprint" SetupTypeEndurance SetupType = "endurance" SetupTypeHotlap SetupType = "hotlap" SetupConditionDry SetupCondition = "dry" SetupConditionMixed SetupCondition = "mixed" SetupConditionDamp SetupCondition = "damp" SetupConditionWet SetupCondition = "wet" SetupConditionFlooded SetupCondition = "flooded" SetupVote_Upvote SetupVote = "upvote" SetupVote_Downvote SetupVote = "downvote" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Car ¶
type Car struct { ID uuid.UUID `json:"id"` Class CarClass `json:"class"` RaceClass RaceClass `json:"race_class"` Manufacturer string `json:"manufacturer"` Model string `json:"model"` Spec *string `json:"spec,omitempty"` Year uint `json:"year"` CreatedAt time.Time `json:"-"` UpdatedAt *time.Time `json:"-"` }
type RaceInfo ¶
type RaceInfo struct { TankCapacity float64 `json:"tank_capacity,omitempty" validate:"lt=100000"` FuelUse float64 `json:"fuel_use" validate:"required,gt=0,lt=100000"` EnergyUse float64 `json:"energy_use,omitempty" validate:"required_without=TankCapacity,lt=100000"` RaceTime int64 `json:"race_time" validate:"gt=0,lt=172800000"` // less than 48hrs Laptime int64 `json:"laptime" validate:"required,gt=9999,lt=6000000"` // less than 100mnts PitLength int64 `json:"pit_length" validate:"lt=1000000"` }
type RaceProgress ¶
type RaceProgress struct { RemainingTime float64 `json:"remaining_time" validate:"lt:172800000,required_without=LapsComplete"` // less than 48 hrs LapsComplete float64 `json:"laps_complete" validate:"lt:100000"` FuelTank float64 `json:"fuel_tank" validate:"lt:100000"` EnergyTank float64 `json:"energy_tank" validate:"lt:100000"` }
type Setup ¶
type Setup struct { ID uuid.UUID `json:"id" validate:"uuid"` CarID uuid.UUID `json:"car_id" validate:"required,uuid"` TrackID uuid.UUID `json:"track_id" validate:"required,uuid"` TrackLayoutID *uuid.UUID `json:"track_layout_id"` FileName string `json:"file_name" validate:"required"` FileContent string `json:"file_content,omitempty" validate:"required_without=ID"` Laptime string `json:"laptime" validate:"custom_laptime_validation"` Type SetupType `json:"type" validate:"required,oneof=sprint endurance hotlap"` Condition SetupCondition `json:"condition" validate:"required,oneof=dry damp wet flooded mixed"` Rating int64 `json:"rating" validate:"eq=0"` Description *string `json:"description,omitempty"` Downloads int `json:"downloads" validate:"eq=0"` VideoLink string `json:"video_link,omitempty" validate:"omitempty,http_url"` Version string `json:"version"` UserID uuid.UUID `json:"user_id" validate:"required,uuid"` User string `json:"display_name" validate:"required"` UserVote *bool `json:"user_vote""` CreatedAt time.Time `json:"uploaded_at"` UpdatedAt *time.Time `json:"modified,omitempty"` }
TODO(slax0rr): add custom validation to check the track layout id against the stored layout data
type SetupCondition ¶
type SetupCondition = string
type Stint ¶
type Stint struct { StintNumber uint `json:"stint_number" validate:"required"` Laps float64 `json:"laps" validate:"required,gt=0"` Save float64 `json:"save,omitempty"` TargetUse FuelReq `json:"target_use" validate:"required"` StintRequired FuelReq `json:"stint_required" validate:"required"` FuelRatio float64 `json:"fuel_ratio" validate:"required"` PitLength int64 `json:"pit_length" validate:"required"` Complete bool `json:"complete,omitempty"` CompletedLaps float64 `json:"completed_laps,omitempty"` Locked bool `json:"-"` }
type StintAdjustment ¶
type StintAdjustment struct { StintNumber uint `json:"stint_number" validate:"required,gt=0"` Type StintAdjustmentType `json:"type"` Laps float64 `json:"laps,omitempty"` PitLength int64 `json:"pit_length,omitempty"` }
type StintAdjustmentType ¶
type StintAdjustmentType = string
var ( StintAdjustmentType_PitLength StintAdjustmentType = "pitlength" StintAdjustmentType_Laps StintAdjustmentType = "laps" )
type Strategy ¶
type Strategy struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"-"` Passphrase string `json:"passphrase,omitempty"` Name string `json:"name" validate:"required"` Data StrategyData `json:"data" validate:"required"` Progress *RaceProgress `json:"race_progress,omitempty"` StintAdjustments []StintAdjustment `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt *time.Time `json:"-"` }
type StrategyData ¶
type StrategyData struct { RaceInfo RaceInfo `json:"race_info" validate:"required"` Laps float64 `json:"laps" validate:"required,gt=0"` SafeLaps float64 `json:"safe_laps" validate:"required,gt=0"` MinRequired FuelReq `json:"min_required" validate:"required"` SafeRequired FuelReq `json:"safe_required" validate:"required"` FuelRatio float64 `json:"fuel_ratio,omitempty"` PitStrategy PitStrat `json:"pit_strategy" validate:"required"` }
type StrategyInfo ¶
type StrategyInfo struct { Laps float64 `json:"laps"` SafeLaps float64 `json:"safe_laps"` MinRequired FuelReq `json:"min_required"` SafeRequired FuelReq `json:"safe_required"` FuelRatio float64 `json:"fuel_ratio,omitempty"` Strategies []PitStrat `json:"strategies"` RecommStrat StratType `json:"recomm_strat"` }
type StrategyList ¶
type StrategyList []Strategy
type TrackLayout ¶
type TrackLayoutList ¶
type TrackLayoutList []TrackLayout
Click to show internal directories.
Click to hide internal directories.