Documentation ¶
Index ¶
- Constants
- Variables
- func GetRankedQueues() []int
- func NormalizeGameName(summonerName string) string
- func NormalizeGameNames(summonerNames ...string) []string
- func SetAPIKey(key string)
- func SetLongRateLimit(numrequests int, pertime time.Duration)
- func SetShortRateLimit(numrequests int, pertime time.Duration)
- type HttpError
- type Mastery
- type Match
- type MatchReference
- type Matchlist
- type Participant
- type ParticipantIdentity
- type ParticipantStats
- type ParticipantTimeline
- type Player
- type Rune
- type Summoner
- type TeamBans
- type TeamStats
Constants ¶
const ( SoloQueue = 420 FlexQueue = 440 )
Variables ¶
var ( BaseURL string = "api.riotgames.com/lol" //ErrAPIKeyNotSet is the error returned when no global API key has been set ErrAPIKeyNotSet = errors.New("rgapi: API key has not been set. If you need a key visit https://developer.riotgames.com/") )
Functions ¶
func GetRankedQueues ¶
func GetRankedQueues() []int
func NormalizeGameName ¶
NormalizeGameName takes an arbitrary number of strings and returns a string array containing the strings standardized to league of legends internal standard (lowecase and strings removed)
func NormalizeGameNames ¶
NormalizeGameName takes an arbitrary number of strings and returns a string array containing the strings standardized to league of legends internal standard (lowecase and strings removed)
func SetLongRateLimit ¶
SetLongRateLimit allows a custom rate limit to be set. For at the time of this writing the default for a development API key is 500 requests every 10 minutes
func SetShortRateLimit ¶
SetShortRateLimit allows a custom rate limit to be set. For at the time of this writing the default for a development API key is 10 requests every 10 seconds
Types ¶
type HttpError ¶
type HttpError struct {
StatusCode int
}
HttpError contains the http status code of the erro
type Match ¶
type Match struct { SeasonId int `json:"seasonId"` QueueId int `json:"queueId"` GameId int64 `json:"gameId"` ParticipantIdentities []ParticipantIdentity `json:"participantIdentities"` GameVersion string `json:"gameVersion"` PlatformId string `json:"platformId"` GameMode string `json:"gameMode"` MapId int `json:"mapId"` GameType string `json:"gameType"` Teams []TeamStats `json:"teams"` Participants []Participant `json:"participants"` GameDuration int64 `json:"gameDuration"` GameCreation int64 `json:"gameCreation"` }
type MatchReference ¶
type Matchlist ¶
type Matchlist struct { Matches []MatchReference `json:"matches"` TotalGames int `json:"totalGames"` StartIndex int `json:"startIndex"` EndIndex int `json:"endIndex"` }
type Participant ¶
type Participant struct { Stats ParticipantStats `json:"stats"` ParticipantId int `json:"participantId"` Runes []Rune `json:"runes"` Timeline ParticipantTimeline `json:"timeline"` TeamId int `json:"teamId"` Spell2Id int `json:"spell2Id"` Masteries []Mastery `json:"masteries"` HighestAchievedSeasonTier string `json:"highestAchievedSeasonTier"` Spell1Id int `json:"spell1Id"` ChampionId int `json:"championId"` }
type ParticipantIdentity ¶
type ParticipantStats ¶
type ParticipantStats struct { PhysicalDamageDealt int64 `json:"physicalDamageDealt"` NeutralMinionsKilledTeamJungle int `json:"neutralMinionsKilledTeamJungle"` MagicDamageDealt int64 `json:"magicDamageDealt"` TotalPlayerScore int `json:"totalPlayerScore"` Deaths int `json:"deaths"` Win bool `json:"win"` NeutralMinionsKilledEnemyJungle int `json:"neutralMinionsKilledEnemyJungle"` AltarsCaptured int `json:"altarsCaptured"` LargestCriticalStrike int `json:"largestCriticalStrike"` TotalDamageDealt int64 `json:"totalDamageDealt"` MagicDamageDealtToChampions int64 `json:"magicDamageDealtToChampions"` VisionWardsBoughtInGame int `json:"visionWardsBoughtInGame"` DamageDealtToObjectives int64 `json:"damageDealtToObjectives"` LargestKillingSpree int `json:"largestKillingSpree"` Item1 int `json:"item1"` QuadraKills int `json:"quadraKills"` TeamObjective int `json:"teamObjective"` TotalTimeCrowdControlDealt int `json:"totalTimeCrowdControlDealt"` LongestTimeSpentLiving int `json:"longestTimeSpentLiving"` WardsKilled int `json:"wardsKilled"` FirstTowerAssist bool `json:"firstTowerAssist"` FirstTowerKill bool `json:"firstTowerKill"` Item2 int `json:"item2"` Item3 int `json:"item3"` Item0 int `json:"item0"` FirstBloodAssist bool `json:"firstBloodAssist"` VisionScore int64 `json:"visionScore"` WardsPlaced int `json:"wardsPlaced"` Item4 int `json:"item4"` Item5 int `json:"item5"` Item6 int `json:"item6"` TurretKills int `json:"turretKills"` TripleKills int `json:"tripleKills"` DamageSelfMitigated int64 `json:"damageSelfMitigated"` ChampLevel int `json:"champLevel"` NodeNeutralizeAssist int `json:"nodeNeutralizeAssist"` FirstInhibitorKill bool `json:"firstInhibitorKill"` GoldEarned int `json:"goldEarned"` MagicalDamageTaken int64 `json:"magicalDamageTaken"` Kills int `json:"kills"` DoubleKills int `json:"doubleKills"` NodeCaptureAssist int `json:"nodeCaptureAssist"` TrueDamageTaken int64 `json:"trueDamageTaken"` NodeNeutralize int `json:"nodeNeutralize"` FirstInhibitorAssist bool `json:"firstInhibitorAssist"` Assists int `json:"assists"` UnrealKills int `json:"unrealKills"` NeutralMinionsKilled int `json:"neutralMinionsKilled"` ObjectivePlayerScore int `json:"objectivePlayerScore"` CombatPlayerScore int `json:"combatPlayerScore"` DamageDealtToTurrets int64 `json:"damageDealtToTurrets"` AltarsNeutralized int `json:"altarsNeutralized"` PhysicalDamageDealtToChampions int64 `json:"physicalDamageDealtToChampions"` GoldSpent int `json:"goldSpent"` TrueDamageDealt int64 `json:"trueDamageDealt"` TrueDamageDealtToChampions int64 `json:"trueDamageDealtToChampions"` ParticipantId int `json:"participantId"` PentaKills int `json:"pentaKills"` TotalHeal int64 `json:"totalHeal"` TotalMinionsKilled int `json:"totalMinionsKilled"` FirstBloodKill bool `json:"firstBloodKill"` NodeCapture int `json:"nodeCapture"` LargestMultiKill int `json:"largestMultiKill"` SightWardsBoughtInGame int `json:"sightWardsBoughtInGame"` TotalDamageDealtToChampions int64 `json:"totalDamageDealtToChampions"` TotalUnitsHealed int `json:"totalUnitsHealed"` InhibitorKills int `json:"inhibitorKills"` TotalScoreRank int `json:"totalScoreRank"` TotalDamageTaken int64 `json:"totalDamageTaken"` KillingSprees int `json:"killingSprees"` TimeCCingOthers int64 `json:"timeCCingOthers"` PhysicalDamageTaken int64 `json:"physicalDamageTaken"` }
type ParticipantTimeline ¶
type ParticipantTimeline struct { Lane string `json:"lane"` ParticipantId int `json:"participantId"` CsDiffPerMinDeltas map[string]float64 `json:"csDiffPerMinDeltas"` GoldPerMinDeltas map[string]float64 `json:"goldPerMinDeltas"` XpDiffPerMinDeltas map[string]float64 `json:"xpDiffPerMinDeltas"` CreepsPerMinDeltas map[string]float64 `json:"creepsPerMinDeltas"` XpPerMinDeltas map[string]float64 `json:"xpPerMinDeltas"` Role string `json:"role"` DamageTakenDiffPerMinDeltas map[string]float64 `json:"damageTakenDiffPerMinDeltas"` DamageTakenPerMinDeltas map[string]float64 `json:"damageTakenPerMinDeltas"` }
type Player ¶
type Player struct { CurrentPlatformId string `json:"currentPlatformId"` SummonerName string `json:"summonerName"` MatchHistoryUri string `json:"matchHistoryUri"` PlatformId string `json:"platformId"` CurrentAccountId int64 `json:"currentAccountId"` ProfileIcon int `json:"profileIcon"` SummonerId int64 `json:"summonerId"` AccountId int64 `json:"accountId"` }
type Summoner ¶
type Summoner struct { ProfileIconId int `json:"profileIconId"` Name string `json:"name"` SummonerLevel int `json:"summonerLevel"` AccountId int64 `json:"accountId"` SummonerId int64 `json:"id"` RevisionDate int64 `json:"revisionDate"` }
Summoner is a player of League of Legends
func SummonerByName ¶
SummonerByName retrieves the summoner information of the provided summoner names from Riot Games API. It returns a Map of Summoner with the key being the summoner name and any errors that occured from the server The global API key must be set before use WARNING: The map's key is not necessarily the same string used in the request. It is recommended to use NormalizeGameName before calling this function
type TeamStats ¶
type TeamStats struct { FirstDragon bool `json:"firstDragon"` FirstInhibitor bool `json:"firstInhibitor"` Bans []TeamBans `json:"bans"` BaronKills int `json:"baronKills"` FirstRiftHerald bool `json:"firstRiftHerald"` FirstBaron bool `json:"firstBaron"` RiftHeraldKills int `json:"riftHeraldKills"` FirstBlood bool `json:"firstBlood"` TeamId int `json:"teamId"` FirstTower bool `json:"firstTower"` VilemawKills int `json:"vilemawKills"` InhibitorKills int `json:"inhibitorKills"` TowerKills int `json:"towerKills"` DominionVictoryScore int `json:"dominionVictoryScore"` Win string `json:"win"` DragonKills int `json:"dragonKills"` }