replay

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverData   providerType = "DriverData"
	StateData    providerType = "StateData"
	SpeedmapData providerType = "SpeedmapData"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Speed          int
	SourceAddr     string // grpc server address providing the data
	SourceInsecure bool   // connect to gRPC server without TLS
	Token          string
	EventKey       string
	DoNotPersist   bool
	FastForward    string
}

func DefaultConfig

func DefaultConfig() *Config

type ProvideEventRequest

type ProvideEventRequest func() *providerv1.RegisterEventRequest

type ReplayDataProvider

type ReplayDataProvider interface {
	ProvideEventData(eventId uint32) *providerv1.RegisterEventRequest
	NextDriverData() *racestatev1.PublishDriverDataRequest
	NextStateData() *racestatev1.PublishStateRequest
	NextSpeedmapData() *racestatev1.PublishSpeedmapRequest
}

func NewDataProvider

func NewDataProvider(
	source *grpc.ClientConn,
	eventId uint32,
	eventRequestProvider ProvideEventRequest,
) ReplayDataProvider

type ReplayOption

type ReplayOption func(*ReplayTask)

func WithContext

func WithContext(ctx context.Context) ReplayOption

func WithFastForward

func WithFastForward(ff time.Duration) ReplayOption

func WithLogging

func WithLogging(logger *log.Logger) ReplayOption

func WithSpeed

func WithSpeed(speed int) ReplayOption

func WithTokenProvider

func WithTokenProvider(provider func() string) ReplayOption

type ReplayTask

type ReplayTask struct {
	// contains filtered or unexported fields
}

func NewReplayTask

func NewReplayTask(
	dest *grpc.ClientConn,
	dataProvider ReplayDataProvider,
	opts ...ReplayOption,
) *ReplayTask

func (*ReplayTask) Replay

func (r *ReplayTask) Replay(eventId uint32) error

Jump to

Keyboard shortcuts

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