Versions in this module Expand all Collapse all v0 v0.0.1 Sep 1, 2025 Changes in this version + var ErrInvalidRankStatuID = errors.New("invalid rank status id") + func CreateListRankOption(history []Match) [][2]ListRankOption + func NewStore(pool *pgxpool.Pool) internal.Store + func ParticipantDetailFromPG(participant Participant, summoner Summoner, ...) internal.ParticipantDetailOption + func WithPostgresRankStatus2(rank *RankFull) internal.RankStatusOption + func WithPostgresSummonerMatch(match Match, participant Participant, rankBefore, rankAfter *RankFull) internal.SummonerMatchOption + type BatchTx interface + Queue func(query string, arguments ...any) *pgx.QueuedQuery + type ListRankOption struct + End *time.Time + Limit uint + Offset uint + Recent bool + Start *time.Time + type Match struct + Date time.Time + Duration time.Duration + ID string + Version string + WinnerID int + type MatchStore struct + Tx Tx + func (db *MatchStore) CreateMatch(ctx context.Context, match Match) error + func (db *MatchStore) CreateMatchInBatch(tx BatchTx, match Match) + func (db *MatchStore) CreateParticipant(ctx context.Context, participant Participant) error + func (db *MatchStore) CreateParticipantInBatch(tx BatchTx, participant Participant) + func (db *MatchStore) GetMatch(ctx context.Context, id string) (Match, error) + func (db *MatchStore) GetNewMatchIDs(ctx context.Context, ids []string) (newIDs []string, err error) + func (db *MatchStore) GetParticipant(ctx context.Context, puuid riot.PUUID, matchID string) (Participant, error) + func (db *MatchStore) GetParticipants(ctx context.Context, id string) ([]Participant, error) + func (db *MatchStore) GetSummonerChampions(ctx context.Context, puuid riot.PUUID, start, end time.Time) ([]internal.SummonerChampion, error) + func (db *MatchStore) ListMatchHistoryIDs(ctx context.Context, puuid riot.PUUID, start, end time.Time) ([]string, error) + type Migrator struct + type PGInstance struct + func NewPGInstance(ctx context.Context, migrationsPath string) *PGInstance + func (p *PGInstance) SetupConn(ctx context.Context, t testing.TB) *pgxpool.Pool + func (p *PGInstance) SetupStore(ctx context.Context, t testing.TB) internal.Store + func (p *PGInstance) Terminate(ctx context.Context) error + type Participant struct + Assists int + ChampionID int + ChampionLevel int + CreepScore int + CreepScorePerMinute float32 + DamageDealt int + DamageDeltaEnemy int + DamagePercentageTeam float32 + DamageTaken int + Deaths int + GoldDeltaEnemy int + GoldEarned int + GoldPercentageTeam float32 + Items [7]int + KillParticipation float32 + Kills int + MatchID string + PUUID string + PinkWardsBought int + Runes [11]int + SummonerIDs [2]int + TeamID int + TeamPosition string + VisionScore int + type PostgresSearchResult2 struct + Detail *RankDetail + Status *RankStatus + Summoner Summoner + func (m *PostgresSearchResult2) Convert() internal.SearchResult + type PostgresToRankStatus struct + Detail *RankDetail + Status RankStatus + func (mapper PostgresToRankStatus) Map() internal.RankStatus + type PostgresToSummonerMatchMapper struct + AfterDetail *RankDetail + AfterStatus *RankStatus + BeforeDetail *RankDetail + BeforeStatus *RankStatus + Match Match + Participant Participant + func (mapper PostgresToSummonerMatchMapper) Map() internal.SummonerMatch + type RankDetail struct + Division string + LP int + Losses int + RankStatusID int + Tier string + Wins int + type RankFull struct + Detail *RankDetail + Status RankStatus + type RankStatus struct + EffectiveDate time.Time + IsRanked bool + PUUID string + type RankStore struct + Tx Tx + func (db *RankStore) CreateRankDetail(ctx context.Context, detail RankDetail) error + func (db *RankStore) CreateRankStatus(ctx context.Context, status RankStatus) (id int, err error) + func (db *RankStore) GetRankDetail(ctx context.Context, id int) (RankDetail, error) + func (db *RankStore) GetRankStatus(ctx context.Context, id int) (status RankStatus, err error) + func (db *RankStore) ListRankIDs(ctx context.Context, puuid riot.PUUID, option ListRankOption) ([]int, error) + type Store struct + Pool *pgxpool.Pool + func (db *Store) GetChampions(ctx context.Context, puuid riot.PUUID, start, end time.Time) ([]internal.SummonerChampion, error) + func (db *Store) GetMatchDetail(ctx context.Context, id string) (_ internal.MatchDetail, err error) + func (db *Store) GetMatchHistory(ctx context.Context, puuid riot.PUUID, start, end time.Time) (matches []internal.SummonerMatch, err error) + func (db *Store) GetNewMatchIDs(ctx context.Context, ids []string) (newIDs []string, err error) + func (db *Store) GetProfileDetail(ctx context.Context, puuid riot.PUUID) (m internal.ProfileDetail, err error) + func (db *Store) RecordMatch(ctx context.Context, match internal.Match) error + func (db *Store) RecordProfile(ctx context.Context, summoner internal.Profile) error + func (db *Store) SearchSummoner(ctx context.Context, q string) ([]internal.SearchResult, error) + type Summoner struct + Name string + PUUID riot.PUUID + Tagline string + type SummonerStore struct + Tx Tx + func (db *SummonerStore) CreateSummoner(ctx context.Context, summoner Summoner) error + func (db *SummonerStore) GetSummoner(ctx context.Context, puuid riot.PUUID) (_ Summoner, err error) + func (db *SummonerStore) SearchSummoner(ctx context.Context, q string) ([]Summoner, error) + type Tx interface + Exec func(ctx context.Context, sql string, args ...any) (commandTag pgconn.CommandTag, err error) + Query func(ctx context.Context, sql string, args ...any) (pgx.Rows, error) + QueryRow func(ctx context.Context, sql string, args ...any) pgx.Row