racestate

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectMessages

func CollectMessages(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
) ([]*racestatev1.MessageContainer, error)

func CreateDummyRaceStateInfo added in v0.14.2

func CreateDummyRaceStateInfo(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
	ts time.Time,
) (rsInfoId int, err error)

this method is used if there are driver data prior to the first race state this should not happen but may occur on migration from old wamp data

func CreateRaceState

func CreateRaceState(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
	racestate *racestatev1.PublishStateRequest,
) (rsInfoId int, err error)

stores the racestate info and the protobuf message in the database returns the id of the created rs_info entry for further use

func DeleteByEventId

func DeleteByEventId(ctx context.Context, conn repository.Querier, eventId int) (int, error)

deletes all entries for an event from the database, returns number of rows deleted.

func FindNearestRaceState

func FindNearestRaceState(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
	sessionTime float32,
) (rsInfoId int, err error)

func LoadLatest

func LoadLatest(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
) (*racestatev1.PublishStateRequest, error)

func LoadRange

func LoadRange(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
	startTS time.Time,
	limit int,
) (*util.RangeContainer[racestatev1.PublishStateRequest], error)

func LoadRangeBySessionTime added in v0.21.1

func LoadRangeBySessionTime(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
	sessionTime float64,
	limit int,
) (*util.RangeContainer[racestatev1.PublishStateRequest], error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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