racestate

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 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,
	sessionTime float32,
	sessionNum uint32,
) (rsInfoId int, err error)

this method is used if there are driver data prior to the first race state

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 LoadRangeById added in v0.28.0

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

loads a range of entities starting at rsInfoId sessionNum is ignored

func LoadRangeByIdWithinSession added in v0.29.0

func LoadRangeByIdWithinSession(
	ctx context.Context,
	conn repository.Querier,
	eventId int,
	sessionNum uint32,
	rsInfoId int,
	limit int,
) (*util.RangeContainer[racestatev1.PublishStateRequest], error)

loads a range of entities starting at rsInfoId within a session

func LoadRangeBySessionTime added in v0.21.1

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

loads a range of entities starting at sessionTime with session sessionNum

Types

This section is empty.

Jump to

Keyboard shortcuts

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