Documentation ¶
Index ¶
- Variables
- func LiveMatchFromModel(m *models.LiveMatch) (*nspb.LiveMatch, error)
- func NewHero(h *models.Hero) *nspb.Hero
- func NewHeroMatches(hero *models.Hero, knownPlayers PlayersData, matchesData MatchesData) (*nspb.HeroMatches, error)
- func NewHeroes(heroes []*models.Hero) *nspb.Heroes
- func NewLeague(league *models.League) (*nspb.League, error)
- func NewLeagues(leagues []*models.League) (*nspb.Leagues, error)
- func NewLiveMatch(liveMatch *models.LiveMatch, stats *models.LiveMatchStats, ...) (*nspb.LiveMatch, error)
- func NewLiveMatchPlayer(followed *models.FollowedPlayer, player *models.Player, ...) *nspb.LiveMatch_Player
- func NewLiveMatches(liveMatches []*models.LiveMatch, stats map[nspb.MatchID]*models.LiveMatchStats, ...) (*nspb.LiveMatches, error)
- func NewMatch(data *MatchData) (*nspb.Match, error)
- func NewMatchPlayer(data *MatchPlayerData) (*nspb.Match_Player, error)
- func NewMatches(data MatchesData) ([]*nspb.Match, error)
- func NewPlayer(data *PlayerData) (*nspb.Player, error)
- func NewPlayerMatches(data *PlayerData, knownPlayers PlayersData, matchesData MatchesData) (*nspb.PlayerMatches, error)
- func NewPlayers(data PlayersData) ([]*nspb.Player, error)
- func NewSearch(heroes []*models.Hero, followed []*models.FollowedPlayer, ...) *nspb.Search
- func NewSearchPlayer(followed *models.FollowedPlayer, player *models.Player, ...) *nspb.Search_Player
- func NewSortedMatches(data MatchesData) ([]*nspb.Match, error)
- func NewSortedPlayers(data PlayersData) ([]*nspb.Player, error)
- func NewTeam(team *models.Team) *nspb.Team
- type ErrAssociationNotEagerLoaded
- type MatchData
- type MatchPlayerData
- type MatchPlayersData
- type MatchesData
- type PlayerData
- type PlayersData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingMatchID = errors.New("missing match ID") ErrInconsistentMatchIDs = errors.New("inconsistent match IDs") ErrMissingAccountID = errors.New("missing account ID") ErrInconsistentAccountIDs = errors.New("inconsistent account IDs") ErrMissingHeroID = errors.New("missing hero ID") )
Functions ¶
func NewHeroMatches ¶
func NewHeroMatches( hero *models.Hero, knownPlayers PlayersData, matchesData MatchesData, ) (*nspb.HeroMatches, error)
func NewLiveMatch ¶
func NewLiveMatchPlayer ¶
func NewLiveMatchPlayer( followed *models.FollowedPlayer, player *models.Player, proPlayer *models.ProPlayer, livePlayer *models.LiveMatchPlayer, statsPlayer *models.LiveMatchStatsPlayer, ) *nspb.LiveMatch_Player
func NewLiveMatches ¶
func NewMatchPlayer ¶
func NewMatchPlayer(data *MatchPlayerData) (*nspb.Match_Player, error)
func NewMatches ¶
func NewMatches(data MatchesData) ([]*nspb.Match, error)
func NewPlayerMatches ¶
func NewPlayerMatches( data *PlayerData, knownPlayers PlayersData, matchesData MatchesData, ) (*nspb.PlayerMatches, error)
func NewPlayers ¶
func NewPlayers(data PlayersData) ([]*nspb.Player, error)
func NewSearchPlayer ¶
func NewSearchPlayer( followed *models.FollowedPlayer, player *models.Player, proPlayer *models.ProPlayer, ) *nspb.Search_Player
func NewSortedMatches ¶
func NewSortedMatches(data MatchesData) ([]*nspb.Match, error)
func NewSortedPlayers ¶
func NewSortedPlayers(data PlayersData) ([]*nspb.Player, error)
Types ¶
type ErrAssociationNotEagerLoaded ¶
type ErrAssociationNotEagerLoaded struct {
Association string
}
func NewErrAssociationNotEagerLoaded ¶
func NewErrAssociationNotEagerLoaded(association string) *ErrAssociationNotEagerLoaded
func (*ErrAssociationNotEagerLoaded) Error ¶
func (err *ErrAssociationNotEagerLoaded) Error() string
type MatchData ¶
type MatchData struct { MatchID nspb.MatchID Match *models.Match LiveMatch *models.LiveMatch LiveMatchStats []*models.LiveMatchStats PlayersData MatchPlayersData }
func NewMatchData ¶
func NewMatchData( match *models.Match, liveMatch *models.LiveMatch, stats []*models.LiveMatchStats, playersData MatchPlayersData, ) *MatchData
func (*MatchData) AccountIDs ¶
func (d *MatchData) AccountIDs() nscol.AccountIDs
type MatchPlayerData ¶
type MatchPlayerData struct { MatchID nspb.MatchID AccountID nspb.AccountID MatchPlayer *models.MatchPlayer LiveMatchPlayer *models.LiveMatchPlayer LiveMatchStatsPlayers nscol.LiveMatchStatsPlayers }
func NewMatchPlayerData ¶
func NewMatchPlayerData( matchPlayer *models.MatchPlayer, livePlayer *models.LiveMatchPlayer, statsPlayers nscol.LiveMatchStatsPlayers, ) *MatchPlayerData
func (*MatchPlayerData) Validate ¶
func (d *MatchPlayerData) Validate() error
type MatchPlayersData ¶
type MatchPlayersData map[nspb.AccountID]*MatchPlayerData
func NewMatchPlayersData ¶
func NewMatchPlayersData(data ...*MatchPlayerData) (MatchPlayersData, error)
func (MatchPlayersData) Validate ¶
func (d MatchPlayersData) Validate() error
type MatchesData ¶
func NewMatchesData ¶
func NewMatchesData(data ...*MatchData) (MatchesData, error)
func (MatchesData) AccountIDs ¶
func (d MatchesData) AccountIDs() nscol.AccountIDs
func (MatchesData) MatchIDs ¶
func (d MatchesData) MatchIDs() nscol.MatchIDs
type PlayerData ¶
type PlayerData struct { AccountID nspb.AccountID FollowedPlayer *models.FollowedPlayer Player *models.Player ProPlayer *models.ProPlayer }
func NewPlayerData ¶
func NewPlayerData( followedPlayer *models.FollowedPlayer, player *models.Player, proPlayer *models.ProPlayer, ) *PlayerData
func (*PlayerData) Validate ¶
func (d *PlayerData) Validate() error
type PlayersData ¶
type PlayersData map[nspb.AccountID]*PlayerData
func NewPlayersData ¶
func NewPlayersData(playersData ...*PlayerData) (PlayersData, error)
Click to show internal directories.
Click to hide internal directories.