handler

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: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPREAD            = "SPREAD"
	MONEYLINE         = "MONEYLINE"
	TOTAL_POINTS      = "TOTAL_POINTS"
	TEAM_TOTAL_POINTS = "TEAM_TOTAL_POINTS"
	OVER              = "OVER"
	UNDER             = "UNDER"
	Team1             = "Team1"
	Team2             = "Team2"
	Draw              = "Draw"
)
View Source
const LockTimeOut = time.Second * 28

Variables

View Source
var BettingStatus bool
View Source
var EMarketMap = map[string]string{MONEYLINE: "m", SPREAD: "s", TOTAL_POINTS: "ou", TEAM_TOTAL_POINTS: "tt"}
View Source
var ETeamMap = map[string]string{Team1: "home", Team2: "away"}
View Source
var ETicketMap sync.Map

Functions

func ConvertEMarket

func ConvertEMarket(m Market) string

func ParseUrl

func ParseUrl(side *pb.SurebetSide) (err error)

Types

type Handler

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

func NewHandler

func NewHandler(cfg *config.Config, log *zap.SugaredLogger, store *store.Store, auth *auth.Auth) *Handler

func (*Handler) AccId

func (h *Handler) AccId() int

func (*Handler) CalcHandicapMiddleMargin

func (h *Handler) CalcHandicapMiddleMargin(ctx context.Context, eventId string, period int) (middleMarginAvg float64, err error)

func (*Handler) CalcTotalMiddleMargin

func (h *Handler) CalcTotalMiddleMargin(ctx context.Context, eventId string, period int) (middleMarginAvg float64, err error)

func (*Handler) CheckLine

func (h *Handler) CheckLine(ctx context.Context, sb *pb.Surebet) error

func (*Handler) Close

func (h *Handler) Close()

func (*Handler) ECheck

func (h *Handler) ECheck(ctx context.Context, sb *pb.Surebet, m Market)

func (*Handler) EPlaceBet

func (h *Handler) EPlaceBet(ctx context.Context, sb *pb.Surebet)

func (*Handler) FindEvent

func (h *Handler) FindEvent(ctx context.Context, line *pb.SurebetSide) error

func (*Handler) FindLeagueIdByName

func (h *Handler) FindLeagueIdByName(ctx context.Context, line *pb.SurebetSide) error

func (*Handler) GetCurrency

func (h *Handler) GetCurrency(sb *pb.Surebet) float64

func (*Handler) GetLock

func (h *Handler) GetLock(sb *pb.Surebet) bool

func (*Handler) GetResults

func (h *Handler) GetResults(ctx context.Context) ([]pb.BetResult, error)

func (*Handler) GetTicket

func (h *Handler) GetTicket(id int64) (Ticket, error)

func (*Handler) ReleaseCheck

func (h *Handler) ReleaseCheck(ctx context.Context, sb *pb.Surebet)

func (*Handler) SetTicket

func (h *Handler) SetTicket(id int64, t Ticket)

type Market

type Market struct {
	BetType      string
	PeriodNumber int
	Team         string
	Side         string
	Handicap     *float64
}

func Convert

func Convert(name string) (Market, error)

type Ticket

type Ticket struct {
	Market
	api.LineResponse
	SportId int64
	EventId int64
}

Jump to

Keyboard shortcuts

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