Documentation ¶
Overview ¶
Package api connects to the Unified Feed API interface
Index ¶
- Variables
- type API
- func Dial(ctx context.Context, env uof.Environment, token string) (*API, error)
- func DialCustom(exitSig context.Context, customServer, token string) (*API, error)
- func Production(exitSig context.Context, token string) (*API, error)
- func ProductionGlobal(exitSig context.Context, token string) (*API, error)
- func Staging(exitSig context.Context, token string) (*API, error)
- func (a *API) DailySchedule(lang uof.Lang, date string) ([]uof.Fixture, error)
- func (a *API) Fixture(lang uof.Lang, eventURN uof.URN) (uof.Fixture, error)
- func (a *API) FixtureBytes(lang uof.Lang, eventURN uof.URN) ([]byte, 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) RecoverSportEvent(producer uof.Producer, eventURN uof.URN, requestID, nodeID int) error
- func (a *API) RecoverStatefulForSportEvent(producer uof.Producer, eventURN uof.URN, requestID, nodeID int) error
- func (a *API) RequestFullOddsRecovery(producer uof.Producer, requestID, nodeID int) error
- func (a *API) RequestRecovery(producer uof.Producer, timestamp, requestID, nodeID int) error
- func (a *API) RequestRecoverySinceTimestamp(producer uof.Producer, timestamp, requestID, nodeID int) 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 DialCustom ¶
DialCustom connects to a custom system
func Production ¶
Production connects to the production system
func ProductionGlobal ¶
Production connects to the production system
func (*API) DailySchedule ¶
DailySchedule lists fixtures from all sports for a specific day
func (*API) FixtureBytes ¶
FixtureBytes lists the fixture for a specified sport event (returns buf)
func (*API) MarketVariant ¶
func (*API) RecoverSportEvent ¶
func (a *API) RecoverSportEvent(producer uof.Producer, eventURN uof.URN, requestID, nodeID int) error
RecoverSportEvent requests to resend all odds for all markets for a sport event.
func (*API) RecoverStatefulForSportEvent ¶
func (a *API) RecoverStatefulForSportEvent(producer uof.Producer, eventURN uof.URN, requestID, nodeID int) error
RecoverStatefulForSportEvent requests to resend all stateful-messages (BetSettlement, RollbackBetSettlement, BetCancel, UndoBetCancel) for a sport event.
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, requestID, nodeID int) error
RequestRecoverySinceTimestamp does recovery of odds and stateful messages over the feed since after timestamp. Subscribes client to feed messages.
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.