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) GetBookmakerDetails() (*BookmakerDetails, 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 BookmakerDetails
- 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
RequestTimeout timeout for an API call
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API for communication with BetRadar API
func Production ¶
Production connects to the production system
func ProductionGlobal ¶ added in v0.4.5
ProductionGlobal connects to the production global system
func (*API) Competitor ¶ added in v0.4.1
func (*API) GetBookmakerDetails ¶ added in v0.4.4
func (a *API) GetBookmakerDetails() (*BookmakerDetails, error)
GetBookmakerDetails returns BookmakerDetails include token's expire_time
func (*API) MarketVariant ¶
func (a *API) MarketVariant(lang uof.Lang, marketID int, variant string) (uof.MarketDescriptions, error)
MarketVariant returns market descriptions
func (*API) RequestFullOddsRecovery ¶
RequestFullOddsRecovery does recovery of odds over the feed. Subscribes client to feed messages.
func (*API) RequestRecovery ¶
RequestRecovery from a timestamp
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 ¶ added in v0.4.1
type BookmakerDetails ¶ added in v0.4.4
type ReplayAPI ¶
type ReplayAPI struct {
// contains filtered or unexported fields
}
ReplayAPI for communicating to Replay server
func Replay ¶
Replay service for unified feed methods set prod to true to run it on production, default will be run on staging
func (*ReplayAPI) Play ¶
Play 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 ¶
Reset 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 ¶
StartScenario 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.