Documentation ¶
Index ¶
- Variables
- type APIError
- type BannedChampion
- type Champion
- type Champions
- type ChampionsDTO
- type Client
- type CurrentGameInfo
- type CurrentGameParticipant
- type DDragonClient
- type GameCustomizationObject
- type LoLStaticDataAPI
- type MasteryDTO
- type MatchAPI
- type MatchDTO
- type MatchListDTO
- type MatchReferenceDTO
- type Observer
- type ParticipantDTO
- type ParticipantIdentityDTO
- type ParticipantStatsDTO
- type ParticipantTimelineDTO
- type PerkStyle
- type Perks
- type PlayerDTO
- type Rune
- type RuneDTO
- type RunesReforged
- type RunesReforgedDTO
- type SpectatorAPI
- type SummonerAPI
- type SummonerDTO
- type TeamBansDTO
- type TeamStatsDTO
Constants ¶
This section is empty.
Variables ¶
var APIHosts = map[string]string{
"br": "br1.api.riotgames.com",
"eune": "eun1.api.riotgames.com",
"euw": "euw1.api.riotgames.com",
"jp": "jp1.api.riotgames.com",
"kr": "kr.api.riotgames.com",
"lan": "la1.api.riotgames.com",
"las": "la2.api.riotgames.com",
"na": "na1.api.riotgames.com",
"oce": "oc1.api.riotgames.com",
"tr": "tr1.api.riotgames.com",
"ru": "ru.api.riotgames.com",
"pbe": "pbe1.api.riotgames.com",
}
APIHosts is a map from regions to Riot hosts
Functions ¶
This section is empty.
Types ¶
type BannedChampion ¶
BannedChampion contains information about banned champions
type Champion ¶
type Champion struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Title string `json:"title,omitempty"` Key string `json:"key,omitempty"` }
Champion is the League of Legends champion
type ChampionsDTO ¶
type ChampionsDTO struct { Type string `json:"type,omitempty"` Version string `json:"version,omitempty"` Data map[string]Champion `json:"data,omitempty"` }
ChampionsDTO contains the Champions data
type Client ¶
type Client struct { Summoner SummonerAPI Spectator SpectatorAPI StaticData LoLStaticDataAPI Match MatchAPI // contains filtered or unexported fields }
Client is the http client used for sending the requests
type CurrentGameInfo ¶
type CurrentGameInfo struct { GameID int GameStartTime int PlatformID string GameMode string MapID int GameType string BannedChampions []BannedChampion Observers Observer Participants []CurrentGameParticipant GameLength int GameQueueConfigID int }
CurrentGameInfo represents a game in progress
type CurrentGameParticipant ¶
type CurrentGameParticipant struct { ProfileIconID int ChampionID int SummonerName string GameCustomizationObjects []GameCustomizationObject Bot bool Perks Perks Spell1ID int Spell2ID int TeamID int SummonerID int }
CurrentGameParticipant contains information about a participant
type DDragonClient ¶
type DDragonClient struct {
// contains filtered or unexported fields
}
DDragonClient fetches data from the ddragon
func NewDDragonClient ¶
func NewDDragonClient() *DDragonClient
NewDDragonClient creates a new client for DDragon
func (*DDragonClient) GetProfileIconURL ¶
func (c *DDragonClient) GetProfileIconURL(id int) string
GetProfileIconURL returns url to given profile icon
func (*DDragonClient) GetRunesReforged ¶
func (c *DDragonClient) GetRunesReforged() (*RunesReforged, error)
GetRunesReforged returns runes data
func (*DDragonClient) Request ¶
func (c *DDragonClient) Request(dataPath string, data interface{}) error
Request sends a new request to the given api endpoint and unmarshalls the response to given data
type GameCustomizationObject ¶
GameCustomizationObject contains information about game customization
type LoLStaticDataAPI ¶
type LoLStaticDataAPI struct {
// contains filtered or unexported fields
}
LoLStaticDataAPI implements the Riot LoL Static Data API methods
func (*LoLStaticDataAPI) Champions ¶
func (api *LoLStaticDataAPI) Champions() (*Champions, error)
Champions retrieves champion list lol/static-data/v3/champions
type MasteryDTO ¶
MasteryDTO contains information about layer masteries
type MatchAPI ¶
type MatchAPI struct {
// contains filtered or unexported fields
}
MatchAPI implements the Riot Match API methods
func (MatchAPI) RecentMatchesByAccountID ¶
func (api MatchAPI) RecentMatchesByAccountID(ID int) (*MatchListDTO, error)
RecentMatchesByAccountID gets matchlist for last 20 matches played on given account ID and platform ID.
type MatchDTO ¶
type MatchDTO struct { QueueID int GameID int ParticipantIdentities []ParticipantIdentityDTO GameVersion string PlatformID string GameMode string MapID int GameType string Teams []TeamStatsDTO Participants []ParticipantDTO GameDuration int GameCreation int // contains filtered or unexported fields }
MatchDTO contais all information of one match
type MatchListDTO ¶
type MatchListDTO struct { Matches []MatchReferenceDTO // contains filtered or unexported fields }
MatchListDTO contains list of match references
type MatchReferenceDTO ¶
type MatchReferenceDTO struct { Lane string GameID int Champion int PlatformID string Season int Queue int Role string TimeStamp int }
MatchReferenceDTO contains reference information about a match
type ParticipantDTO ¶
type ParticipantDTO struct { Stats ParticipantStatsDTO ParticipantID int Runes []RuneDTO Timeline ParticipantTimelineDTO TeamID int Spell1ID int Spell2ID int Masteries []MasteryDTO HighestAchievedSeasonTier string ChampionID int }
ParticipantDTO contains information about a game participant
type ParticipantIdentityDTO ¶
ParticipantIdentityDTO contains information about a participant
type ParticipantStatsDTO ¶
type ParticipantStatsDTO struct { PhysicalDamageDealt int NeutralMinionsKilledTeamJungle int MagicDamageDealt int TotalPlayerScore int Deaths int Win bool NeutralMinionsKilledEnemyJungle int AltarsCaptured int LargestCriticalStrike int TotalDamageDealt int MagicDamageDealtToChampion int VisionWardsBoughtInGame int DamageDealtToObjectives int LargestKillingSpree int Item int Item1 int Item2 int Item3 int Item4 int Item5 int Item6 int FirstBloodAssist bool VisionScore int WardsPlaced int TurretKills int TripleKills int DamageSelfMitigated int ChampLevel int NodeNeutralizeAssist int FirstInhibitorKill bool GoldEarned int MagicalDamageTaken int Kills int DoubleKills int NodeCaptureAssist bool TrueDamageTaken int NodeNeutralize int FirstInhibitorAssist bool Assists int UnrealKills int NeutralMinionsKilled int ObjectivePlayerScore int CombatPlayerScore int DamageDealtToTurrets int AltarsNeutralized int PhysicalDamageDealtToChampions int GoldSpent int TrueDamageDealt int TrueDamageDealtToChampions int ParticipantID int PentaKills int TotalHeal int TotalMinionsKilled int FirstBloodKill bool NodeCapture int LargestMultiKill int SightWardsBoughtInGame int TotalDamageDealtToChampions int TotalUnitsHealed int InhibitorKills int TotalScoreRank int TotalDamageTaken int KillingSprees int TimeCCingOthers int PhysicalDamageTaken int }
ParticipantStatsDTO contains information about the participants stats
type ParticipantTimelineDTO ¶
type ParticipantTimelineDTO struct { Lane string ParticipantID int CsDiffPerMinDeltas map[string]float64 GoldPerMinDeltas map[string]float64 XpDiffPerMinDelts map[string]float64 CreepsPerMinDeltas map[string]float64 XpPerMinDeltas map[string]float64 Role string DamageTakenDiffPerMinDeltas map[string]float64 DamageTakenPerMinDeltas map[string]float64 }
ParticipantTimelineDTO contains information about participants doings
type PlayerDTO ¶
type PlayerDTO struct { CurrentPlatformID string SummonerName string MatchHistoryURI string PlatformID string CurrentAccountID int ProfileIcon int SummonerID int AccountID int }
PlayerDTO contains information about the player
type RunesReforged ¶
RunesReforged contains the runes data in more usable form
func (*RunesReforged) AllRunes ¶
func (rr *RunesReforged) AllRunes() map[int]Rune
AllRunes returns all runes in a single map
type RunesReforgedDTO ¶
type RunesReforgedDTO []struct { ID int `json:"id"` Key string `json:"key"` Name string `json:"name"` Icon string `json:"icon"` Slots []struct { Runes []struct { ID int `json:"id"` Key string `json:"key"` Name string `json:"name"` ShortDesc string `json:"shortDesc"` LongDesc string `json:"longDesc"` Icon string `json:"icon"` } `json:"runes"` } `json:"slots"` }
RunesReforgedDTO contains the runes data as fetched from ddragon
func (RunesReforgedDTO) ToRunesReforged ¶
func (dtos RunesReforgedDTO) ToRunesReforged() *RunesReforged
ToRunesReforged converts DTO to RunesReforged
type SpectatorAPI ¶
type SpectatorAPI struct {
// contains filtered or unexported fields
}
SpectatorAPI implements the Riot Spectator API methods
func (SpectatorAPI) ActiveGamesBySummoner ¶
func (api SpectatorAPI) ActiveGamesBySummoner(id int) (*CurrentGameInfo, error)
ActiveGamesBySummoner gets current game information for the given summoner ID or nil, if there is no game
type SummonerAPI ¶
type SummonerAPI struct {
// contains filtered or unexported fields
}
SummonerAPI implements the Riot Summoner API methods
func (SummonerAPI) SummonerByID ¶
func (api SummonerAPI) SummonerByID(ID int) (*SummonerDTO, error)
SummonerByID gets a summoner by summoner id
func (SummonerAPI) SummonerByName ¶
func (api SummonerAPI) SummonerByName(name string) (*SummonerDTO, error)
SummonerByName gets a summoner by summoner name
type SummonerDTO ¶
type SummonerDTO struct { Name string ID int AccountID int SummonerLevel int ProfileIconID int RevisionDate int }
SummonerDTO represents a summoner
type TeamBansDTO ¶
TeamBansDTO contains the champion bans
type TeamStatsDTO ¶
type TeamStatsDTO struct { FirstDragon bool FirstInhibitor bool Bans []TeamBansDTO BaronKills int FirstRiftHerald bool FirstBaron bool RiftHeraldKills int FirstBlood bool TeamID int FirstTower bool VilemawKills int InhibitorKills int TowerKills int DominionVictoryScore int Win string DragonKills int }
TeamStatsDTO contains information about the team stats