Documentation
¶
Index ¶
- type AccountIDs
- type FollowedPlayers
- type HeroIDs
- type Heroes
- type LeagueIDs
- type Leagues
- type LiveMatchPlayers
- type LiveMatchStats
- type LiveMatchStatsPlayers
- type LiveMatches
- func (s LiveMatches) Batches(batchSize int) []LiveMatches
- func (s *LiveMatches) Insert(i int, liveMatch *models.LiveMatch)
- func (s LiveMatches) KeyByMatchID() map[nspb.MatchID]*models.LiveMatch
- func (s LiveMatches) Len() int
- func (s LiveMatches) MatchIDs() MatchIDs
- func (s *LiveMatches) Pop() (liveMatch *models.LiveMatch)
- func (s *LiveMatches) Push(liveMatch *models.LiveMatch)
- func (s *LiveMatches) Remove(i int) *models.LiveMatch
- func (s *LiveMatches) RemoveDeactivated() LiveMatches
- func (s *LiveMatches) Shift() (liveMatch *models.LiveMatch)
- func (s LiveMatches) Swap(i, j int)
- func (s *LiveMatches) Unshift(liveMatch *models.LiveMatch)
- type LiveMatchesByScore
- func (s *LiveMatchesByScore) Add(match *models.LiveMatch) int
- func (s *LiveMatchesByScore) All() LiveMatches
- func (s *LiveMatchesByScore) At(i int) *models.LiveMatch
- func (s *LiveMatchesByScore) FindIndex(matchID nspb.MatchID) int
- func (s *LiveMatchesByScore) Less(i, j int) bool
- func (s *LiveMatchesByScore) Remove(matchID nspb.MatchID) nspb.MatchID
- func (s *LiveMatchesByScore) SearchIndex(match *models.LiveMatch) int
- type LiveMatchesContainer
- type MatchIDs
- type MatchPlayers
- type Matches
- type Players
- type ProPlayers
- type TVGames
- func (s TVGames) Clean() TVGames
- func (s TVGames) FindIndexByMatchID(matchID nspb.MatchID) int
- func (s TVGames) GroupByMatchID() map[nspb.MatchID]TVGames
- func (s TVGames) MatchIDs() MatchIDs
- func (s TVGames) Pop() (TVGames, *d2pb.CSourceTVGameSmall)
- func (s TVGames) Remove(i int) (TVGames, *d2pb.CSourceTVGameSmall)
- func (s TVGames) RemoveByMatchID(matchID nspb.MatchID) (TVGames, *d2pb.CSourceTVGameSmall)
- func (s TVGames) Shift() (TVGames, *d2pb.CSourceTVGameSmall)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountIDs ¶
func (AccountIDs) AddUnique ¶
func (s AccountIDs) AddUnique(ids ...nspb.AccountID) AccountIDs
type FollowedPlayers ¶
type FollowedPlayers []*models.FollowedPlayer
func (FollowedPlayers) AccountIDs ¶
func (s FollowedPlayers) AccountIDs() AccountIDs
func (FollowedPlayers) KeyByAccountID ¶
func (s FollowedPlayers) KeyByAccountID() map[nspb.AccountID]*models.FollowedPlayer
type LiveMatchPlayers ¶
type LiveMatchPlayers []*models.LiveMatchPlayer
func (LiveMatchPlayers) AccountIDs ¶
func (s LiveMatchPlayers) AccountIDs() AccountIDs
func (LiveMatchPlayers) GroupByAccountID ¶
func (s LiveMatchPlayers) GroupByAccountID() map[nspb.AccountID]LiveMatchPlayers
func (LiveMatchPlayers) GroupByMatchID ¶
func (s LiveMatchPlayers) GroupByMatchID() map[nspb.MatchID]LiveMatchPlayers
func (LiveMatchPlayers) MatchIDs ¶
func (s LiveMatchPlayers) MatchIDs() MatchIDs
type LiveMatchStats ¶
type LiveMatchStats []*models.LiveMatchStats
func (LiveMatchStats) GroupByMatchID ¶
func (s LiveMatchStats) GroupByMatchID() map[nspb.MatchID]LiveMatchStats
func (LiveMatchStats) KeyByMatchID ¶
func (s LiveMatchStats) KeyByMatchID() map[nspb.MatchID]*models.LiveMatchStats
func (LiveMatchStats) MatchIDs ¶
func (s LiveMatchStats) MatchIDs() MatchIDs
type LiveMatchStatsPlayers ¶
type LiveMatchStatsPlayers []*models.LiveMatchStatsPlayer
func (LiveMatchStatsPlayers) AccountIDs ¶
func (s LiveMatchStatsPlayers) AccountIDs() AccountIDs
func (LiveMatchStatsPlayers) GroupByAccountID ¶
func (s LiveMatchStatsPlayers) GroupByAccountID() map[nspb.AccountID]LiveMatchStatsPlayers
func (LiveMatchStatsPlayers) GroupByMatchID ¶
func (s LiveMatchStatsPlayers) GroupByMatchID() map[nspb.MatchID]LiveMatchStatsPlayers
func (LiveMatchStatsPlayers) MatchIDs ¶
func (s LiveMatchStatsPlayers) MatchIDs() MatchIDs
type LiveMatches ¶
func (LiveMatches) Batches ¶
func (s LiveMatches) Batches(batchSize int) []LiveMatches
func (LiveMatches) KeyByMatchID ¶
func (s LiveMatches) KeyByMatchID() map[nspb.MatchID]*models.LiveMatch
func (LiveMatches) Len ¶
func (s LiveMatches) Len() int
func (LiveMatches) MatchIDs ¶
func (s LiveMatches) MatchIDs() MatchIDs
func (*LiveMatches) Pop ¶
func (s *LiveMatches) Pop() (liveMatch *models.LiveMatch)
func (*LiveMatches) Push ¶
func (s *LiveMatches) Push(liveMatch *models.LiveMatch)
func (*LiveMatches) RemoveDeactivated ¶
func (s *LiveMatches) RemoveDeactivated() LiveMatches
func (*LiveMatches) Shift ¶
func (s *LiveMatches) Shift() (liveMatch *models.LiveMatch)
func (LiveMatches) Swap ¶
func (s LiveMatches) Swap(i, j int)
func (*LiveMatches) Unshift ¶
func (s *LiveMatches) Unshift(liveMatch *models.LiveMatch)
type LiveMatchesByScore ¶
type LiveMatchesByScore struct { LiveMatches // contains filtered or unexported fields }
func NewLiveMatchesByScore ¶
func NewLiveMatchesByScore(matches ...*models.LiveMatch) *LiveMatchesByScore
func (*LiveMatchesByScore) Add ¶
func (s *LiveMatchesByScore) Add(match *models.LiveMatch) int
Add inserts a match in sorted order if it isn't present (matched by MatchID). If it's present, it updates the match (including SortScore, which will reposition the match) if the match changed.
It returns the match index if the match was added or updated, otherwise returns -1.
func (*LiveMatchesByScore) All ¶
func (s *LiveMatchesByScore) All() LiveMatches
func (*LiveMatchesByScore) FindIndex ¶
func (s *LiveMatchesByScore) FindIndex(matchID nspb.MatchID) int
FindIndex [O(n)] finds the index of a LiveMatch with the given matchID.
It returns -1 if the matchID was not found.
func (*LiveMatchesByScore) Less ¶
func (s *LiveMatchesByScore) Less(i, j int) bool
func (*LiveMatchesByScore) Remove ¶
func (s *LiveMatchesByScore) Remove(matchID nspb.MatchID) nspb.MatchID
func (*LiveMatchesByScore) SearchIndex ¶
func (s *LiveMatchesByScore) SearchIndex(match *models.LiveMatch) int
SearchIndex [O(log n)] performs a binary search for an index where the given match is or would be in sorted order by SortScore.
It returns Len() if the match was not found.
type LiveMatchesContainer ¶
type LiveMatchesContainer struct {
// contains filtered or unexported fields
}
func NewLiveMatchesContainer ¶
func NewLiveMatchesContainer(matches ...*models.LiveMatch) *LiveMatchesContainer
func (*LiveMatchesContainer) Add ¶
func (m *LiveMatchesContainer) Add(matches ...*models.LiveMatch) LiveMatches
func (*LiveMatchesContainer) All ¶
func (m *LiveMatchesContainer) All() LiveMatches
func (*LiveMatchesContainer) Len ¶
func (m *LiveMatchesContainer) Len() int
type MatchIDs ¶
func NewMatchIDs ¶
func NewMatchIDsFromString ¶
func (MatchIDs) ToUint64Interfaces ¶
func (s MatchIDs) ToUint64Interfaces() []interface{}
type MatchPlayers ¶
type MatchPlayers []*models.MatchPlayer
func (MatchPlayers) AccountIDs ¶
func (s MatchPlayers) AccountIDs() AccountIDs
func (MatchPlayers) GroupByAccountID ¶
func (s MatchPlayers) GroupByAccountID() map[nspb.AccountID]MatchPlayers
func (MatchPlayers) GroupByMatchID ¶
func (s MatchPlayers) GroupByMatchID() map[nspb.MatchID]MatchPlayers
func (MatchPlayers) MatchIDs ¶
func (s MatchPlayers) MatchIDs() MatchIDs
type Players ¶
func (Players) AccountIDs ¶
func (s Players) AccountIDs() AccountIDs
type ProPlayers ¶
func (ProPlayers) AccountIDs ¶
func (s ProPlayers) AccountIDs() AccountIDs
func (ProPlayers) GroupByAccountID ¶
func (s ProPlayers) GroupByAccountID() map[nspb.AccountID]ProPlayers
func (ProPlayers) KeyByAccountID ¶
func (s ProPlayers) KeyByAccountID() map[nspb.AccountID]*models.ProPlayer
type TVGames ¶
type TVGames []*d2pb.CSourceTVGameSmall
func (TVGames) Clean ¶
Clean cleans up Source TV games.
* Removes nil games * Removes games with invalid MatchId (zero) * De-duplicates games with same MatchId
De-duplication: elects the game with highest LastUpdateTime as the valid entry. Elected entries are placed in the same position as the first occurrence of duplicated entries.
It returns the slice sorted by descending SortScore.