Documentation ¶
Index ¶
- func FindMostSimilarPlayerIDs(similarToPlayerID, limit int, playerZScores []model.StandardizedPlayerStats) []int
- func GetDatabase(league string) (*sqlx.DB, error)
- func Getprizepicks(nbaClient BasketballRepository)
- func ParsePrizePickProposition(db BasketballRepository, schedule model.Schedule, prop model.PrizePicksData, ...) (proposition *model.DBProposition, game *model.PlayerGame, err error)
- func SQLDateBefore(date time.Time) string
- func SimilarPlayerFilters(season model.SeasonOption, endDate string, playerIDs []int) []*model.PlayerFilter
- type BasketballRepository
- type MongoClient
- func (c *MongoClient) GetLeague() string
- func (c *MongoClient) GetPlayerGames(ctx context.Context, input *model.GameFilter) ([]*model.PlayerGame, error)
- func (c *MongoClient) GetPlayers(ctx context.Context, withGames bool, inputs ...*model.PlayerFilter) ([]*model.Player, error)
- func (c *MongoClient) GetPropositions(ctx context.Context, input *model.PropositionFilter) ([]*model.Proposition, error)
- func (c *MongoClient) GetPropositionsByPlayerGame(ctx context.Context, game model.PlayerGame) ([]*model.Proposition, error)
- func (c *MongoClient) GetSimilarPlayers(ctx context.Context, similarToPlayerID int, input *model.SimilarPlayerInput, ...) ([]*model.Player, error)
- func (c *MongoClient) GetSimilarTeams(ctx context.Context, similarToTeamID int, input *model.SimilarTeamInput, ...) ([]*model.Team, error)
- func (c *MongoClient) GetTeams(ctx context.Context, withGames bool, inputs *[]*model.TeamFilter) ([]*model.Team, error)
- func (c *MongoClient) SavePropositions(ctx context.Context, propositions []*model.DBProposition) (int, error)
- func (c *MongoClient) SaveUpcomingGames(ctx context.Context, games []*model.PlayerGame) (int, error)
- type SQLClient
- func (c *SQLClient) AddQuery()
- func (c *SQLClient) CountQueries() int
- func (c *SQLClient) GetLeague() string
- func (c *SQLClient) GetPlayerGames(ctx context.Context, inputs ...model.GameFilter) (games []*model.PlayerGame, err error)
- func (c *SQLClient) GetPlayers(ctx context.Context, withGames bool, playerFilters ...*model.PlayerFilter) ([]*model.Player, error)
- func (c *SQLClient) GetPropositions(ctx context.Context, propositionFilter *model.PropositionFilter) ([]*model.Proposition, error)
- func (c *SQLClient) GetPropositionsByPlayerGame(ctx context.Context, game model.PlayerGame) ([]*model.Proposition, error)
- func (c *SQLClient) GetSimilarPlayers(ctx context.Context, similarToPlayerID int, input *model.SimilarPlayerInput, ...) ([]*model.Player, error)
- func (c *SQLClient) GetSimilarTeams(ctx context.Context, similarToTeamID int, input *model.SimilarTeamInput, ...) ([]*model.Team, error)
- func (c *SQLClient) GetStandardizedPlayerStats(ctx context.Context, similarPlayerQuery model.SimilarPlayerQuery, ...) ([]model.StandardizedPlayerStats, error)
- func (c *SQLClient) GetTeams(ctx context.Context, withGames bool, teamFilters ...*model.TeamFilter) ([]*model.Team, error)
- func (c *SQLClient) SaveDBPropositions(ctx context.Context, propositions []*model.DBProposition) (int, error)
- func (c *SQLClient) SavePropositions(ctx context.Context, propositions []*model.Proposition) (int, error)
- func (c *SQLClient) SaveUpcomingGames(ctx context.Context, games []*model.PlayerGame) (int, error)
- func (c *SQLClient) SetQueries(q int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindMostSimilarPlayerIDs ¶
func FindMostSimilarPlayerIDs(similarToPlayerID, limit int, playerZScores []model.StandardizedPlayerStats) []int
func Getprizepicks ¶
func Getprizepicks(nbaClient BasketballRepository)
func ParsePrizePickProposition ¶
func ParsePrizePickProposition(db BasketballRepository, schedule model.Schedule, prop model.PrizePicksData, itemIDToNameMap map[string]string) (proposition *model.DBProposition, game *model.PlayerGame, err error)
func SQLDateBefore ¶
func SimilarPlayerFilters ¶
func SimilarPlayerFilters(season model.SeasonOption, endDate string, playerIDs []int) []*model.PlayerFilter
Types ¶
type BasketballRepository ¶
type BasketballRepository interface { GetLeague() string CountQueries() int SetQueries(int) AddQuery() GetPlayers(ctx context.Context, withGames bool, playerFilters ...*model.PlayerFilter) ([]*model.Player, error) GetPropositions(ctx context.Context, propositionFilter *model.PropositionFilter) ([]*model.Proposition, error) SavePropositions(ctx context.Context, propositions []*model.Proposition) (int, error) SaveDBPropositions(ctx context.Context, propositions []*model.DBProposition) (int, error) SaveUpcomingGames(ctx context.Context, games []*model.PlayerGame) (int, error) // GetTeamsByID(ctx context.Context, teamIDs []int) ([]*model.Team, error) // GetTeamsByAbr(ctx context.Context, teamAbrs []string) ([]*model.Team, error) GetTeams(ctx context.Context, withGames bool, teamFilters ...*model.TeamFilter) ([]*model.Team, error) GetSimilarPlayers(ctx context.Context, similarToPlayerID int, input *model.SimilarPlayerInput, endDate *time.Time) ([]*model.Player, error) GetSimilarTeams(ctx context.Context, similarToTeamID int, input *model.SimilarTeamInput, endDate string) ([]*model.Team, error) GetPropositionsByPlayerGame(ctx context.Context, game model.PlayerGame) ([]*model.Proposition, error) GetPlayerGames(ctx context.Context, inputs ...model.GameFilter) ([]*model.PlayerGame, error) GetStandardizedPlayerStats(ctx context.Context, similarPlayerQuery model.SimilarPlayerQuery, toPlayerIDs ...int) ([]model.StandardizedPlayerStats, error) }
type MongoClient ¶
type MongoClient struct { Name string *mongo.Database Queries int Client *mongo.Client PlayerSimilarity model.PlayerSnapshots TeamSimilarity model.TeamSnapshots PlayerCache map[string][]*model.Player TeamCache map[string][]*model.Team // contains filtered or unexported fields }
func (*MongoClient) GetLeague ¶
func (c *MongoClient) GetLeague() string
func (*MongoClient) GetPlayerGames ¶
func (c *MongoClient) GetPlayerGames(ctx context.Context, input *model.GameFilter) ([]*model.PlayerGame, error)
func (*MongoClient) GetPlayers ¶
func (c *MongoClient) GetPlayers(ctx context.Context, withGames bool, inputs ...*model.PlayerFilter) ([]*model.Player, error)
func (*MongoClient) GetPropositions ¶
func (c *MongoClient) GetPropositions(ctx context.Context, input *model.PropositionFilter) ([]*model.Proposition, error)
func (*MongoClient) GetPropositionsByPlayerGame ¶
func (c *MongoClient) GetPropositionsByPlayerGame(ctx context.Context, game model.PlayerGame) ([]*model.Proposition, error)
func (*MongoClient) GetSimilarPlayers ¶
func (c *MongoClient) GetSimilarPlayers(ctx context.Context, similarToPlayerID int, input *model.SimilarPlayerInput, endDate string) ([]*model.Player, error)
func (*MongoClient) GetSimilarTeams ¶
func (c *MongoClient) GetSimilarTeams(ctx context.Context, similarToTeamID int, input *model.SimilarTeamInput, endDate string) ([]*model.Team, error)
func (*MongoClient) GetTeams ¶
func (c *MongoClient) GetTeams(ctx context.Context, withGames bool, inputs *[]*model.TeamFilter) ([]*model.Team, error)
func (*MongoClient) SavePropositions ¶
func (c *MongoClient) SavePropositions(ctx context.Context, propositions []*model.DBProposition) (int, error)
func (*MongoClient) SaveUpcomingGames ¶
func (c *MongoClient) SaveUpcomingGames(ctx context.Context, games []*model.PlayerGame) (int, error)
type SQLClient ¶
func NewSQLClient ¶
func (*SQLClient) CountQueries ¶
func (*SQLClient) GetPlayerGames ¶
func (c *SQLClient) GetPlayerGames(ctx context.Context, inputs ...model.GameFilter) (games []*model.PlayerGame, err error)
func (*SQLClient) GetPlayers ¶
func (*SQLClient) GetPropositions ¶
func (c *SQLClient) GetPropositions(ctx context.Context, propositionFilter *model.PropositionFilter) ([]*model.Proposition, error)
func (*SQLClient) GetPropositionsByPlayerGame ¶
func (c *SQLClient) GetPropositionsByPlayerGame(ctx context.Context, game model.PlayerGame) ([]*model.Proposition, error)
func (*SQLClient) GetSimilarPlayers ¶
func (*SQLClient) GetSimilarTeams ¶
func (*SQLClient) GetStandardizedPlayerStats ¶
func (c *SQLClient) GetStandardizedPlayerStats(ctx context.Context, similarPlayerQuery model.SimilarPlayerQuery, toPlayerIDs ...int) ([]model.StandardizedPlayerStats, error)
func (*SQLClient) SaveDBPropositions ¶
func (*SQLClient) SavePropositions ¶
func (*SQLClient) SaveUpcomingGames ¶
func (*SQLClient) SetQueries ¶
Click to show internal directories.
Click to hide internal directories.