Documentation ¶
Overview ¶
Package api connects to the Unified Feed API interface
Index ¶
- Variables
- type API
- func (a *API) Competitor(lang uof.Lang, playerID int) (*uof.CompetitorPlayer, error)
- func (a *API) Fixture(lang uof.Lang, eventURN uof.URN) (*uof.Fixture, error)
- func (a *API) Fixtures(lang uof.Lang, to time.Time) (<-chan uof.Fixture, <-chan error)
- func (a *API) MarketVariant(lang uof.Lang, marketID int, variant string) (uof.MarketDescriptions, error)
- func (a *API) Markets(lang uof.Lang) (uof.MarketDescriptions, error)
- func (a *API) Ping() error
- func (a *API) Player(lang uof.Lang, playerID int) (*uof.Player, error)
- func (a *API) RequestFullOddsRecovery(producer uof.Producer, requestID int) error
- func (a *API) RequestRecovery(producer uof.Producer, timestamp int, requestID int) error
- func (a *API) RequestRecoverySinceTimestamp(producer uof.Producer, timestamp int, requestID int) error
- func (a *API) Summary(lang uof.Lang, eventURN uof.URN) (*uof.Summary, error)
- func (a *API) Tournament(lang uof.Lang, eventURN uof.URN) (*uof.FixtureTournament, error)
- type ReplayAPI
- func (r *ReplayAPI) Add(eventURN uof.URN) error
- func (r *ReplayAPI) Play(speed, maxDelay int) error
- func (r *ReplayAPI) Reset() error
- func (r *ReplayAPI) StartEvent(eventURN uof.URN, speed, maxDelay int) error
- func (r *ReplayAPI) StartScenario(scenarioID, speed, maxDelay int) error
- func (r *ReplayAPI) Stop() error
Constants ¶
This section is empty.
Variables ¶
var RequestTimeout = 32 * time.Second
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func Production ¶
Production connects to the production system
func (*API) Competitor ¶
func (*API) MarketVariant ¶
func (*API) RequestFullOddsRecovery ¶
RequestFullOddsRecovery does recovery of odds over the feed. Subscribes client to feed messages.
func (*API) RequestRecovery ¶
func (*API) RequestRecoverySinceTimestamp ¶
func (a *API) RequestRecoverySinceTimestamp(producer uof.Producer, timestamp int, requestID int) error
RequestRecoverySinceTimestamp does recovery of odds and stateful messages over the feed since after timestamp. Subscribes client to feed messages.
func (*API) Tournament ¶
type ReplayAPI ¶
type ReplayAPI struct {
// contains filtered or unexported fields
}
func (*ReplayAPI) Play ¶
Start replay the events from replay queue. Events are played in the order they were played in reality. Parameters 'speed' and 'max_delay' specify the speed of replay and what should be the maximum delay between messages. Default values for these are speed = 10 and max_delay = 10000. This means that messages will be sent 10x faster than in reality, and that if there was some delay between messages that was longer than 10 seconds it will be reduced to exactly 10 seconds/10 000 ms (this is helpful especially in pre-match odds where delay can be even a few hours or more). If player is already in play, nothing will happen.
func (*ReplayAPI) Reset ¶
Stop the player if it is currently playing and clear the replay queue. If player is already stopped, the queue is cleared.
func (*ReplayAPI) StartEvent ¶
StartEvent starts replay of a single event.
func (*ReplayAPI) StartScenario ¶
Start replay of the scenario from replay queue. Your current playlist will be wiped, and populated with events from specified scenario. Events are played in the order they were played in reality. Parameters 'speed' and 'max_delay' specify the speed of replay and what should be the maximum delay between messages. Default values for these are speed = 10 and max_delay = 10000. This means that messages will be sent 10x faster than in reality, and that if there was some delay between messages that was longer than 10 seconds it will be reduced to exactly 10 seconds/10 000 ms (this is helpful especially in pre-match odds where delay can be even a few hours or more). If player is already in play, nothing will happen.