Documentation
¶
Index ¶
- Constants
- type ChampionEndpoint
- type ChampionMasteryDTO
- type ChampionMasteryEndpoint
- func (c *ChampionMasteryEndpoint) BySummonerID(region api.LOLRegion, summonerID string) (*[]ChampionMasteryDTO, error)
- func (c *ChampionMasteryEndpoint) ChampionScore(region api.LOLRegion, summonerID string, championID int) (*ChampionMasteryDTO, error)
- func (c *ChampionMasteryEndpoint) MasteryScore(region api.LOLRegion, summonerID string) (int, error)
- type ChampionRotationsDTO
- type CurrentGameInfoDTO
- type FeaturedGamesDTO
- type LOLClient
- type LOLMatchType
- type MatchDTO
- type MatchEndpoint
- type MatchTimelineDTO
- type MatchlistOptions
- type PlatformDataDTO
- type SpectatorEndpoint
- type StatusEndpoint
- type SummonerDTO
- type SummonerEndpoint
- func (c *SummonerEndpoint) ByAccountID(region api.LOLRegion, accountID string) (*SummonerDTO, error)
- func (c *SummonerEndpoint) ByID(region api.LOLRegion, summonerID string) (*SummonerDTO, error)
- func (c *SummonerEndpoint) ByName(region api.LOLRegion, summonerName string) (*SummonerDTO, error)
- func (c *SummonerEndpoint) ByPUUID(region api.LOLRegion, PUUID string) (*SummonerDTO, error)
Constants ¶
const ( ChampionURL = "/lol/platform/v3/champion-rotations" ChampionMasteriesURL = "/lol/champion-mastery/v4/champion-masteries/by-summoner/%s" ChampionMasteriesByChampionURL = "/lol/champion-mastery/v4/champion-masteries/by-summoner/%s/by-champion/%d" ChampionMasteriesScoresURL = "/lol/champion-mastery/v4/scores/by-summoner/%s" StatusURL = "/lol/status/v4/platform-data" MatchlistURL = "/lol/match/v5/matches/by-puuid/%s/ids" MatchURL = "/lol/match/v5/matches/%s" MatchTimelineURL = "/lol/match/v5/matches/%s/timeline" SpectatorURL = "/lol/spectator/v4/featured-games" SpectatorCurrentGameURL = "/lol/spectator/v4/active-games/by-summoner/%s" SummonerByAccountIDURL = "/lol/summoner/v4/summoners/by-account/%s" SummonerByNameURL = "/lol/summoner/v4/summoners/by-name/%s" SummonerByPUUIDURL = "/lol/summoner/v4/summoners/by-puuid/%s" SummonerByID = "/lol/summoner/v4/summoners/%s" )
League of Legends endpoints URLs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChampionEndpoint ¶
type ChampionEndpoint struct {
// contains filtered or unexported fields
}
func (*ChampionEndpoint) Rotations ¶ added in v0.4.0
func (c *ChampionEndpoint) Rotations(region api.LOLRegion) (*ChampionRotationsDTO, error)
Get champion rotations, including free-to-play and low-level free-to-play rotations.
type ChampionMasteryDTO ¶ added in v0.4.0
type ChampionMasteryDTO struct {
ChampionID int `json:"championId"`
ChampionLevel int `json:"championLevel"`
ChampionPoints int `json:"championPoints"`
LastPlayTime time.Time `json:"lastPlayTime"`
ChampionPointsSinceLastLevel int `json:"championPointsSinceLastLevel"`
ChampionPointsUntilNextLevel int `json:"championPointsUntilNextLevel"`
ChestGranted bool `json:"chestGranted"`
TokensEarned int `json:"tokensEarned"`
SummonerID string `json:"summonerId"`
}
type ChampionMasteryEndpoint ¶ added in v0.4.0
type ChampionMasteryEndpoint struct {
// contains filtered or unexported fields
}
func (*ChampionMasteryEndpoint) BySummonerID ¶ added in v0.4.0
func (c *ChampionMasteryEndpoint) BySummonerID(region api.LOLRegion, summonerID string) (*[]ChampionMasteryDTO, error)
Get all champion mastery entries sorted by number of champion points descending.
func (*ChampionMasteryEndpoint) ChampionScore ¶ added in v0.4.0
func (c *ChampionMasteryEndpoint) ChampionScore(region api.LOLRegion, summonerID string, championID int) (*ChampionMasteryDTO, error)
Get a champion mastery by player ID and champion ID.
func (*ChampionMasteryEndpoint) MasteryScore ¶ added in v0.4.0
func (c *ChampionMasteryEndpoint) MasteryScore(region api.LOLRegion, summonerID string) (int, error)
Get a player's total champion mastery score, which is the sum of individual champion mastery levels.
type ChampionRotationsDTO ¶ added in v0.4.0
type CurrentGameInfoDTO ¶ added in v0.4.0
type CurrentGameInfoDTO struct {
GameID int `json:"gameId"`
MapID int `json:"mapId"`
GameMode string `json:"gameMode"`
GameType string `json:"gameType"`
GameQueueConfigID int `json:"gameQueueConfigId"`
Participants []struct {
TeamID int `json:"teamId"`
Spell1ID int `json:"spell1Id"`
Spell2ID int `json:"spell2Id"`
ChampionID int `json:"championId"`
ProfileIconID int `json:"profileIconId"`
SummonerName string `json:"summonerName"`
Bot bool `json:"bot"`
SummonerID string `json:"summonerId"`
GameCustomizationObjects []struct {
Category string `json:"category"`
Content string `json:"content"`
} `json:"gameCustomizationObjects"`
Perks struct {
PerkIDs []int `json:"perkIds"`
PerkStyle int `json:"perkStyle"`
PerkSubStyle int `json:"perkSubStyle"`
} `json:"perks"`
} `json:"participants"`
Observers struct {
EncryptionKey string `json:"encryptionKey"`
} `json:"observers"`
PlatformID string `json:"platformId"`
BannedChampions []struct {
ChampionID int `json:"championId"`
TeamID int `json:"teamId"`
PickTurn int `json:"pickTurn"`
} `json:"bannedChampions"`
GameStartTime int `json:"gameStartTime"`
GameLength int `json:"gameLength"`
}
type FeaturedGamesDTO ¶ added in v0.3.0
type FeaturedGamesDTO struct {
GameList []struct {
GameID int `json:"gameId"`
MapID int `json:"mapId"`
GameMode string `json:"gameMode"`
GameType string `json:"gameType"`
GameQueueConfigID int `json:"gameQueueConfigId"`
Participants []struct {
TeamID int `json:"teamId"`
Spell1ID int `json:"spell1Id"`
Spell2ID int `json:"spell2Id"`
ChampionID int `json:"championId"`
ProfileIconID int `json:"profileIconId"`
SummonerName string `json:"summonerName"`
Bot bool `json:"bot"`
} `json:"participants"`
Observers struct {
EncryptionKey string `json:"encryptionKey"`
} `json:"observers"`
PlatformID string `json:"platformId"`
BannedChampions []struct {
ChampionID int `json:"championId"`
TeamID int `json:"teamId"`
PickTurn int `json:"pickTurn"`
} `json:"bannedChampions"`
GameStartTime int `json:"gameStartTime"`
GameLength int `json:"gameLength"`
} `json:"gameList"`
ClientRefreshInterval int `json:"clientRefreshInterval"`
}
type LOLClient ¶
type LOLClient struct {
Champion *ChampionEndpoint
ChampionMasteries *ChampionMasteryEndpoint
Match *MatchEndpoint
Status *StatusEndpoint
Spectator *SpectatorEndpoint
Summoner *SummonerEndpoint
// contains filtered or unexported fields
}
func NewLOLClient ¶
func NewLOLClient(client *internal.InternalClient) *LOLClient
Creates a new LOLClient using an InternalClient provided.
type LOLMatchType ¶ added in v0.5.1
type LOLMatchType string
const ( RankedMatchType LOLMatchType = "ranked" NormalMatchType LOLMatchType = "normal" TourneyMatchType LOLMatchType = "tourney" TutorialMatchType LOLMatchType = "tutorial" )
type MatchDTO ¶ added in v0.4.0
type MatchDTO struct {
Metadata struct {
DataVersion string `json:"dataVersion"`
MatchID string `json:"matchId"`
Participants []string `json:"participants"`
} `json:"metadata"`
Info struct {
GameCreation time.Time `json:"gameCreation"`
GameDuration int `json:"gameDuration"`
GameEndTimestamp time.Time `json:"gameEndTimestamp"`
GameID int `json:"gameId"`
GameMode string `json:"gameMode"`
GameName string `json:"gameName"`
GameStartTimestamp time.Time `json:"gameStartTimestamp"`
GameType string `json:"gameType"`
GameVersion string `json:"gameVersion"`
MapID int `json:"mapId"`
Participants []struct {
Assists int `json:"assists"`
BaronKills int `json:"baronKills"`
BountyLevel int `json:"bountyLevel"`
ChampExperience int `json:"champExperience"`
ChampLevel int `json:"champLevel"`
ChampionID int `json:"championId"`
ChampionName string `json:"championName"`
ChampionTransform int `json:"championTransform"`
ConsumablesPurchased int `json:"consumablesPurchased"`
DamageDealtToBuildings int `json:"damageDealtToBuildings"`
DamageDealtToObjectives int `json:"damageDealtToObjectives"`
DamageDealtToTurrets int `json:"damageDealtToTurrets"`
DamageSelfMitigated int `json:"damageSelfMitigated"`
Deaths int `json:"deaths"`
DetectorWardsPlaced int `json:"detectorWardsPlaced"`
DoubleKills int `json:"doubleKills"`
DragonKills int `json:"dragonKills"`
EligibleForProgression bool `json:"eligibleForProgression"`
FirstBloodAssist bool `json:"firstBloodAssist"`
FirstBloodKill bool `json:"firstBloodKill"`
FirstTowerAssist bool `json:"firstTowerAssist"`
FirstTowerKill bool `json:"firstTowerKill"`
GameEndedInEarlySurrender bool `json:"gameEndedInEarlySurrender"`
GameEndedInSurrender bool `json:"gameEndedInSurrender"`
GoldEarned int `json:"goldEarned"`
GoldSpent int `json:"goldSpent"`
IndividualPosition string `json:"individualPosition"`
InhibitorKills int `json:"inhibitorKills"`
InhibitorTakedowns int `json:"inhibitorTakedowns"`
InhibitorsLost int `json:"inhibitorsLost"`
Item0 int `json:"item0"`
Item1 int `json:"item1"`
Item2 int `json:"item2"`
Item3 int `json:"item3"`
Item4 int `json:"item4"`
Item5 int `json:"item5"`
Item6 int `json:"item6"`
ItemsPurchased int `json:"itemsPurchased"`
KillingSprees int `json:"killingSprees"`
Kills int `json:"kills"`
Lane string `json:"lane"`
LargestCriticalStrike int `json:"largestCriticalStrike"`
LargestKillingSpree int `json:"largestKillingSpree"`
LargestMultiKill int `json:"largestMultiKill"`
LongestTimeSpentLiving int `json:"longestTimeSpentLiving"`
MagicDamageDealt int `json:"magicDamageDealt"`
MagicDamageDealtToChampions int `json:"magicDamageDealtToChampions"`
MagicDamageTaken int `json:"magicDamageTaken"`
NeutralMinionsKilled int `json:"neutralMinionsKilled"`
NexusKills int `json:"nexusKills"`
NexusLost int `json:"nexusLost"`
NexusTakedowns int `json:"nexusTakedowns"`
ObjectivesStolen int `json:"objectivesStolen"`
ObjectivesStolenAssists int `json:"objectivesStolenAssists"`
ParticipantID int `json:"participantId"`
PentaKills int `json:"pentaKills"`
Perks struct {
StatPerks struct {
Defense int `json:"defense"`
Flex int `json:"flex"`
Offense int `json:"offense"`
} `json:"statPerks"`
Styles []struct {
Description string `json:"description"`
Selections []struct {
Perk int `json:"perk"`
Var1 int `json:"var1"`
Var2 int `json:"var2"`
Var3 int `json:"var3"`
} `json:"selections"`
Style int `json:"style"`
} `json:"styles"`
} `json:"perks"`
PhysicalDamageDealt int `json:"physicalDamageDealt"`
PhysicalDamageDealtToChampions int `json:"physicalDamageDealtToChampions"`
PhysicalDamageTaken int `json:"physicalDamageTaken"`
ProfileIcon int `json:"profileIcon"`
Puuid string `json:"puuid"`
QuadraKills int `json:"quadraKills"`
RiotIDName string `json:"riotIdName"`
RiotIDTagline string `json:"riotIdTagline"`
Role string `json:"role"`
SightWardsBoughtInGame int `json:"sightWardsBoughtInGame"`
Spell1Casts int `json:"spell1Casts"`
Spell2Casts int `json:"spell2Casts"`
Spell3Casts int `json:"spell3Casts"`
Spell4Casts int `json:"spell4Casts"`
Summoner1Casts int `json:"summoner1Casts"`
Summoner1ID int `json:"summoner1Id"`
Summoner2Casts int `json:"summoner2Casts"`
Summoner2ID int `json:"summoner2Id"`
SummonerID string `json:"summonerId"`
SummonerLevel int `json:"summonerLevel"`
SummonerName string `json:"summonerName"`
TeamEarlySurrendered bool `json:"teamEarlySurrendered"`
TeamID int `json:"teamId"`
TeamPosition string `json:"teamPosition"`
TimeCCingOthers int `json:"timeCCingOthers"`
TimePlayed int `json:"timePlayed"`
TotalDamageDealt int `json:"totalDamageDealt"`
TotalDamageDealtToChampions int `json:"totalDamageDealtToChampions"`
TotalDamageShieldedOnTeammates int `json:"totalDamageShieldedOnTeammates"`
TotalDamageTaken int `json:"totalDamageTaken"`
TotalHeal int `json:"totalHeal"`
TotalHealsOnTeammates int `json:"totalHealsOnTeammates"`
TotalMinionsKilled int `json:"totalMinionsKilled"`
TotalTimeCCDealt int `json:"totalTimeCCDealt"`
TotalTimeSpentDead int `json:"totalTimeSpentDead"`
TotalUnitsHealed int `json:"totalUnitsHealed"`
TripleKills int `json:"tripleKills"`
TrueDamageDealt int `json:"trueDamageDealt"`
TrueDamageDealtToChampions int `json:"trueDamageDealtToChampions"`
TrueDamageTaken int `json:"trueDamageTaken"`
TurretKills int `json:"turretKills"`
TurretTakedowns int `json:"turretTakedowns"`
TurretsLost int `json:"turretsLost"`
UnrealKills int `json:"unrealKills"`
VisionScore int `json:"visionScore"`
VisionWardsBoughtInGame int `json:"visionWardsBoughtInGame"`
WardsKilled int `json:"wardsKilled"`
WardsPlaced int `json:"wardsPlaced"`
Win bool `json:"win"`
} `json:"participants"`
PlatformID string `json:"platformId"`
QueueID int `json:"queueId"`
Teams []struct {
Bans []interface{} `json:"bans"`
Objectives struct {
Baron struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"baron"`
Champion struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"champion"`
Dragon struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"dragon"`
Inhibitor struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"inhibitor"`
RiftHerald struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"riftHerald"`
Tower struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"tower"`
} `json:"objectives"`
TeamID int `json:"teamId"`
Win bool `json:"win"`
} `json:"teams"`
TournamentCode string `json:"tournamentCode"`
} `json:"info"`
}
type MatchEndpoint ¶ added in v0.4.0
type MatchEndpoint struct {
// contains filtered or unexported fields
}
func (*MatchEndpoint) ListByPUUID ¶ added in v0.5.1
func (c *MatchEndpoint) ListByPUUID(region api.Route, PUUID string, options *MatchlistOptions) ([]string, error)
Get a list of match IDs by PUUID.
func (*MatchEndpoint) Timeline ¶ added in v0.4.0
func (c *MatchEndpoint) Timeline(region api.Route, matchID string) (*MatchTimelineDTO, error)
Get a match timeline by match ID.
type MatchTimelineDTO ¶ added in v0.4.0
type MatchTimelineDTO struct {
Metadata struct {
DataVersion string `json:"dataVersion"`
MatchID string `json:"matchId"`
Participants []string `json:"participants"`
} `json:"metadata"`
Info struct {
FrameInterval int `json:"frameInterval"`
Frames []struct {
Events []struct {
RealTimestamp time.Time `json:"realTimestamp"`
Timestamp int `json:"timestamp"`
Type string `json:"type"`
} `json:"events"`
ParticipantFrames struct {
Num1 struct {
ChampionStats struct {
AbilityHaste int `json:"abilityHaste"`
AbilityPower int `json:"abilityPower"`
Armor int `json:"armor"`
ArmorPen int `json:"armorPen"`
ArmorPenPercent int `json:"armorPenPercent"`
AttackDamage int `json:"attackDamage"`
AttackSpeed int `json:"attackSpeed"`
BonusArmorPenPercent int `json:"bonusArmorPenPercent"`
BonusMagicPenPercent int `json:"bonusMagicPenPercent"`
CcReduction int `json:"ccReduction"`
CooldownReduction int `json:"cooldownReduction"`
Health int `json:"health"`
HealthMax int `json:"healthMax"`
HealthRegen int `json:"healthRegen"`
Lifesteal int `json:"lifesteal"`
MagicPen int `json:"magicPen"`
MagicPenPercent int `json:"magicPenPercent"`
MagicResist int `json:"magicResist"`
MovementSpeed int `json:"movementSpeed"`
Omnivamp int `json:"omnivamp"`
PhysicalVamp int `json:"physicalVamp"`
Power int `json:"power"`
PowerMax int `json:"powerMax"`
PowerRegen int `json:"powerRegen"`
SpellVamp int `json:"spellVamp"`
} `json:"championStats"`
CurrentGold int `json:"currentGold"`
DamageStats struct {
MagicDamageDone int `json:"magicDamageDone"`
MagicDamageDoneToChampions int `json:"magicDamageDoneToChampions"`
MagicDamageTaken int `json:"magicDamageTaken"`
PhysicalDamageDone int `json:"physicalDamageDone"`
PhysicalDamageDoneToChampions int `json:"physicalDamageDoneToChampions"`
PhysicalDamageTaken int `json:"physicalDamageTaken"`
TotalDamageDone int `json:"totalDamageDone"`
TotalDamageDoneToChampions int `json:"totalDamageDoneToChampions"`
TotalDamageTaken int `json:"totalDamageTaken"`
TrueDamageDone int `json:"trueDamageDone"`
TrueDamageDoneToChampions int `json:"trueDamageDoneToChampions"`
TrueDamageTaken int `json:"trueDamageTaken"`
} `json:"damageStats"`
GoldPerSecond int `json:"goldPerSecond"`
JungleMinionsKilled int `json:"jungleMinionsKilled"`
Level int `json:"level"`
MinionsKilled int `json:"minionsKilled"`
ParticipantID int `json:"participantId"`
Position struct {
X int `json:"x"`
Y int `json:"y"`
} `json:"position"`
TimeEnemySpentControlled int `json:"timeEnemySpentControlled"`
TotalGold int `json:"totalGold"`
Xp int `json:"xp"`
} `json:"1"`
} `json:"participantFrames"`
Timestamp int `json:"timestamp"`
} `json:"frames"`
GameID int `json:"gameId"`
Participants []struct {
ParticipantID int `json:"participantId"`
PUUID string `json:"puuid"`
} `json:"participants"`
} `json:"info"`
}
type MatchlistOptions ¶ added in v0.4.0
type MatchlistOptions struct {
// The matchlist started storing timestamps on June 16th, 2021.
// Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set.
StartTime int `json:"startTime"`
// Epoch timestamp in seconds.
EndTime int `json:"endTime"`
// Filter the list of match ids by a specific queue id.
// This filter is mutually inclusive of the type filter meaning any match ids returned must match both the queue and type filters.
Queue int `json:"queue"`
// Filter the list of match ids by the type of match.
// This filter is mutually inclusive of the queue filter meaning any match ids returned must match both the queue and type filters.
Type LOLMatchType `json:"type"`
// Defaults to 0. Start index.
Start int `json:"start"`
// Defaults to 20. Valid values: 0 to 100. Number of match ids to return.
Count int `json:"count"`
}
type PlatformDataDTO ¶ added in v0.3.0
type PlatformDataDTO struct {
ID string `json:"id"`
Name string `json:"name"`
Locales []string `json:"locales"`
Maintenances []struct {
ArchiveAt time.Time `json:"archive_at"`
Titles []struct {
Content string `json:"content"`
Locale string `json:"locale"`
} `json:"titles"`
UpdatedAt time.Time `json:"updated_at"`
IncidentSeverity string `json:"incident_severity"`
Platforms []string `json:"platforms"`
Updates []struct {
UpdatedAt string `json:"updated_at"`
Translations []struct {
Content string `json:"content"`
Locale string `json:"locale"`
} `json:"translations"`
Author string `json:"author"`
Publish bool `json:"publish"`
CreatedAt time.Time `json:"created_at"`
ID int `json:"id"`
PublishLocations []string `json:"publish_locations"`
} `json:"updates"`
CreatedAt time.Time `json:"created_at"`
ID int `json:"id"`
MaintenanceStatus string `json:"maintenance_status"`
} `json:"maintenances"`
Incidents []struct {
ArchiveAt time.Time `json:"archive_at"`
Titles []struct {
Content string `json:"content"`
Locale string `json:"locale"`
} `json:"titles"`
UpdatedAt time.Time `json:"updated_at"`
IncidentSeverity string `json:"incident_severity"`
Platforms []string `json:"platforms"`
Updates []struct {
UpdatedAt time.Time `json:"updated_at"`
Translations []struct {
Content string `json:"content"`
Locale string `json:"locale"`
} `json:"translations"`
Author string `json:"author"`
Publish bool `json:"publish"`
CreatedAt time.Time `json:"created_at"`
ID int `json:"id"`
PublishLocations []string `json:"publish_locations"`
} `json:"updates"`
CreatedAt time.Time `json:"created_at"`
ID int `json:"id"`
MaintenanceStatus string `json:"maintenance_status"`
} `json:"incidents"`
}
type SpectatorEndpoint ¶ added in v0.3.0
type SpectatorEndpoint struct {
// contains filtered or unexported fields
}
func (*SpectatorEndpoint) CurrentGame ¶ added in v0.4.0
func (c *SpectatorEndpoint) CurrentGame(region api.LOLRegion, summonerID string) (*CurrentGameInfoDTO, error)
Get the current game information for the given summoner ID.
func (*SpectatorEndpoint) FeaturedGames ¶ added in v0.3.0
func (c *SpectatorEndpoint) FeaturedGames(region api.LOLRegion) (*FeaturedGamesDTO, error)
Get featured games in a region.
type StatusEndpoint ¶ added in v0.2.2
type StatusEndpoint struct {
// contains filtered or unexported fields
}
func (*StatusEndpoint) PlatformStatus ¶ added in v0.4.0
func (c *StatusEndpoint) PlatformStatus(region api.LOLRegion) (*PlatformDataDTO, error)
Get League of Legends status for the given platform.
type SummonerDTO ¶ added in v0.5.0
type SummonerEndpoint ¶ added in v0.5.0
type SummonerEndpoint struct {
// contains filtered or unexported fields
}
func (*SummonerEndpoint) ByAccountID ¶ added in v0.5.0
func (c *SummonerEndpoint) ByAccountID(region api.LOLRegion, accountID string) (*SummonerDTO, error)
Get a summoner by summoner account ID.
func (*SummonerEndpoint) ByID ¶ added in v0.5.0
func (c *SummonerEndpoint) ByID(region api.LOLRegion, summonerID string) (*SummonerDTO, error)
Get a summoner by summoner ID.
func (*SummonerEndpoint) ByName ¶ added in v0.5.0
func (c *SummonerEndpoint) ByName(region api.LOLRegion, summonerName string) (*SummonerDTO, error)
Get a summoner by summoner name.
func (*SummonerEndpoint) ByPUUID ¶ added in v0.5.0
func (c *SummonerEndpoint) ByPUUID(region api.LOLRegion, PUUID string) (*SummonerDTO, error)
Get a summoner by summoner PUUID.