proxy

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEventNotFound = errors.New("event not found")

Functions

This section is empty.

Types

type DataProxy

type DataProxy interface {
	PublishProxy
	LiveEvents() []*EventData

	// returns the event data for the given selector
	GetEvent(sel *commonv1.EventSelector) (*EventData, error)

	// subscribe to race state data
	// the returned channel is the provider for outgoing live messages
	SubscribeRaceStateData(sel *commonv1.EventSelector) (
		dataChan <-chan *racestatev1.PublishStateRequest,
		quitChan chan<- struct{},
		err error,
	)

	// subscribe to speedmap data
	// the returned channel is the provider for outgoing live messages
	SubscribeSpeedmapData(sel *commonv1.EventSelector) (
		dataChan <-chan *racestatev1.PublishSpeedmapRequest,
		quitChan chan<- struct{},
		err error,
	)

	// subscribe to driver data
	// the returned channel is the provider for outgoing live messages
	SubscribeDriverData(sel *commonv1.EventSelector) (
		dataChan <-chan *livedatav1.LiveDriverDataResponse,
		quitChan chan<- struct{},
		err error,
	)

	// subscribe to analysis data
	// the returned channel is the provider for outgoing live messages
	SubscribeAnalysisData(sel *commonv1.EventSelector) (
		dataChan <-chan *analysisv1.Analysis,
		quitChan chan<- struct{},
		err error,
	)

	// subscribe to snapshot data
	// the returned channel is the provider for outgoing live messages
	SubscribeSnapshotData(sel *commonv1.EventSelector) (
		dataChan <-chan *analysisv1.SnapshotData,
		quitChan chan<- struct{},
		err error,
	)
	// provides all snapshot data for the given event
	HistorySnapshotData(sel *commonv1.EventSelector) []*analysisv1.SnapshotData
	// performs cleanup
	Close()
}

type EmptyProxy

type EmptyProxy struct{}

func (EmptyProxy) Close

func (e EmptyProxy) Close()

func (EmptyProxy) GetEvent

func (e EmptyProxy) GetEvent(sel *commonv1.EventSelector) (*EventData, error)

func (EmptyProxy) HistorySnapshotData

func (e EmptyProxy) HistorySnapshotData(sel *commonv1.EventSelector) []*analysisv1.SnapshotData

func (EmptyProxy) LiveEvents

func (e EmptyProxy) LiveEvents() []*EventData

func (EmptyProxy) PublishDriverData

func (e EmptyProxy) PublishDriverData(req *racestatev1.PublishDriverDataRequest) error

func (EmptyProxy) PublishEventRegistered

func (e EmptyProxy) PublishEventRegistered(epd *utils.EventProcessingData) error

func (EmptyProxy) PublishEventUnregistered

func (e EmptyProxy) PublishEventUnregistered(eventKey string) error

func (EmptyProxy) PublishRaceStateData

func (e EmptyProxy) PublishRaceStateData(req *racestatev1.PublishStateRequest) error

func (EmptyProxy) PublishSpeedmapData

func (e EmptyProxy) PublishSpeedmapData(req *racestatev1.PublishSpeedmapRequest) error

func (EmptyProxy) SubscribeAnalysisData

func (e EmptyProxy) SubscribeAnalysisData(sel *commonv1.EventSelector) (
	d <-chan *analysisv1.Analysis,
	q chan<- struct{},
	err error,
)

func (EmptyProxy) SubscribeDriverData

func (e EmptyProxy) SubscribeDriverData(sel *commonv1.EventSelector) (
	d <-chan *livedatav1.LiveDriverDataResponse,
	q chan<- struct{},
	err error,
)

func (EmptyProxy) SubscribeRaceStateData

func (e EmptyProxy) SubscribeRaceStateData(sel *commonv1.EventSelector) (
	d <-chan *racestatev1.PublishStateRequest,
	q chan<- struct{},
	err error,
)

func (EmptyProxy) SubscribeSnapshotData

func (e EmptyProxy) SubscribeSnapshotData(sel *commonv1.EventSelector) (
	d <-chan *analysisv1.SnapshotData,
	q chan<- struct{},
	err error,
)

func (EmptyProxy) SubscribeSpeedmapData

func (e EmptyProxy) SubscribeSpeedmapData(sel *commonv1.EventSelector) (
	d <-chan *racestatev1.PublishSpeedmapRequest,
	q chan<- struct{},
	err error,
)

type EventData

type EventData struct {
	Event *eventv1.Event
	Track *trackv1.Track
	Owner string
}

func (*EventData) Equals added in v0.28.0

func (e *EventData) Equals(other *EventData) bool

func (*EventData) FromBinary added in v0.28.0

func (e *EventData) FromBinary(data []byte) error

func (*EventData) ToBinary added in v0.28.0

func (e *EventData) ToBinary() ([]byte, error)

type PublishProxy

type PublishProxy interface {
	// handles the registration of a new event
	PublishEventRegistered(epd *utils.EventProcessingData) error
	// handles the unregistration of an event
	PublishEventUnregistered(eventKey string) error
	// this method is uses by the instance processing the incoming data
	// the purpose is to distribute the incoming data to all subscribers
	PublishRaceStateData(req *racestatev1.PublishStateRequest) error
	// this method is uses by the instance processing the incoming data
	// the purpose is to distribute the incoming data to all subscribers
	PublishSpeedmapData(req *racestatev1.PublishSpeedmapRequest) error
	// this method is uses by the instance processing the incoming data
	// the purpose is to distribute the incoming data to all subscribers
	PublishDriverData(req *racestatev1.PublishDriverDataRequest) error
}

PublishProxy is the interface for publishing data from (external) race data providers. These data can be easily converted for response data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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