lol

package
v0.0.0-...-bbe0b4f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package lol is a Go client that wraps the Riot Games public API.

All Riot defined objects have been mapped to their Go equivalent, with equivalent property types (e.g. long -> int64). The only exceptions are properties that were stored as strings for legacy reasons, but are now safe to parse to int64; LeagueDto.ParticipantID is an example of this.

Usage

Instantiate a lol.Client using the provided lol.NewClient function.

// Riot's API requires a valid API key to utilize these methods
// grab one from https://developer.riotgames.com/.
apiKey := "your-key-here"

// the region to query against; to hit multiple regions, create one client per region
// as the API rate limits you per region per key, not just per key
// the lol.Client object enforces this, as its base url and region cannot be changed after instantiation
region := lol.Na

client := lol.NewClient(apiKey, region, nil)

// start making API calls (e.g. get summoner with SummonerID = 25886496)
client.Summoner.Get(ctx, 25886496)

Structure

All 12 endpoints have their own associated *.go file and service on the Client. For example, the summoner endpoint and all associated objects are stored in the summoner.go file. The API methods exposed are all exposed on the Client.Summoner service.

Optional Params

For any method that allows query params, there is an associated Params object. For valid values to use with these query params and further documentation, please see the API docs at https://developer.riotgames.com/api/methods.

Disclaimer

go-riot/lol isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.

Index

Constants

View Source
const Name = "go-riot/lol"

Name is the name of this package

View Source
const Version = 0.1

Version is the version of this package

Variables

View Source
var BaseURL = "https://%s.api.pvp.net"

BaseURL is the base url serving the API. Override this for testing.

Functions

This section is empty.

Types

type AggregatedStatsDto

type AggregatedStatsDto struct {
	AverageAssists              int `json:"averageAssists"`
	AverageChampionsKilled      int `json:"averageChampionsKilled"`
	AverageCombatPlayerScore    int `json:"averageCombatPlayerScore"`
	AverageNodeCapture          int `json:"averageNodeCapture"`
	AverageNodeCaptureAssist    int `json:"averageNodeCaptureAssist"`
	AverageNodeNeutralize       int `json:"averageNodeNeutralize"`
	AverageNodeNeutralizeAssist int `json:"averageNodeNeutralizeAssist"`
	AverageNumDeaths            int `json:"averageNumDeaths"`
	AverageObjectivePlayerScore int `json:"averageObjectivePlayerScore"`
	AverageTeamObjective        int `json:"averageTeamObjective"`
	AverageTotalPlayerScore     int `json:"averageTotalPlayerScore"`
	BotGamesPlayed              int `json:"botGamesPlayed"`
	KillingSpree                int `json:"killingSpree"`
	MaxAssists                  int `json:"maxAssists"`
	MaxChampionsKilled          int `json:"maxChampionsKilled"`
	MaxCombatPlayerScore        int `json:"maxCombatPlayerScore"`
	MaxLargestCriticalStrike    int `json:"maxLargestCriticalStrike"`
	MaxLargestKillingSpree      int `json:"maxLargestKillingSpree"`
	MaxNodeCapture              int `json:"maxNodeCapture"`
	MaxNodeCaptureAssist        int `json:"maxNodeCaptureAssist"`
	MaxNodeNeutralize           int `json:"maxNodeNeutralize"`
	MaxNodeNeutralizeAssist     int `json:"maxNodeNeutralizeAssist"`
	MaxNumDeaths                int `json:"maxNumDeaths"`
	MaxObjectivePlayerScore     int `json:"maxObjectivePlayerScore"`
	MaxTeamObjective            int `json:"maxTeamObjective"`
	MaxTimePlayed               int `json:"maxTimePlayed"`
	MaxTimeSpentLiving          int `json:"maxTimeSpentLiving"`
	MaxTotalPlayerScore         int `json:"maxTotalPlayerScore"`
	MostChampionKillsPerSession int `json:"mostChampionKillsPerSession"`
	MostSpellsCast              int `json:"mostSpellsCast"`
	NormalGamesPlayed           int `json:"normalGamesPlayed"`
	RankedPremadeGamesPlayed    int `json:"rankedPremadeGamesPlayed"`
	RankedSoloGamesPlayed       int `json:"rankedSoloGamesPlayed"`
	TotalAssists                int `json:"totalAssists"`
	TotalChampionKills          int `json:"totalChampionKills"`
	TotalDamageDealt            int `json:"totalDamageDealt"`
	TotalDamageTaken            int `json:"totalDamageTaken"`
	TotalDeathsPerSession       int `json:"totalDeathsPerSession"`
	TotalDoubleKills            int `json:"totalDoubleKills"`
	TotalFirstBlood             int `json:"totalFirstBlood"`
	TotalGoldEarned             int `json:"totalGoldEarned"`
	TotalHeal                   int `json:"totalHeal"`
	TotalMagicDamageDealt       int `json:"totalMagicDamageDealt"`
	TotalMinionKills            int `json:"totalMinionKills"`
	TotalNeutralMinionsKilled   int `json:"totalNeutralMinionsKilled"`
	TotalNodeCapture            int `json:"totalNodeCapture"`
	TotalNodeNeutralize         int `json:"totalNodeNeutralize"`
	TotalPentaKills             int `json:"totalPentaKills"`
	TotalPhysicalDamageDealt    int `json:"totalPhysicalDamageDealt"`
	TotalQuadraKills            int `json:"totalQuadraKills"`
	TotalSessionsLost           int `json:"totalSessionsLost"`
	TotalSessionsPlayed         int `json:"totalSessionsPlayed"`
	TotalSessionsWon            int `json:"totalSessionsWon"`
	TotalTripleKills            int `json:"totalTripleKills"`
	TotalTurretsKilled          int `json:"totalTurretsKilled"`
	TotalUnrealKills            int `json:"totalUnrealKills"`
}

AggregatedStatsDto is the container for the stats of a given entity

type BannedChampion

type BannedChampion struct {
	ChampionID int64 `json:"championId"`
	PickTurn   int   `json:"pickTurn"`
	TeamID     int64 `json:"teamId"`
}

BannedChampion is the container with banning phase information

type BasicDataDto

type BasicDataDto struct {
	Colloq               string            `json:"colloq"`
	ConsumerOnFull       bool              `json:"consumerOnFull"`
	Consumed             bool              `json:"consumed"`
	Depth                int               `json:"depth"`
	Description          string            `json:"description"`
	From                 []string          `json:"from"`
	Gold                 GoldDto           `json:"gold"`
	Group                string            `json:"group"`
	HideFromAll          bool              `json:"hideFromAll"`
	ID                   int               `json:"id"`
	Image                ImageDto          `json:"image"`
	InStore              bool              `json:"inStore"`
	Into                 []string          `json:"into"`
	Maps                 map[string]bool   `json:"maps"`
	Name                 string            `json:"name"`
	PlainText            string            `json:"plaintext"`
	RequiredChampion     string            `json:"requiredChampion"`
	Rune                 MetaDataDto       `json:"rune"`
	SanitizedDescription string            `json:"sanitizedDescription"`
	SpecialRecipe        int               `json:"specialRecipe"`
	Stacks               int               `json:"stacks"`
	Stats                BasicDataStatsDto `json:"stats"`
	Tags                 []string          `json:"tags"`
}

BasicDataDto is the container for all non-champion basis data

type BasicDataStatsDto

type BasicDataStatsDto struct {
	FlatArmorMod                        float64 `json:"FlatArmorMod"`
	FlatAttackSpeedMod                  float64 `json:"FlatAttackSpeedMod"`
	FlatBlockMod                        float64 `json:"FlatBlockMod"`
	FlatCritChanceMod                   float64 `json:"FlatCritChanceMod"`
	FlatCritDamageMod                   float64 `json:"FlatCritDamageMod"`
	FlatExpBonus                        float64 `json:"FlatEXPBonus"`
	FlatEnergyPoolMod                   float64 `json:"FlatEnergyPoolMod"`
	FlatEnergyRegenMod                  float64 `json:"FlatEnergyRegenMod"`
	FlatHpPoolMod                       float64 `json:"FlatHPPoolMod"`
	FlatHpRegenMod                      float64 `json:"FlatHPRegenMod"`
	FlatMpPoolMod                       float64 `json:"FlatMPPoolMod"`
	FlatMpRegenMod                      float64 `json:"FlatMPRegenMod"`
	FlatMagicDamageMod                  float64 `json:"FlatMagicDamageMod"`
	FlatMovementSpeedMod                float64 `json:"FlatMovementSpeedMod"`
	FlatPhysicalDamageMod               float64 `json:"FlatPhysicalDamageMod"`
	FlatSpellBlockMod                   float64 `json:"FlatSpellBlockMod"`
	PercentArmorMod                     float64 `json:"PercentArmorMod"`
	PercentAttackSpeedMod               float64 `json:"PercentAttackSpeedMod"`
	PercentBlockMod                     float64 `json:"PercentBlockMod"`
	PercentCritChanceMod                float64 `json:"PercentCritChanceMod"`
	PercentCritDamageMod                float64 `json:"PercentCritDamageMod"`
	PercentDodgeMod                     float64 `json:"PercentDodgeMod"`
	PercentExpBonus                     float64 `json:"PercentEXPBonus"`
	PercentHpPoolMod                    float64 `json:"PercentHPPoolMod"`
	PercentHpRegenMod                   float64 `json:"PercentHPRegenMod"`
	PercentLifeStealMod                 float64 `json:"PercentLifeStealMod"`
	PercentMpPoolMod                    float64 `json:"PercentMPPoolMod"`
	PercentMpRegendMod                  float64 `json:"PercentMPRegendMod"`
	PercentMagicDamageMod               float64 `json:"PercentMagicDamageMod"`
	PercentMovementSpeedMod             float64 `json:"PercentMovementSpeedMod"`
	PercentPhysicalDamageMod            float64 `json:"PercentPhysicalDamageMod"`
	PercentSpellBlockMod                float64 `json:"PercentSpellBlockMod"`
	PercentSpellVampMod                 float64 `json:"PercentSpellVampMod"`
	RFlatArmorModPerLevel               float64 `json:"rFlatArmorModPerLevel"`
	RFlatArmorPenetrationMod            float64 `json:"rFlatArmorPenetrationMod"`
	RFlatArmorPenetrationModPerLevel    float64 `json:"rFlatArmorPenetrationModPerLevel"`
	RFlatCritChanceModPerLevel          float64 `json:"rFlatCritChanceModPerLevel"`
	RFlatCritDamageModPerLevel          float64 `json:"rFlatCritDamageModPerLevel"`
	RFlatDodgeMod                       float64 `json:"rFlatDodgeMod"`
	RFlatDodgeModPerLevel               float64 `json:"rFlatDodgeModPerLevel"`
	RFlatEnergyModPerLevel              float64 `json:"rFlatEnergyModPerLevel"`
	RFlatEnergyRegenModPerLevel         float64 `json:"rFlatEnergyRegenModPerLevel"`
	RFlatGoldPer10Mod                   float64 `json:"rFlatGoldPer10Mod"`
	RFlatHpModPerLevel                  float64 `json:"rFlatHPModPerLevel"`
	RFlatHpRegenModPerLevel             float64 `json:"rFlatHPRegenModPerLevel"`
	RFlatMpModPerLevel                  float64 `json:"rFlatMPModPerLevel"`
	RFlatMpRegenModPerLevel             float64 `json:"rFlatMPRegenModPerLevel"`
	RFlatMagicDamageModPerLevel         float64 `json:"rFlatMagicDamageModPerLevel"`
	RFlatMagicPenetrationMod            float64 `json:"rFlatMagicPenetrationMod"`
	RFlatMagicPenetrationModPerLevel    float64 `json:"rFlatMagicPenetrationModPerLevel"`
	RFlatMovementSpeedModPerLevel       float64 `json:"rFlatMovementSpeedModPerLevel"`
	RFlatPhysicalDamageModPerLevel      float64 `json:"rFlatPhysicalDamageModPerLevel"`
	RFlatSpellBlockModPerLevel          float64 `json:"rFlatSpellBlockModPerLevel"`
	RFlatTimeDeadMod                    float64 `json:"rFlatTimeDeadMod"`
	RFlatTimeDeadModPerLevel            float64 `json:"rFlatTimeDeadModPerLevel"`
	RPercentArmorPenetrationMod         float64 `json:"rPercentArmorPenetrationMod"`
	RPercentArmorPenetrationModPerLevel float64 `json:"rPercentArmorPenetrationModPerLevel"`
	RPercentAttackSpeedModPerLevel      float64 `json:"rPercentAttackSpeedModPerLevel"`
	RPercentCooldownMod                 float64 `json:"rPercentCooldownMod"`
	RPercentCooldownModPerLevel         float64 `json:"rPercentCooldownModPerLevel"`
	RPercentMagicPenetrationMod         float64 `json:"rPercentMagicPenetrationMod"`
	RPercentMagicPenetrationModPerLevel float64 `json:"rPercentMagicPenetrationModPerLevel"`
	RPercentMovementSpeedModPerLevel    float64 `json:"rPercentMovementSpeedModPerLevel"`
	RPercentTimeDeadMod                 float64 `json:"rPercentTimeDeadMod"`
	RPercentTimeDeadModPerLevel         float64 `json:"rPercentTimeDeadModPerLevel"`
}

BasicDataStatsDto is the container for all non-champion data stats

type BlockDto

type BlockDto struct {
	Items   []BlockItemDto `json:"items"`
	RecMath bool           `json:"recMath"`
	Type    string         `json:"type"`
}

BlockDto is the container for block

type BlockItemDto

type BlockItemDto struct {
	Count int `json:"count"`
	ID    int `json:"id"`
}

BlockItemDto is the container for block item

type ChampionDto

type ChampionDto struct {
	Active            bool  `json:"active"`
	BotEnabled        bool  `json:"botEnabled"`
	BotMmEnabled      bool  `json:"botMmEnabled"`
	FreeToPlay        bool  `json:"freeToPlay"`
	ID                int64 `json:"id"`
	RankedPlayEnabled bool  `json:"rankedPlayEnabled"`
}

ChampionDto is the container returned per champion

type ChampionListDto

type ChampionListDto struct {
	Champions []ChampionDto `json:"champions"`
}

ChampionListDto is the container returned by GetAll

type ChampionMasteryDto

type ChampionMasteryDto struct {
	ChampionPoints               int   `json:"championPoints"`
	PlayerID                     int64 `json:"playerId"`
	ChampionPointsUntilNextLevel int64 `json:"championPointsUntilNextLevel"`
	ChestGranted                 bool  `json:"chestGranted"`
	ChampionLevel                int   `json:"championLevel"`
	TokensEarned                 int   `json:"tokensEarned"`
	ChampionID                   int64 `json:"championId"`
	ChampionPointsSinceLastLevel int64 `json:"championPointsSinceLastLevel"`
	LastPlayTime                 int64 `json:"lastPlayTime"`
}

ChampionMasteryDto is the container returned per champion mastery

type ChampionMasteryService

type ChampionMasteryService struct {
	// contains filtered or unexported fields
}

ChampionMasteryService is the endpoint to use to get champion mastery information

func (*ChampionMasteryService) Get

func (s *ChampionMasteryService) Get(ctx context.Context, summonerID int64, championID int64) (*ChampionMasteryDto, error)

Get gets the champion mastery for a single championID

func (*ChampionMasteryService) GetAll

func (s *ChampionMasteryService) GetAll(ctx context.Context, summonerID int64) (*[]ChampionMasteryDto, error)

GetAll gets all champion masteries for a summonerID

func (*ChampionMasteryService) GetScore

func (s *ChampionMasteryService) GetScore(ctx context.Context, summonerID int64) (*int, error)

GetScore gets the total score for a summonerID

func (*ChampionMasteryService) GetTopChampions

func (s *ChampionMasteryService) GetTopChampions(ctx context.Context, summonerID int64, params *GetTopChampionsParams) (*[]ChampionMasteryDto, error)

GetTopChampions gets the top params.Count champion masteries by score (or 3 by default)

type ChampionService

type ChampionService struct {
	// contains filtered or unexported fields
}

ChampionService is the endpoint to use to get quick information about champions

func (*ChampionService) Get

func (s *ChampionService) Get(ctx context.Context, championID int64) (*ChampionDto, error)

Get gets a single champion, by championId

func (*ChampionService) GetAll

GetAll gets all champions, or pass in params to filter down

type ChampionSpellDto

type ChampionSpellDto struct {
	AltImages            []ImageDto     `json:"altimages"`
	Cooldown             []float64      `json:"cooldown"`
	CooldownBurn         string         `json:"cooldownBurn"`
	Cost                 []int          `json:"cost"`
	CostBurn             string         `json:"costBurn"`
	CostType             string         `json:"costType"`
	Description          string         `json:"description"`
	Effect               [][]float64    `json:"effect"`
	EffectBurn           []string       `json:"effectBurn"`
	Image                ImageDto       `json:"image"`
	Key                  string         `json:"key"`
	LevelTip             LevelTipDto    `json:"leveltip"`
	MaxRank              int            `json:"maxrank"`
	Name                 string         `json:"name"`
	Range                interface{}    `json:"range"`
	RangeBurn            string         `json:"rangeBurn"`
	Resource             string         `json:"resource"`
	SanitizedDescription string         `json:"sanitizedDescription"`
	SanitizedTooltip     string         `json:"sanitizedTooltip"`
	Tooltip              string         `json:"tooltip"`
	Vars                 []SpellVarsDto `json:"vars"`
}

ChampionSpellDto is the container for a champion's spells

type ChampionStatsDto

type ChampionStatsDto struct {
	ID    int                `json:"id"`
	Stats AggregatedStatsDto `json:"stats"`
}

ChampionStatsDto is the container for the stats for a given champion

type Client

type Client struct {
	APIKey string

	// The API Client uses these resources
	Summoner        *SummonerService
	Match           *MatchService
	MatchList       *MatchListService
	Champion        *ChampionService
	ChampionMastery *ChampionMasteryService
	CurrentGame     *CurrentGameService
	FeaturedGames   *FeaturedGamesService
	Game            *GameService
	Stats           *StatsService
	League          *LeagueService
	Status          *StatusService
	StaticData      *StaticDataService
	// contains filtered or unexported fields
}

Client is the the API client hook to query Riot's League of Legends API

func NewClient

func NewClient(apiKey string, region Region, httpClient *http.Client) *Client

NewClient constructs a client to handle API calls to the Riot League of Legends public API apiKey: unique key given by registering with https://developer.riotgames.com/ region: the region to make queries against (Na, Euw, etc.) httpClient: if desired, provide your own instance of an httpClient; pass nil otherwise

func (Client) Region

func (c Client) Region() Region

Region returns the region set for this Client

type CurrentGameInfo

type CurrentGameInfo struct {
	BannedChampions   []BannedChampion         `json:"bannedChampions"`
	GameID            int64                    `json:"gameId"`
	GameLength        int64                    `json:"gameLength"`
	GameMode          string                   `json:"gameMode"`
	GameQueueConfigID int64                    `json:"gameQueueConfigId"`
	GameStartTime     int64                    `json:"gameStartTime"`
	GameType          string                   `json:"gameType"`
	MapID             int64                    `json:"mapId"`
	Observers         Observer                 `json:"observers"`
	Participants      []CurrentGameParticipant `json:"participants"`
	PlatformID        string                   `json:"platformId"`
}

CurrentGameInfo is the container returned for a current game

type CurrentGameParticipant

type CurrentGameParticipant struct {
	Bot           bool              `json:"bot"`
	ChampionID    int64             `json:"championId"`
	Masteries     []Mastery         `json:"masteries"`
	ProfileIconID int64             `json:"profileIconId"`
	Runes         []CurrentGameRune `json:"runes"`
	Spell1ID      int64             `json:"spell1Id"`
	Spell2ID      int64             `json:"spell2Id"`
	SummonerID    int64             `json:"summonerId"`
	SummonerName  string            `json:"summonerName"`
	TeamID        int64             `json:"teamId"`
}

CurrentGameParticipant is a participant's information for the current game

type CurrentGameRune

type CurrentGameRune struct {
	Count  int   `json:"count"`
	RuneID int64 `json:"runeId"`
}

CurrentGameRune is a rune used by a current game participant

type CurrentGameService

type CurrentGameService struct {
	// contains filtered or unexported fields
}

CurrentGameService is the endpoint to use to get current game data

func (*CurrentGameService) Get

func (s *CurrentGameService) Get(ctx context.Context, summonerID int64) (*CurrentGameInfo, error)

Get gets the current game for a summonerID

type Event

type Event struct {
	AscendedType            string   `json:"ascendedType"`
	AssistingParticipantIDs []int    `json:"assistingParticipantIds"`
	BuildingType            string   `json:"buildingType"`
	CreatorID               int      `json:"creatorId"`
	EventType               string   `json:"eventType"`
	ItemAfter               int      `json:"itemAfter"`
	ItemBefore              int      `json:"itemBefore"`
	ItemID                  int      `json:"itemId"`
	KillerID                int      `json:"killerId"`
	LaneType                string   `json:"laneType"`
	LevelUpType             string   `json:"levelUpType"`
	MonsterType             string   `json:"monsterType"`
	ParticipantID           int      `json:"participantId"`
	PointCaptured           string   `json:"pointCaptured"`
	Position                Position `json:"position"`
	SkillSlot               int      `json:"skillSlot"`
	TeamID                  int      `json:"teamId"`
	Timestamp               int64    `json:"timestamp"`
	TowerType               string   `json:"towerType"`
	VictimID                int      `json:"victimId"`
	WardType                string   `json:"wardType"`
}

Event is the information for a given moment

type FeaturedGames

type FeaturedGames struct {
	ClientRefreshInterval int64             `json:"clientRefreshInterval"`
	GameList              []CurrentGameInfo `json:"gameList"`
}

FeaturedGames is the container returned to list the featured games

type FeaturedGamesService

type FeaturedGamesService struct {
	// contains filtered or unexported fields
}

FeaturedGamesService maps the resource to use to get the featured games shown by the League of Legends client

func (*FeaturedGamesService) Get

Get gets the featured games

type Frame

type Frame struct {
	Events            []Event                  `json:"events"`
	ParticipantFrames map[int]ParticipantFrame `json:"participantFrames"`
}

Frame is the container for a snapshot in time

type GameDto

type GameDto struct {
	ChampionID    int         `json:"championId"`
	CreateDate    int64       `json:"createDate"`
	FellowPlayers []PlayerDto `json:"fellowPlayers"`
	GameID        int64       `json:"gameId"`
	GameMode      string      `json:"gameMode"`
	GameType      string      `json:"gameType"`
	Invalid       bool        `json:"invalid"`
	IPEarned      int         `json:"ipEarned"`
	Level         int         `json:"level"`
	MapID         int         `json:"mapId"`
	Spell1        int         `json:"spell1"`
	Spell2        int         `json:"spell2"`
	Stats         RawStatsDto `json:"stats"`
	SubType       string      `json:"subType"`
	TeamID        int         `json:"teamId"`
}

GameDto is the container for a single game

type GameService

type GameService struct {
	// contains filtered or unexported fields
}

GameService is the endpoint to use to get general information about games

func (*GameService) GetRecent

func (s *GameService) GetRecent(ctx context.Context, summonerID int64) (*RecentGamesDto, error)

GetRecent gets the recent games for a summonerID

type GetChampionStaticDataParams

type GetChampionStaticDataParams struct {
	GetStaticDataBaseParams
	DataByID  bool   `url:"dataById,omitempty"`
	ChampData string `url:"champData,omitempty"`
}

GetChampionStaticDataParams are the optional query params for champion static data

type GetChampionsParams

type GetChampionsParams struct {
	FreeToPlay bool `url:"freeToPlay,omitempty"`
}

GetChampionsParams are optional query params

type GetForTournamentParams

type GetForTournamentParams struct {
	IncludeTimeline bool   `url:"includeTimeline,omitempty"`
	TournamentCode  string `url:"tournamentCode,omitempty"`
}

GetForTournamentParams are used when getting a match related to a tournament

type GetItemStaticDataParams

type GetItemStaticDataParams struct {
	GetStaticDataBaseParams
	ItemListData string `url:"itemListData,omitempty"`
}

GetItemStaticDataParams are the optional query params for item static data

type GetMasteryStaticDataParams

type GetMasteryStaticDataParams struct {
	GetStaticDataBaseParams
	MasteryListData string `url:"masteryListData,omitempty"`
}

GetMasteryStaticDataParams are the optional query params for mastery static data

type GetMatchListParams

type GetMatchListParams struct {
	ChampionIDs  string `url:"championIds,omitempty"`
	RankedQueues string `url:"rankedQueues,omitempty"`
	Seasons      string `url:"seasons,omitempty"`
	BeginTime    int64  `url:"beginTime,omitempty"`
	EndTime      int64  `url:"endTime,omitempty"`
	BeginIndex   int    `url:"beginIndex,omitempty"`
	EndIndex     int    `url:"endIndex,omitempty"`
}

GetMatchListParams are the optional query params

type GetMatchParams

type GetMatchParams struct {
	IncludeTimeline bool `url:"includeTimeline,omitempty"`
}

GetMatchParams are the optional query params for Get

type GetRuneStaticDataParams

type GetRuneStaticDataParams struct {
	GetStaticDataBaseParams
	RuneListData string `url:"runeListData,omitempty"`
}

GetRuneStaticDataParams are the optional query params for rune static data

type GetStaticDataBaseParams

type GetStaticDataBaseParams struct {
	Locale  string `url:"locale,omitempty"`
	Version string `url:"version,omitempty"`
}

GetStaticDataBaseParams are the base optional query params used by static data methods

type GetStatsParams

type GetStatsParams struct {
	Season string `url:"season,omitempty"`
}

GetStatsParams is the optional query params

type GetSummonerSpellStaticDataParams

type GetSummonerSpellStaticDataParams struct {
	GetStaticDataBaseParams
	DataByID  bool   `url:"dataById,omitempty"`
	SpellData string `url:"spellData,omitempty"`
}

GetSummonerSpellStaticDataParams are the optional query params for summoner spell static data

type GetTopChampionsParams

type GetTopChampionsParams struct {
	Count int `url:"count,omitempty"`
}

GetTopChampionsParams are optional query params

type GoldDto

type GoldDto struct {
	Base        int  `json:"base"`
	Purchasable bool `json:"purchasable"`
	Sell        int  `json:"sell"`
	Total       int  `json:"total"`
}

GoldDto is the container for gold information

type GroupDto

type GroupDto struct {
	MaxGroupOwnable string `json:"MaxGroupOwnable"`
	Key             string `json:"key"`
}

GroupDto is the container for groups

type ImageDto

type ImageDto struct {
	Full   string `json:"full"`
	Group  string `json:"group"`
	H      int    `json:"h"`
	Sprint string `json:"sprint"`
	W      int    `json:"w"`
	X      int    `json:"x"`
	Y      int    `json:"y"`
}

ImageDto is the container for images

type InfoDto

type InfoDto struct {
	Attack     int `json:"attack"`
	Defense    int `json:"defense"`
	Difficulty int `json:"difficulty"`
	Magic      int `json:"magic"`
}

InfoDto is the container for basic champion info

type ItemDto

type ItemDto struct {
	Colloq               string            `json:"colloq"`
	ConsumeOnFull        bool              `json:"consumeOnFull"`
	Consumed             bool              `json:"consumed"`
	Depth                int               `json:"depth"`
	Description          string            `json:"description"`
	Effect               map[string]string `json:"effect"`
	From                 []string          `json:"from"`
	Gold                 GoldDto           `json:"gold"`
	Group                string            `json:"group"`
	HideFromAll          bool              `json:"hideFromAll"`
	ID                   int               `json:"id"`
	Image                ImageDto          `json:"image"`
	InStore              bool              `json:"inStore"`
	Into                 []string          `json:"into"`
	Maps                 map[string]bool   `json:"maps"`
	Name                 string            `json:"name"`
	PlainText            string            `json:"plaintext"`
	RequiredChampion     string            `json:"requiredChampion"`
	Rune                 MetaDataDto       `json:"rune"`
	SanitizedDescription string            `json:"sanitizedDescription"`
	SpecialRecipe        int               `json:"specialRecipe"`
	Stacks               int               `json:"stacks"`
	Stats                BasicDataStatsDto `json:"stats"`
}

ItemDto is the container for a single item's data

type ItemListDto

type ItemListDto struct {
	Basic   BasicDataDto       `json:"basic"`
	Data    map[string]ItemDto `json:"data"`
	Groups  []GroupDto         `json:"groups"`
	Tree    []ItemTreeDto      `json:"tree"`
	Type    string             `json:"type"`
	Version string             `json:"version"`
}

ItemListDto is the container for items' data

type ItemTreeDto

type ItemTreeDto struct {
	Header string   `json:"header"`
	Tags   []string `json:"tags"`
}

ItemTreeDto is the container for an item's tree hierarchy

type LanguageStringsDto

type LanguageStringsDto struct {
	Data    map[string]string `json:"data"`
	Type    string            `json:"type"`
	Version string            `json:"version"`
}

LanguageStringsDto is the container for language strings

type LeagueDto

type LeagueDto struct {
	Entries       []LeagueEntryDto `json:"entries"`
	Name          string           `json:"name"`
	ParticipantID int64            `json:"participantId"`
	Queue         string           `json:"queue"`
	Tier          string           `json:"tier"`
}

LeagueDto is the container returned with league information

type LeagueEntryDto

type LeagueEntryDto struct {
	Division         string        `json:"division"`
	IsFreshBlood     bool          `json:"isFreshBlood"`
	IsHotStreak      bool          `json:"isHotStreak"`
	IsInactive       bool          `json:"isInactive"`
	IsVeteran        bool          `json:"isVeteran"`
	LeaguePoints     int           `json:"leaguePoints"`
	Losses           int           `json:"losses"`
	MiniSeries       MiniSeriesDto `json:"miniSeries"`
	PlayerOrTeamID   int64         `json:"playerOrTeamId"`
	PlayerOrTeamName string        `json:"playerOrTeamName"`
	PlayStyle        string        `json:"playstyle"`
	Wins             int           `json:"wins"`
}

LeagueEntryDto is the container for a single entry in a league

type LeagueService

type LeagueService struct {
	// contains filtered or unexported fields
}

LeagueService is the endpoint to use to get league information

func (*LeagueService) GetBySummoner

func (s *LeagueService) GetBySummoner(ctx context.Context, summonerIDs ...int64) (*map[int64]LeagueDto, error)

GetBySummoner gets the league data for given summonerIDs (up to 10), and others in the same league

func (*LeagueService) GetChallenger

func (s *LeagueService) GetChallenger(ctx context.Context) (*LeagueDto, error)

GetChallenger gets the challenger league information

func (*LeagueService) GetEntriesBySummoner

func (s *LeagueService) GetEntriesBySummoner(ctx context.Context, summonerIDs ...int64) (*map[int64]LeagueDto, error)

GetEntriesBySummoner gets the league data for given summonerIDs (up to 10), and only those summonerIDs

func (*LeagueService) GetMaster

func (s *LeagueService) GetMaster(ctx context.Context) (*LeagueDto, error)

GetMaster gets the master league information

type LevelTipDto

type LevelTipDto struct {
	Effect []string `json:"effect"`
	Label  []string `json:"label"`
}

LevelTipDto is the container for level tips

type Mastery

type Mastery struct {
	MasteryID int64 `json:"masteryId"`
	Rank      int   `json:"rank"`
}

Mastery is the container for basic mastery utilization information

type MasteryDto

type MasteryDto struct {
	ID   int `json:"id"`
	Rank int `json:"rank"`
}

MasteryDto is the container for a single mastery in a mastery page

type MasteryListDto

type MasteryListDto struct {
	Data    map[string]StaticDataMasteryDto `json:"data"`
	Tree    MasteryTreeDto                  `json:"tree"`
	Type    string                          `json:"type"`
	Version string                          `json:"version"`
}

MasteryListDto is the container for masteries' data

type MasteryPageDto

type MasteryPageDto struct {
	ID        int          `json:"id"`
	Name      string       `json:"name"`
	Current   bool         `json:"current"`
	Masteries []MasteryDto `json:"masteries"`
}

MasteryPageDto is the container for a single mastery page

type MasteryPagesDto

type MasteryPagesDto struct {
	SummonerID int64            `json:"summonerId"`
	Pages      []MasteryPageDto `json:"pages"`
}

MasteryPagesDto is the container for all mastery pages for a summoner

type MasteryTreeDto

type MasteryTreeDto struct {
	Cunning  []MasteryTreeListDto `json:"Cunning"`
	Ferocity []MasteryTreeListDto `json:"Ferocity"`
	Resolve  []MasteryTreeListDto `json:"Resolve"`
}

MasteryTreeDto is the container for the mastery trees

type MasteryTreeItemDto

type MasteryTreeItemDto struct {
	MasteryID int    `json:"masteryId"`
	Prereq    string `json:"prereq"`
}

MasteryTreeItemDto is the container for the mastery tree item

type MasteryTreeListDto

type MasteryTreeListDto struct {
	MasteryTreeItems []MasteryTreeItemDto `json:"masteryTreeItems"`
}

MasteryTreeListDto is the container for the mastery tree list

type MatchDetail

type MatchDetail struct {
	MapID                 int                   `json:"mapId"`
	MatchCreation         int64                 `json:"matchCreation"`
	MatchDuration         int64                 `json:"matchDuration"`
	MatchID               int64                 `json:"matchId"`
	MatchMode             string                `json:"matchMode"`
	MatchType             string                `json:"matchType"`
	MatchVersion          string                `json:"matchVersion"`
	ParticipantIdentities []ParticipantIdentity `json:"participantIdentities"`
	Participants          []Participant         `json:"participants"`
	QueueType             string                `json:"queueType"`
	Region                string                `json:"region"`
	Season                string                `json:"season"`
	Teams                 []Team                `json:"teams"`
	Timeline              Timeline              `json:"timeline"`
}

MatchDetail is the container for a given match information

type MatchList

type MatchList struct {
	StartIndex int              `json:"startIndex"`
	EndIndex   int              `json:"endIndex"`
	TotalGames int              `json:"totalGames"`
	Matches    []MatchReference `json:"matches"`
}

MatchList is the container for the matchlist endpoint

type MatchListService

type MatchListService struct {
	// contains filtered or unexported fields
}

MatchListService is the endpoint to use to get matchlist information

func (*MatchListService) GetBySummoner

func (s *MatchListService) GetBySummoner(ctx context.Context, summonerID int64) (*MatchList, error)

GetBySummoner gets the matchlist for a given summonerID

type MatchReference

type MatchReference struct {
	Champion   int64  `json:"champion"`
	Lane       string `json:"lane"`
	MatchID    int64  `json:"matchId"`
	PlatformID string `json:"platformId"`
	Queue      string `json:"queue"`
	Region     string `json:"region"`
	Role       string `json:"role"`
	Season     string `json:"season"`
	Timestamp  int64  `json:"timestamp"`
}

MatchReference is the container for basic match information

type MatchService

type MatchService struct {
	// contains filtered or unexported fields
}

MatchService is the endpoint to use to get detailed match information

func (*MatchService) Get

func (s *MatchService) Get(ctx context.Context, matchID int64, params *GetMatchParams) (*MatchDetail, error)

Get gets the match for a given matchID

func (*MatchService) GetForTournament

func (s *MatchService) GetForTournament(ctx context.Context, matchID int64, params *GetForTournamentParams) (*MatchDetail, error)

GetForTournament gets the match details for a tournament match, params.TournamentCode is required

func (*MatchService) GetIdsByTournament

func (s *MatchService) GetIdsByTournament(ctx context.Context, tournamentCode string) (*[]int64, error)

GetIdsByTournament gets the matchIDs for a given tournament code

type MetaDataDto

type MetaDataDto struct {
	IsRune bool   `json:"isRune"`
	Tier   string `json:"tier"`
	Type   string `json:"type"`
}

MetaDataDto is the container for metadata

type MiniSeriesDto

type MiniSeriesDto struct {
	Losses   int    `json:"losses"`
	Progress string `json:"progress"`
	Target   int    `json:"target"`
	Wins     int    `json:"wins"`
}

MiniSeriesDto is the container for an entry's promotional series

type Observer

type Observer struct {
	EncryptionKey string `json:"encryptionKey"`
}

Observer supplies spectate game observer information

type Participant

type Participant struct {
	ChampionID                int                 `json:"championId"`
	HighestAchievedSeasonTier string              `json:"highestAchievedSeasonTier"`
	Masteries                 []Mastery           `json:"masteries"`
	ParticipantID             int                 `json:"participantId"`
	Runes                     []Rune              `json:"runes"`
	Spell1ID                  int                 `json:"spell1Id"`
	Spell2ID                  int                 `json:"spell2Id"`
	Stats                     ParticipantStats    `json:"stats"`
	TeamID                    int                 `json:"teamId"`
	Timeline                  ParticipantTimeline `json:"timeline"`
}

Participant is the container for participant information in a game

type ParticipantFrame

type ParticipantFrame struct {
	CurrentGold         int      `json:"currentGold"`
	DominionScore       int      `json:"dominionScore"`
	JungleMinionsKilled int      `json:"jungleMinionsKilled"`
	Level               int      `json:"level"`
	MinionsKilled       int      `json:"minionsKilled"`
	ParticipantID       int      `json:"participantId"`
	Position            Position `json:"position"`
	TeamScore           int      `json:"teamScore"`
	TotalGold           int      `json:"totalGold"`
	Xp                  int      `json:"xp"`
}

ParticipantFrame is the information for a participant in a frame

type ParticipantIdentity

type ParticipantIdentity struct {
	ParticipantID int    `json:"participantId"`
	Player        Player `json:"player"`
}

ParticipantIdentity is the container for a given participant in a match

type ParticipantStats

type ParticipantStats struct {
	Assists                         int64 `json:"assists"`
	ChampLevel                      int64 `json:"champLevel"`
	CombatPlayerScore               int64 `json:"combatPlayerScore"`
	Deaths                          int64 `json:"deaths"`
	DoubleKills                     int64 `json:"doubleKills"`
	FirstBloodAssist                bool  `json:"firstBloodAssist"`
	FirstBloodKill                  bool  `json:"firstBloodKill"`
	FirstInhibitorAssist            bool  `json:"firstInhibitorAssist"`
	FirstInhibitorKill              bool  `json:"firstInhibitorKill"`
	FirstTowerAssist                bool  `json:"firstTowerAssist"`
	FirstTowerKill                  bool  `json:"firstTowerKill"`
	GoldEarned                      int64 `json:"goldEarned"`
	GoldSpent                       int64 `json:"goldSpent"`
	InhibitorKills                  int64 `json:"inhibitorKills"`
	Item0                           int64 `json:"item0"`
	Item1                           int64 `json:"item1"`
	Item2                           int64 `json:"item2"`
	Item3                           int64 `json:"item3"`
	Item4                           int64 `json:"item4"`
	Item5                           int64 `json:"item5"`
	Item6                           int64 `json:"item6"`
	KillingSprees                   int64 `json:"killingSprees"`
	Kills                           int64 `json:"kills"`
	LargestCriticalStrike           int64 `json:"largestCriticalStrike"`
	LargestKillingSpree             int64 `json:"largestKillingSpree"`
	LargestMultiKill                int64 `json:"largestMultiKill"`
	MagicDamageDealt                int64 `json:"magicDamageDealt"`
	MagicDamageDealtToChampions     int64 `json:"magicDamageDealtToChampions"`
	MagicDamageTaken                int64 `json:"magicDamageTaken"`
	MinionsKilled                   int64 `json:"minionsKilled"`
	NeutralMinionsKilled            int64 `json:"neutralMinionsKilled"`
	NeutralMinionsKilledEnemyJungle int64 `json:"neutralMinionsKilledEnemyJungle"`
	NeutralMinionsKilledTeamJungle  int64 `json:"neutralMinionsKilledTeamJungle"`
	NodeCapture                     int64 `json:"nodeCapture"`
	NodeCaptureAssist               int64 `json:"nodeCaptureAssist"`
	NodeNeutralize                  int64 `json:"nodeNeutralize"`
	ObjectivePlayerScore            int64 `json:"objectivePlayerScore"`
	PentaKills                      int64 `json:"pentaKills"`
	PhysicalDamageDealt             int64 `json:"physicalDamageDealt"`
	PhysicalDamageDealtToChampions  int64 `json:"physicalDamageDealtToChampions"`
	PhysicalDamageTaken             int64 `json:"physicalDamageTaken"`
	QuadraKills                     int64 `json:"quadraKills"`
	SightWardsBoughtInGame          int64 `json:"sightWardsBoughtInGame"`
	TeamObjective                   int64 `json:"teamObjective"`
	TotalDamageDealt                int64 `json:"totalDamageDealt"`
	TotalDamageDealtToChampions     int64 `json:"totalDamageDealtToChampions"`
	TotalDamageTaken                int64 `json:"totalDamageTaken"`
	TotalHeal                       int64 `json:"totalHeal"`
	TotalPlayerScore                int64 `json:"totalPlayerScore"`
	TotalScoreRank                  int64 `json:"totalScoreRank"`
	TotalTimeCrowdControlDealt      int64 `json:"totalTimeCrowdControlDealt"`
	TotalUnitsHealed                int64 `json:"totalUnitsHealed"`
	TowerKills                      int64 `json:"towerKills"`
	TripleKills                     int64 `json:"tripleKills"`
	TrueDamageDealt                 int64 `json:"trueDamageDealt"`
	TrueDamageDealtToChampions      int64 `json:"trueDamageDealtToChampions"`
	TrueDamageTaken                 int64 `json:"trueDamageTaken"`
	UnrealKills                     int64 `json:"unrealKills"`
	VisionWardsBoughtInGame         int64 `json:"visionWardsBoughtInGame"`
	WardsKilled                     int64 `json:"wardsKilled"`
	WardsPlaced                     int64 `json:"wardsPlaced"`
	Winner                          bool  `json:"winner"`
}

ParticipantStats is the detailed information for a participant

type ParticipantTimeline

type ParticipantTimeline struct {
	AncientGolemAssistsPerMinCounts ParticipantTimelineData `json:"ancientGolemAssistsPerMinCounts"`
	AncientGolemKillsPerMinCounts   ParticipantTimelineData `json:"ancientGolemKillsPerMinCounts"`
	AssistedLaneDeathsPerMinDeltas  ParticipantTimelineData `json:"assistedLaneDeathsPerMinDeltas"`
	AssistedLaneKillsPerMinDeltas   ParticipantTimelineData `json:"assistedLaneKillsPerMinDeltas"`
	BaronAssistsPerMinCounts        ParticipantTimelineData `json:"baronAssistsPerMinCounts"`
	BaronKillsPerMinCounts          ParticipantTimelineData `json:"baronKillsPerMinCounts"`
	CreepsPerMinDeltas              ParticipantTimelineData `json:"creepsPerMinDeltas"`
	CsDiffPerMinDeltas              ParticipantTimelineData `json:"csDiffPerMinDeltas"`
	DamageTakenDiffPerMinDeltas     ParticipantTimelineData `json:"damageTakenDiffPerMinDeltas"`
	DamageTakenPerMinDeltas         ParticipantTimelineData `json:"damageTakenPerMinDeltas"`
	DragonAssistsPerMinCounts       ParticipantTimelineData `json:"dragonAssistsPerMinCounts"`
	DragonKillsPerMinCounts         ParticipantTimelineData `json:"dragonKillsPerMinCounts"`
	ElderLizardAssistsPerMinCounts  ParticipantTimelineData `json:"elderLizardAssistsPerMinCounts"`
	ElderLizardKillsPerMinCounts    ParticipantTimelineData `json:"elderLizardKillsPerMinCounts"`
	GoldPerMinDeltas                ParticipantTimelineData `json:"goldPerMinDeltas"`
	InhibitorAssistsPerMinCounts    ParticipantTimelineData `json:"inhibitorAssistsPerMinCounts"`
	InhibitorKillsPerMinCounts      ParticipantTimelineData `json:"inhibitorKillsPerMinCounts"`
	Lane                            string                  `json:"lane"`
	Role                            string                  `json:"role"`
	TowerAssistsPerMinCounts        ParticipantTimelineData `json:"towerAssistsPerMinCounts"`
	TowerKillsPerMinCounts          ParticipantTimelineData `json:"towerKillsPerMinCounts"`
	TowerKillsPerMinDeltas          ParticipantTimelineData `json:"towerKillsPerMinDeltas"`
	VilemawAssistsPerMinCounts      ParticipantTimelineData `json:"vilemawAssistsPerMinCounts"`
	VilemawKillsPerMinCounts        ParticipantTimelineData `json:"vilemawKillsPerMinCounts"`
	WardsPerMinDeltas               ParticipantTimelineData `json:"wardsPerMinDeltas"`
	XpDiffPerMinDeltas              ParticipantTimelineData `json:"xpDiffPerMinDeltas"`
	XpPerMinDeltas                  ParticipantTimelineData `json:"xpPerMinDeltas"`
}

ParticipantTimeline is the container for a snapshot of participant information at a given time

type ParticipantTimelineData

type ParticipantTimelineData struct {
	TenToTwenty    float64 `json:"tenToTwenty"`
	ThirtyToTen    float64 `json:"thirtyToTen"`
	TwentyToThirty float64 `json:"twentyToThirty"`
	ZeroToTen      float64 `json:"zeroToTen"`
}

ParticipantTimelineData is the container to display progression of stats

type PassiveDto

type PassiveDto struct {
	Description          string   `json:"description"`
	Image                ImageDto `json:"image"`
	Name                 string   `json:"name"`
	SanitizedDescription string   `json:"sanitizedDescription"`
}

PassiveDto is the container for a champion's passive

type Player

type Player struct {
	MatchHistoryURI string `json:"matchHistoryUri"`
	ProfileIcon     int    `json:"profileIcon"`
	SummonerID      int64  `json:"summonerId"`
	SummonerName    string `json:"summonerName"`
}

Player is the container with summoner information for a given match

type PlayerDto

type PlayerDto struct {
	ChampionID int   `json:"championId"`
	SummonerID int64 `json:"summonerId"`
	TeamID     int   `json:"teamId"`
}

PlayerDto is the container for basic player info in a game

type PlayerStatsSummaryDto

type PlayerStatsSummaryDto struct {
	AggregatedStats       AggregatedStatsDto `json:"aggregatedStats"`
	Losses                int                `json:"losses"`
	ModifyDate            int64              `json:"modifyDate"`
	PlayerStatSummaryType string             `json:"playerStatSummaryType"`
	Wins                  int                `json:"wins"`
}

PlayerStatsSummaryDto is the container for a given summary type (typically queue-based)

type PlayerStatsSummaryListDto

type PlayerStatsSummaryListDto struct {
	PlayerStatSummaries []PlayerStatsSummaryDto `json:"playerStatSummaries"`
	SummonerID          int64                   `json:"summonerId"`
}

PlayerStatsSummaryListDto is the container for all queue type information

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Position is the X and Y coords on the map

type RankedStatsDto

type RankedStatsDto struct {
	Champions  []ChampionStatsDto `json:"champions"`
	ModifyDate int64              `json:"modifyDate"`
	SummonerID int64              `json:"summonerId"`
}

RankedStatsDto is the container for ranked-related methods

type RawStatsDto

type RawStatsDto struct {
	Assists                         int  `json:"assists"`
	BarracksKilled                  int  `json:"barracksKilled"`
	ChampionsKilled                 int  `json:"championsKilled"`
	CombatPlayerScore               int  `json:"combatPlayerScore"`
	ConsumablesPurchased            int  `json:"consumablesPurchased"`
	DamageDealtPlayer               int  `json:"damageDealtPlayer"`
	DoubleKills                     int  `json:"doubleKills"`
	FirstBlood                      int  `json:"firstBlood"`
	Gold                            int  `json:"gold"`
	GoldEarned                      int  `json:"goldEarned"`
	GoldSpent                       int  `json:"goldSpent"`
	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"`
	LargestCriticalStrike           int  `json:"largestCriticalStrike"`
	LargestKillingSpree             int  `json:"largestKillingSpree"`
	LargestMultiKill                int  `json:"largestMultiKill"`
	LegendaryItemsCreated           int  `json:"legendaryItemsCreated"`
	Level                           int  `json:"level"`
	MagicDamageDealtPlayer          int  `json:"magicDamageDealtPlayer"`
	MagicDamageDealtToChampions     int  `json:"magicDamageDealtToChampions"`
	MagicDamageTaken                int  `json:"magicDamageTaken"`
	MinionsDenied                   int  `json:"minionsDenied"`
	MinionsKilled                   int  `json:"minionsKilled"`
	NeutralMinionsKilled            int  `json:"neutralMinionsKilled"`
	NeutralMinionsKilledEnemyJungle int  `json:"neutralMinionsKilledEnemyJungle"`
	NeutralMinionsKilledYourJungle  int  `json:"neutralMinionsKilledYourJungle"`
	NexusKilled                     bool `json:"nexusKilled"`
	NodeCapture                     int  `json:"nodeCapture"`
	NodeCaptureAssist               int  `json:"nodeCaptureAssist"`
	NodeNeutralize                  int  `json:"nodeNeutralize"`
	NodeNeutralizeAssist            int  `json:"nodeNeutralizeAssist"`
	NumDeaths                       int  `json:"numDeaths"`
	NumItemsBought                  int  `json:"numItemsBought"`
	ObjectivePlayerScore            int  `json:"objectivePlayerScore"`
	PentaKills                      int  `json:"pentaKills"`
	PhysicalDamageDealtPlayer       int  `json:"physicalDamageDealtPlayer"`
	PhysicalDamageDealtToChampions  int  `json:"physicalDamageDealtToChampions"`
	PhysicalDamageTaken             int  `json:"physicalDamageTaken"`
	PlayerPosition                  int  `json:"playerPosition"`
	PlayerRole                      int  `json:"playerRole"`
	QuadraKills                     int  `json:"quadraKills"`
	SightWardsBought                int  `json:"sightWardsBought"`
	Spell1Cast                      int  `json:"spell1Cast"`
	Spell2Cast                      int  `json:"spell2Cast"`
	Spell3Cast                      int  `json:"spell3Cast"`
	Spell4Cast                      int  `json:"spell4Cast"`
	SummonerSpell1Cast              int  `json:"summonerSpell1Cast"`
	SummonerSpell2Cast              int  `json:"summonerSpell2Cast"`
	SuperMonsterKilled              int  `json:"superMonsterKilled"`
	Team                            int  `json:"team"`
	TeamObjective                   int  `json:"teamObjective"`
	TimePlayed                      int  `json:"timePlayed"`
	TotalDamageDealt                int  `json:"totalDamageDealt"`
	TotalDamageDealtToChampions     int  `json:"totalDamageDealtToChampions"`
	TotalDamageTaken                int  `json:"totalDamageTaken"`
	TotalHeal                       int  `json:"totalHeal"`
	TotalPlayerScore                int  `json:"totalPlayerScore"`
	TotalScoreRank                  int  `json:"totalScoreRank"`
	TotalTimeCrowdControlDealt      int  `json:"totalTimeCrowdControlDealt"`
	TotalUnitsHealed                int  `json:"totalUnitsHealed"`
	TripleKills                     int  `json:"tripleKills"`
	TrueDamageDealtPlayer           int  `json:"trueDamageDealtPlayer"`
	TrueDamageDealtToChampions      int  `json:"trueDamageDealtToChampions"`
	TrueDamageTaken                 int  `json:"trueDamageTaken"`
	TurretsKilled                   int  `json:"turretsKilled"`
	UnrealKills                     int  `json:"unrealKills"`
	VictoryPointTotal               int  `json:"victoryPointTotal"`
	VisionWardsBought               int  `json:"visionWardsBought"`
	WardKilled                      int  `json:"wardKilled"`
	WardPlaced                      int  `json:"wardPlaced"`
	Win                             bool `json:"win"`
}

RawStatsDto is the container for a player's raw stats

type RealmDto

type RealmDto struct {
	CDN            string            `json:"cdn"`
	CSS            string            `json:"css"`
	DD             string            `json:"dd"`
	L              string            `json:"l"`
	LG             string            `json:"lg"`
	N              map[string]string `json:"n"`
	ProfileIconMax int               `json:"profileiconmax"`
	Store          string            `json:"store"`
	V              string            `json:"v"`
}

RealmDto is the container for realm info

type RecentGamesDto

type RecentGamesDto struct {
	Games      []GameDto `json:"games"`
	SummonerID int64     `json:"summonerId"`
}

RecentGamesDto is the container with recent games for a summoner

type RecommendedDto

type RecommendedDto struct {
	Blocks   []BlockDto `json:"blocks"`
	Champion string     `json:"champion"`
	Map      string     `json:"map"`
	Mode     string     `json:"mode"`
	Priority bool       `json:"priority"`
	Title    string     `json:"title"`
	Type     string     `json:"type"`
}

RecommendedDto is the container for champion-related recommendations

type Region

type Region int

Region is an "enum" convenience structure

const (
	// Na is North America
	Na Region = 0

	// Euw is Europe West
	Euw Region = 1

	// Eune is Europe Nordic East
	Eune Region = 2

	// Kr is Korea
	Kr Region = 3

	// Lan is Latin America North
	Lan Region = 4

	// Las is Latin America South
	Las Region = 5

	// Jp is Japan
	Jp Region = 6

	// Ru is Russia
	Ru Region = 7

	// Tr is Turkey
	Tr Region = 8

	// Oce is Oceania
	Oce Region = 9

	// Br is Brazil
	Br Region = 10

	// Pbe is Public Beta Environment
	Pbe Region = 11
)

type RiotAPIError

type RiotAPIError struct {
	Status          riotAPIErrorStatus `json:"status"`
	XRateLimitType  string             `json:"-"`
	RetryAfter      int                `json:"-"`
	XRateLimitCount int                `json:"-"`
}

RiotAPIError is the error structure returned by Riot (along with the headers returned for a 429 response)

func (*RiotAPIError) Error

func (e *RiotAPIError) Error() string

Error formats a RiotAPIError

type Rune

type Rune struct {
	Rank   int64 `json:"rank"`
	RuneID int64 `json:"runeId"`
}

Rune is the cotainer for basic rune utilization information

type RuneDto

type RuneDto struct {
	RuneID     int `json:"runeId"`
	RuneSlotID int `json:"runeSlotId"`
}

RuneDto is the container for a single rune in a rune page

type RuneListDto

type RuneListDto struct {
	Basic   BasicDataDto                 `json:"basic"`
	Data    map[string]StaticDataRuneDto `json:"data"`
	Type    string                       `json:"type"`
	Version string                       `json:"version"`
}

RuneListDto is the container for runes' data

type RunePageDto

type RunePageDto struct {
	ID      int       `json:"id"`
	Name    string    `json:"name"`
	Current bool      `json:"current"`
	Slots   []RuneDto `json:"slots"`
}

RunePageDto is the container for a single rune page

type RunePagesDto

type RunePagesDto struct {
	SummonerID int64         `json:"summonerId"`
	Pages      []RunePageDto `json:"pages"`
}

RunePagesDto is the container for all rune pages for a summoner

type Shard

type Shard struct {
	Hostname  string   `json:"hostname"`
	Locales   []string `json:"locales"`
	Name      string   `json:"name"`
	RegionTag string   `json:"region_tag"`
	Slug      string   `json:"slug"`
}

Shard is the container per server

type SkinDto

type SkinDto struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Num  int    `json:"num"`
}

SkinDto is the container for a champion's skin

type SpellVarsDto

type SpellVarsDto struct {
	Coeff     []float64 `json:"coeff"`
	Dyn       string    `json:"dyn"`
	Key       string    `json:"key"`
	Link      string    `json:"link"`
	RanksWith string    `json:"ranksWith"`
}

SpellVarsDto is the container for spell vars

type StaticDataChampionDto

type StaticDataChampionDto struct {
	AllyTips    []string           `json:"allytips"`
	Blurb       string             `json:"blurb"`
	EnemyTips   []string           `json:"enemytips"`
	ID          int                `json:"id"`
	Image       ImageDto           `json:"image"`
	Info        InfoDto            `json:"info"`
	Key         string             `json:"key"`
	Lore        string             `json:"lore"`
	Name        string             `json:"name"`
	ParType     string             `json:"partype"`
	Passive     PassiveDto         `json:"passive"`
	Recommended []RecommendedDto   `json:"recommended"`
	Skins       []SkinDto          `json:"skins"`
	Spells      []ChampionSpellDto `json:"spells"`
	Stats       StatsDto           `json:"stats"`
	Tags        []string           `json:"tags"`
	Title       string             `json:"title"`
}

StaticDataChampionDto is the container for a single champion's data

type StaticDataChampionListDto

type StaticDataChampionListDto struct {
	Data    map[string]StaticDataChampionDto `json:"data"`
	Format  string                           `json:"format"`
	Keys    map[string]string                `json:"keys"`
	Type    string                           `json:"type"`
	Version string                           `json:"version"`
}

StaticDataChampionListDto is the container for static champions' data

type StaticDataMasteryDto

type StaticDataMasteryDto struct {
	Description          []string `json:"description"`
	ID                   int      `json:"id"`
	Image                ImageDto `json:"image"`
	MasteryTree          string   `json:"masteryTree"`
	Name                 string   `json:"name"`
	Prereq               string   `json:"prereq"`
	Ranks                int      `json:"ranks"`
	SanitizedDescription []string `json:"sanitizedDescription"`
}

StaticDataMasteryDto is the container for a single mastery's data

type StaticDataRuneDto

type StaticDataRuneDto struct {
	Colloq               string            `json:"colloq"`
	ConsumeOnFull        bool              `json:"consumeOnFull"`
	Consumed             bool              `json:"consumed"`
	Depth                int               `json:"depth"`
	Description          string            `json:"description"`
	From                 []string          `json:"from"`
	Group                string            `json:"group"`
	HideFromAll          bool              `json:"hideFromAll"`
	ID                   int               `json:"id"`
	Image                ImageDto          `json:"image"`
	InStore              bool              `json:"inStore"`
	Into                 []string          `json:"into"`
	Maps                 map[string]bool   `json:"maps"`
	Name                 string            `json:"name"`
	PlainText            string            `json:"plaintext"`
	RequiredChampion     string            `json:"requiredChampion"`
	Rune                 MetaDataDto       `json:"rune"`
	SanitizedDescription string            `json:"sanitizedDescription"`
	SpecialRecipe        int               `json:"specialRecipe"`
	Stacks               int               `json:"stacks"`
	Stats                BasicDataStatsDto `json:"stats"`
	Tags                 []string          `json:"tags"`
}

StaticDataRuneDto is the container for a single rune's data

type StaticDataService

type StaticDataService struct {
	// contains filtered or unexported fields
}

StaticDataService is the endpoint to use for basic league of legends data

func (*StaticDataService) GetChampion

func (s *StaticDataService) GetChampion(ctx context.Context, championID int, params *GetChampionStaticDataParams) (*StaticDataChampionDto, error)

GetChampion gets the champion static data for a championID

func (*StaticDataService) GetChampions

GetChampions gets all champion static data

func (*StaticDataService) GetItem

func (s *StaticDataService) GetItem(ctx context.Context, itemID int, params *GetItemStaticDataParams) (*ItemDto, error)

GetItem gets the static data for an itemID

func (*StaticDataService) GetItems

GetItems gets all item static data

func (*StaticDataService) GetLanguageStrings

func (s *StaticDataService) GetLanguageStrings(ctx context.Context) (*LanguageStringsDto, error)

GetLanguageStrings gets the language strings

func (*StaticDataService) GetLanguages

func (s *StaticDataService) GetLanguages(ctx context.Context) (*[]string, error)

GetLanguages gets the languages

func (*StaticDataService) GetMasteries

GetMasteries gets all mastery static data

func (*StaticDataService) GetMastery

func (s *StaticDataService) GetMastery(ctx context.Context, masteryID int, params *GetMasteryStaticDataParams) (*StaticDataMasteryDto, error)

GetMastery gets the mastery static data for a given masteryID

func (*StaticDataService) GetRealm

func (s *StaticDataService) GetRealm(ctx context.Context) (*RealmDto, error)

GetRealm gets realm information

func (*StaticDataService) GetRune

GetRune gets the rune static data for a given runeID

func (*StaticDataService) GetRunes

GetRunes gets all rune static data

func (*StaticDataService) GetSummonerSpell

func (s *StaticDataService) GetSummonerSpell(ctx context.Context, summonerSpellID int, params *GetSummonerSpellStaticDataParams) (*SummonerSpellDto, error)

GetSummonerSpell gets the summoner spell static data for a given summonerSpellID

func (*StaticDataService) GetSummonerSpells

GetSummonerSpells gets all summoner spell static data

func (*StaticDataService) GetVersions

func (s *StaticDataService) GetVersions(ctx context.Context) (*[]string, error)

GetVersions gets the versions

type StatsDto

type StatsDto struct {
	Armor                float64 `json:"armor"`
	ArmorPerLevel        float64 `json:"armorperlevel"`
	AttackDamage         float64 `json:"attackdamage"`
	AttackDamagePerLevel float64 `json:"attackdamageperlevel"`
	AttackRange          float64 `json:"attackrange"`
	AttackSpeedOffset    float64 `json:"attackspeedoffset"`
	AttackSpeedPerLevel  float64 `json:"attackspeedperlevel"`
	Crit                 float64 `json:"crit"`
	CritPerLevel         float64 `json:"critperlevel"`
	Hp                   float64 `json:"hp"`
	HpPerLevel           float64 `json:"hpperlevel"`
	HpRegen              float64 `json:"hpregen"`
	HpRegenPerLevel      float64 `json:"hpregenperlevel"`
	Movespeed            float64 `json:"movespeed"`
	Mp                   float64 `json:"mp"`
	MpPerLevel           float64 `json:"mpperlevel"`
	MpRegen              float64 `json:"mpregen"`
	MpRegenPerLevel      float64 `json:"mpregenperlevel"`
	Spellblock           float64 `json:"spellblock"`
	SpellblockPerLevel   float64 `json:"spellblockperlevel"`
}

StatsDto is the container for a champion's stats

type StatsService

type StatsService struct {
	// contains filtered or unexported fields
}

StatsService is the endpoint to get cumulative statistic information

func (*StatsService) GetRankedBySummoner

func (s *StatsService) GetRankedBySummoner(ctx context.Context, summonerID int64, params *GetStatsParams) (*RankedStatsDto, error)

GetRankedBySummoner gets the ranked stats for a given summonerID

func (*StatsService) GetSummaryBySummoner

func (s *StatsService) GetSummaryBySummoner(ctx context.Context, summonerID int64, params *GetStatsParams) (*PlayerStatsSummaryListDto, error)

GetSummaryBySummoner gets all basic stats for a given summonerID

type StatusService

type StatusService struct {
	// contains filtered or unexported fields
}

StatusService is the endpoint to use to get server related information

func (*StatusService) Get

func (s *StatusService) Get(ctx context.Context, region Region) (*Shard, error)

Get gets the shard for a given region

func (*StatusService) GetAll

func (s *StatusService) GetAll(ctx context.Context) (*[]Shard, error)

GetAll gets all shards

type SummonerDto

type SummonerDto struct {
	ID            int64  `json:"id"`
	Name          string `json:"name"`
	ProfileIconID int    `json:"profileIconId"`
	SummonerLevel int64  `json:"summonerLevel"`
	RevisionDate  int64  `json:"revisionDate"`
}

SummonerDto is the container for a single summoner

type SummonerService

type SummonerService struct {
	// contains filtered or unexported fields
}

SummonerService is the endpoint to use to get summoner information

func (*SummonerService) Get

func (s *SummonerService) Get(ctx context.Context, summonerIDs ...int64) (*map[int64]SummonerDto, error)

Get gets the summoner information for summonerIDs (at most 40); the map keys are the summonerIDs

func (*SummonerService) GetByName

func (s *SummonerService) GetByName(ctx context.Context, summonerNames ...string) (*map[string]SummonerDto, error)

GetByName gets the summoner information for summonerNames (at most 40); the map keys are the summonerNames

func (*SummonerService) GetMasteries

func (s *SummonerService) GetMasteries(ctx context.Context, summonerIDs ...int64) (*map[int64]MasteryPagesDto, error)

GetMasteries gets the masteries for the summonerIDs (at most 40); the map keys are the summonerIDs

func (*SummonerService) GetNames

func (s *SummonerService) GetNames(ctx context.Context, summonerIDs ...int64) (*map[int64]string, error)

GetNames gets the summoner names for the summonerIDs (at most 40); the map keys are the summonerIDs

func (*SummonerService) GetRunes

func (s *SummonerService) GetRunes(ctx context.Context, summonerIDs ...int64) (*map[int64]RunePagesDto, error)

GetRunes gets the runes for the summonerIDs (at most 40); the map keys are the summonerIDs

type SummonerSpellDto

type SummonerSpellDto struct {
	Cooldown             []float64      `json:"cooldown"`
	CooldownBurn         string         `json:"cooldownBurn"`
	Cost                 []int          `json:"cost"`
	CostBurn             string         `json:"costBurn"`
	CostType             string         `json:"costType"`
	Description          string         `json:"description"`
	Effect               [][]float64    `json:"effect"`
	EffectBurn           []string       `json:"effectBurn"`
	ID                   int            `json:"id"`
	Image                ImageDto       `json:"image"`
	Key                  string         `json:"key"`
	LevelTip             LevelTipDto    `json:"levelTip"`
	MaxRank              int            `json:"maxrank"`
	Modes                []string       `json:"modes"`
	Name                 string         `json:"name"`
	Range                interface{}    `json:"range"`
	RangeBurn            string         `json:"rangeBurn"`
	Resource             string         `json:"resource"`
	SanitizedDescription string         `json:"sanitizedDescription"`
	SanitizedTooltip     string         `json:"sanitizedTooltip"`
	SummonerLevel        int            `json:"summonerLevel"`
	Tooltip              string         `json:"tooltip"`
	Vars                 []SpellVarsDto `json:"vars"`
}

SummonerSpellDto is the container for a single summoner spell's data

type SummonerSpellListDto

type SummonerSpellListDto struct {
	Data    map[string]SummonerSpellDto `json:"data"`
	Type    string                      `json:"type"`
	Version string                      `json:"version"`
}

SummonerSpellListDto is the container for summoner spells' data

type Team

type Team struct {
	Bans                 []BannedChampion `json:"bans"`
	BaronKills           int              `json:"baronKills"`
	DominionVictoryScore int64            `json:"dominionVictoryScore"`
	DragonKills          int              `json:"dragonKills"`
	FirstBaron           bool             `json:"firstBaron"`
	FirstBlood           bool             `json:"firstBlood"`
	FirstDragon          bool             `json:"firstDragon"`
	FirstInhibitor       bool             `json:"firstInhibitor"`
	FirstRiftHerald      bool             `json:"firstRiftHerald"`
	FirstTower           bool             `json:"firstTower"`
	InhibitorKills       int              `json:"inhibitorKills"`
	RiftHeraldKills      int              `json:"riftHeraldKills"`
	TeamID               int              `json:"teamId"`
	TowerKills           int              `json:"towerKills"`
	VilemawKills         int              `json:"vilemawKills"`
	Winner               bool             `json:"winner"`
}

Team is the container with basic team information

type Timeline

type Timeline struct {
	FrameInterval int64   `json:"frameInterval"`
	Frames        []Frame `json:"frames"`
}

Timeline is the container to show events in a match

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL