Documentation ¶
Index ¶
- func AddBet(q Querier, bet *Bet) (int, error)
- func AddCompetition(q Querier, competition *Competition) (string, error)
- func AddOfferedBet(q Querier, ob *OfferedBet) (int, error)
- func AddUser(q Querier, user *User) (int, error)
- func AgreeToBet(q Querier, betId int, userN int, agreed bool) (int, error)
- func CheckUsername(q Querier, username string) (bool, error)
- func ConnectDb() *sqlx.DB
- func CountUserWinLoss(q Querier, userId int) (int, int, error)
- func Experiments(q Querier)
- func OfferedBetNameById(q Querier, offeredBetId int) (string, error)
- func OneHashByName(q Querier, username string) (string, error)
- func OneUserIdByName(q Querier, username string) (int, error)
- func OneUsername(q Querier, userId int) (string, error)
- func SeedDb(db *sqlx.DB)
- func UpdateBet(q Querier, bet *Bet) (int, error)
- func UpdateCompetition(q Querier, competition *Competition) (string, error)
- func UpdateOfferedBet(q Querier, ob *OfferedBet) (int, error)
- type Bet
- type BetAndUser
- type Competition
- type OfferedBet
- type Querier
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCompetition ¶
func AddCompetition(q Querier, competition *Competition) (string, error)
func AddOfferedBet ¶
func AddOfferedBet(q Querier, ob *OfferedBet) (int, error)
func CheckUsername ¶
case insensitive true means username can be used, false means it cannot be used
func Experiments ¶
func Experiments(q Querier)
func OneHashByName ¶
case insensitive
func OneUserIdByName ¶
case insensitive
func UpdateCompetition ¶
func UpdateCompetition(q Querier, competition *Competition) (string, error)
one
func UpdateOfferedBet ¶
func UpdateOfferedBet(q Querier, ob *OfferedBet) (int, error)
Types ¶
type Bet ¶
type BetAndUser ¶
type BetAndUser struct { BetId int `db:"bet_id"` BetStatus int `db:"bet_status"` Amount1 int Outcome1Odds int User1Agreed bool User1Id int Amount2 int Outcome2Odds int User2Agreed bool User2Id int PointSpread float32 `db:"point_spread"` OfferedBetId int `db:"offered_bet_id"` Settled bool Username1 string Balance1 float64 Username2 string Balance2 float64 ObName string `db:"offered_bet_name"` Outcome1 string Outcome2 string EventDate time.Time `db:"event_date"` }
JOINED TYPES
func BetsAndObsAndUsersByUserId ¶
func BetsAndObsAndUsersByUserId(q Querier, userId int) ([]BetAndUser, error)
type Competition ¶
type Competition struct { CompetitionId string `db:"competition_id"` CompetitionName string `db:"competition_name"` EventStatus int `db:"event_status"` EventDate time.Time `db:"event_date"` }
func OneCompetition ¶
func OneCompetition(q Querier, competitionId string) (*Competition, error)
type OfferedBet ¶
type OfferedBet struct { OfferedBetId int `db:"offered_bet_id"` OfferedBetName string `db:"offered_bet_name"` Outcome1 string Outcome1Odds int Outcome2 string Outcome2Odds int PointSpread float32 `db:"point_spread"` EventDate time.Time `db:"event_date"` EventStatus int `db:"event_status"` CompetitionId string `db:"competition_id"` }
func OfferedBetsByCompetiton ¶
func OfferedBetsByCompetiton(q Querier, competitionId string) ([]OfferedBet, error)
Click to show internal directories.
Click to hide internal directories.