api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package api connects to the Unified Feed API interface

Index

Constants

This section is empty.

Variables

View Source
var RequestTimeout = 32 * time.Second

Functions

This section is empty.

Types

type API

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

func Dial

func Dial(ctx context.Context, env uof.Environment, token string) (*API, error)

Dial connect to the staging or production api environment

func Production

func Production(exitSig context.Context, token string) (*API, error)

Production connects to the production system

func Staging

func Staging(exitSig context.Context, token string) (*API, error)

Staging connects to the staging system

func (*API) Competitor

func (a *API) Competitor(lang uof.Lang, playerID int) (*uof.CompetitorPlayer, error)

func (*API) Fixture

func (a *API) Fixture(lang uof.Lang, eventURN uof.URN) (*uof.Fixture, error)

Fixture lists the fixture for a specified sport event

func (*API) Fixtures

func (a *API) Fixtures(lang uof.Lang, to time.Time) (<-chan uof.Fixture, <-chan error)

Fixtures gets all the fixtures with schedule before to

func (*API) MarketVariant

func (a *API) MarketVariant(lang uof.Lang, marketID int, variant string) (uof.MarketDescriptions, error)

func (*API) Markets

func (a *API) Markets(lang uof.Lang) (uof.MarketDescriptions, error)

Markets all currently available markets for a language

func (*API) Ping

func (a *API) Ping() error

func (*API) Player

func (a *API) Player(lang uof.Lang, playerID int) (*uof.Player, error)

func (*API) RequestFullOddsRecovery

func (a *API) RequestFullOddsRecovery(producer uof.Producer, requestID int) error

RequestFullOddsRecovery does recovery of odds over the feed. Subscribes client to feed messages.

func (*API) RequestRecovery

func (a *API) RequestRecovery(producer uof.Producer, timestamp int, requestID int) error

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) Summary

func (a *API) Summary(lang uof.Lang, eventURN uof.URN) (*uof.Summary, error)

Fixture with extra information

func (*API) Tournament

func (a *API) Tournament(lang uof.Lang, eventURN uof.URN) (*uof.FixtureTournament, error)

type ReplayAPI

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

func Replay

func Replay(exitSig context.Context, token string) (*ReplayAPI, error)

Replay service for unified feed methods

func (*ReplayAPI) Add

func (r *ReplayAPI) Add(eventURN uof.URN) error

Adds to the end of the replay queue.

func (*ReplayAPI) Play

func (r *ReplayAPI) Play(speed, maxDelay int) error

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

func (r *ReplayAPI) Reset() error

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

func (r *ReplayAPI) StartEvent(eventURN uof.URN, speed, maxDelay int) error

StartEvent starts replay of a single event.

func (*ReplayAPI) StartScenario

func (r *ReplayAPI) StartScenario(scenarioID, speed, maxDelay int) error

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.

func (*ReplayAPI) Stop

func (r *ReplayAPI) Stop() error

Stop the player if it is currently playing. If player is already stopped, nothing will happen.

Jump to

Keyboard shortcuts

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