store

package
v0.0.0-...-a3a9e33 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentEventsQ = `` /* 652-byte string literal not displayed */
View Source
const DeleteOldLinesSQL = `
delete l
from Line l
         join Event e on l.EventId = e.Id
where DATEDIFF(day, Starts, sysdatetimeoffset()) > 7
`
View Source
const DeleteOldMoneylinesSQL = `
delete m 
from Moneyline m
where DATEDIFF(day, UpdatedAt, sysdatetimeoffset()) > 14
`

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id           int
	AccountType  string
	CurrencyCode string
	ServiceName  string
	Username     string
	Password     string
	Commission   float64
	Share        float64
}

type DemoEvent

type DemoEvent struct {
	Id            string
	Home          string
	Away          string
	SportName     string
	SportId       string
	LeagueName    string
	LeagueId      string
	ResultingUnit string
	Starts        string
}

type LineType

type LineType struct {
	LineId       *int64
	EventId      *int64
	Number       *int
	Cutoff       *time.Time
	Status       *int
	MaxSpread    *float64
	MaxMoneyline *float64
	MaxTotal     *float64
	MaxTeamTotal *float64
}

type MoneylineType

type MoneylineType struct {
	LineId *int64
	Home   *float64
	Away   *float64
	Draw   *float64
}

type SpecialContestantType

type SpecialContestantType struct {
	Id        *int64
	Name      *string
	RotNum    *int
	SpecialId *int64
}

type SpecialEventType

type SpecialEventType struct {
	Id           *int
	PeriodNumber *int
	Home         *string
	Away         *string
	SpecialId    *int64
}

type SpecialLineType

type SpecialLineType struct {
	Id        *int64
	SpecialId *int64
	LineId    *int64
	MaxBet    *float64
	Price     *float64
	Handicap  *float64
}

type SpecialType

type SpecialType struct {
	Id         *int64
	BetType    *string
	Name       *string
	Date       *time.Time
	Cutoff     *time.Time
	Category   *string
	Units      *string
	Status     *string
	LiveStatus *int
}

type Spread

type Spread struct {
	LineId    int64
	AltLineId *int64
	Hdp       float64
	Home      float64
	Away      float64
}

type SpreadType

type SpreadType struct {
	LineId    *int64
	AltLineId *int64
	Hdp       *float64
	Home      *float64
	Away      *float64
}

type Stat

type Stat struct {
	MarketName  string
	CountEvent  int64
	CountLine   int64
	AmountEvent int64
	AmountLine  int64
}

type Store

type Store struct {
	Cache *ristretto.Cache
	// contains filtered or unexported fields
}

func NewStore

func NewStore(cfg *config.Config, log *zap.SugaredLogger, db *sqlx.DB) *Store

func (*Store) Close

func (s *Store) Close()

func (*Store) CreateSport

func (s *Store) CreateSport(ctx context.Context, sport api.Sport) error

func (*Store) DeleteOldLines

func (s *Store) DeleteOldLines(ctx context.Context) error

func (*Store) DeleteOldMoneylines

func (s *Store) DeleteOldMoneylines(ctx context.Context) error

func (*Store) FindEvent

func (s *Store) FindEvent(ctx context.Context, line *pb.SurebetSide) error

func (*Store) FindLeagueIdByName

func (s *Store) FindLeagueIdByName(ctx context.Context, line *pb.SurebetSide) error

func (*Store) FindSportIdByName

func (s *Store) FindSportIdByName(ctx context.Context, line *pb.SurebetSide) error

func (*Store) GetAccount

func (s *Store) GetAccount(ctx context.Context) (Account, error)

func (*Store) GetEvent

func (s *Store) GetEvent(eventId string) (event api.Fixture, err error)

func (*Store) GetResults

func (s *Store) GetResults(ctx context.Context) ([]pb.BetResult, error)

func (*Store) GetStat

func (s *Store) GetStat(side *pb.SurebetSide) error

func (*Store) IsInCache

func (s *Store) IsInCache(ctx context.Context, sport api.Sport) bool

func (*Store) LoadToken

func (s *Store) LoadToken(ctx context.Context) (Token, error)

func (*Store) SaveBalance

func (s *Store) SaveBalance(ctx context.Context, b api.ClientBalanceResponse, accountId int) error

func (*Store) SaveBet

func (s *Store) SaveBet(sb *pb.Surebet) error

func (*Store) SaveBetList

func (s *Store) SaveBetList(bets []api.StraightBetV3) error

func (*Store) SaveCheck

func (s *Store) SaveCheck(sb *pb.Surebet) error

func (*Store) SaveEvents

func (s *Store) SaveEvents(ctx context.Context, leagueId int, events []api.Fixture) error

func (*Store) SaveLeagues

func (s *Store) SaveLeagues(ctx context.Context, sportId int, leagues []api.League) error

func (*Store) SaveLines

func (s *Store) SaveLines(ctx context.Context, eventId int64, periods []api.OddsPeriod) error

func (*Store) SavePeriods

func (s *Store) SavePeriods(ctx context.Context, sportId int, got []api.Period) error

func (*Store) SaveSpecialLines

func (s *Store) SaveSpecialLines(ctx context.Context, leagueId int, specials []api.SpecialOddsSpecial) error

func (*Store) SaveSpecials

func (s *Store) SaveSpecials(ctx context.Context, leagueId int, specials []api.SpecialFixture) error

func (*Store) SaveSports

func (s *Store) SaveSports(ctx context.Context, sports []api.Sport) error

func (*Store) SaveToken

func (s *Store) SaveToken(ctx context.Context, token Token) error

func (*Store) SelectCurrentEvents

func (s *Store) SelectCurrentEvents(ctx context.Context, sportId int64, count int64, eventType string) (events []DemoEvent, err error)

func (*Store) SelectSpreads

func (s *Store) SelectSpreads(ctx context.Context, eventId string, period int) (spreads []Spread, err error)

func (*Store) SelectTotals

func (s *Store) SelectTotals(ctx context.Context, eventId string, period int) (totals []Total, err error)

func (*Store) SetVerifyWithTTL

func (s *Store) SetVerifyWithTTL(key string, value interface{}, ttl time.Duration) bool

type Token

type Token struct {
	Session   string
	ApiKey    string
	Device    string
	TrustCode string
	Id        int64
}

type Total

type Total struct {
	LineId    int64
	AltLineId *int64
	Points    float64
	Over      float64
	Under     float64
}

type TotalType

type TotalType struct {
	LineId    *int64
	AltLineId *int64
	Points    *float64
	Over      *float64
	Under     *float64
}

Jump to

Keyboard shortcuts

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