ionia

package module
v0.0.0-...-18c9058 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: MIT Imports: 12 Imported by: 0

README

ionia

GoDoc Build Status Coverage Status Go Report Card

ionia is a Go client library for accessing the Riot API

TODO

ionia is still a work in progress. Things still to do:

  • Regional proxies
  • Write tests for remaining services
  • Add better descriptions to many data types and functions
  • Possibly add Riot-defined constants (e.g. region IDs)
Usage
import "github.com/brattonross/ionia"

Create a new ionia client, then use the client to access the various services of the Riot API. Example:

// Note: The default region for the client is NA.
// See below for examples of how to customize the client.
client := ionia.NewClient("my-riot-api-key")

// Retrieve information for a summoner name.
summoner, _, err := client.Summoner.BySummonerName("Doublelift")

Another example:

// Modify the client's region using ionia's built in WithRegion function.
client := ionia.NewClient("my-riot-api-key", ionia.WithRegion("EUW1"))

The above code will create a new client with the API key "my-riot-api-key", and the region "EUW1".

Example of an API method that takes optional parameters:

client := ionia.NewClient("my-riot-api-key")

// Retrieve a list of champions, and order the data by ID.
champions, _, err := client.StaticData.Champions(func(s *StaticDataChampionsOptions) {
    s.DataByID = true
})
Rate Limiting

Riot imposes a rate limit on a per key, per method, and per service basis. The ionia client aims to respect those limits, and does not perform requests to the Riot API if it detects that a rate limit will be / has been breached. Rate limits imposed by Riot will vary per user.

Learn more about rate limiting at https://developer.riotgames.com/rate-limiting.html.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BannedChampion

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

BannedChampion contains information about a banned champion.

type BlockDTO

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

BlockDTO contains champion recommended block data.

type BlockItemDTO

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

BlockItemDTO contains champion recommended block item data.

type ChampionDTO

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

ChampionDTO contains champion information.

type ChampionListDTO

type ChampionListDTO struct {
	Champions []ChampionDTO `json:"champions"`
}

ChampionListDTO contains a collection of champion information.

type ChampionMasteryDTO

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

ChampionMasteryDTO contains Champion Mastery information for player and champion combination.

type ChampionMasteryService

type ChampionMasteryService service

ChampionMasteryService represents the Champion-Mastery-V3 API methods. https://developer.riotgames.com/api-methods/#champion-mastery-v3

func (*ChampionMasteryService) BySummonerAndChampionID

func (c *ChampionMasteryService) BySummonerAndChampionID(summonerID, championID int64) (*ChampionMasteryDTO, *http.Response, error)

BySummonerAndChampionID gets a champion mastery for the given summoner ID and champion ID combination.

func (*ChampionMasteryService) MasteryBySummonerID

func (c *ChampionMasteryService) MasteryBySummonerID(summonerID int64) ([]ChampionMasteryDTO, *http.Response, error)

MasteryBySummonerID gets all champion mastery entries sorted by number of champion points in descending order.

func (*ChampionMasteryService) ScoreBySummonerID

func (c *ChampionMasteryService) ScoreBySummonerID(summonerID int64) (int, *http.Response, error)

ScoreBySummonerID gets a summoner's total champion mastery score by ID. The score is the sum of all individual champion mastery levels.

type ChampionService

type ChampionService service

ChampionService represents the Champion-V3 API methods. https://developer.riotgames.com/api-methods/#champion-v3

func (*ChampionService) All

All lists all of the currently available champions.

func (*ChampionService) ByID

func (c *ChampionService) ByID(id int) (*ChampionDTO, *http.Response, error)

ByID retrieves champion information by ID.

type ChampionSpellDTO

type ChampionSpellDTO struct {
	CooldownBurn         string         `json:"cooldownBurn"`
	Resource             string         `json:"resource"`
	LevelTip             LevelTipDTO    `json:"levelTip"`
	Vars                 []SpellVarsDTO `json:"vars"`
	CostType             string         `json:"costType"`
	Image                ImageDTO       `json:"image"`
	SanitizedDescription string         `json:"sanitizedDescription"`
	SanitizedTooltip     string         `json:"sanitizedTooltip"`
	Effect               [][]float64    `json:"effect"`
	Tooltip              string         `json:"tooltip"`
	MaxRank              int            `json:"maxrank"`
	CostBurn             string         `json:"costBurn"`
	RangeBurn            string         `json:"rangeBurn"`
	Range                interface{}    `json:"range"` // Either []int or string ("self")
	Cooldown             []float64      `json:"cooldown"`
	Cost                 []int          `json:"cost"`
	Key                  string         `json:"key"`
	Description          string         `json:"description"`
	EffectBurn           []string       `json:"effectBurn"`
	AltImages            []ImageDTO     `json:"altimages"`
	Name                 string         `json:"name"`
}

ChampionSpellDTO contains champion spell data.

type Client

type Client struct {
	BaseURL *url.URL

	// API Sections.
	ChampionMastery *ChampionMasteryService
	Champion        *ChampionService
	League          *LeagueService
	StaticData      *StaticDataService
	Status          *StatusService
	Match           *MatchService
	Spectator       *SpectatorService
	Summoner        *SummonerService
	ThirdPartyCode  *ThirdPartyCodeService
	TournamentStub  *TournamentStubService
	Tournament      *TournamentService
	// contains filtered or unexported fields
}

Client manages communication with the Riot API.

func NewClient

func NewClient(riotToken string, opts ...ClientOption) *Client

NewClient creates a new Riot API client. Any number of ClientOptions can be passed, and will be applied after the default client has been created.

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

Do sends an API request and returns the API response. The API response is decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates a new API request. A relative URL can be provided in urlStr, in which case it is resolved to the BaseURL of the Client. Relative URLs should always be specified with out a preceding slash.

type ClientOption

type ClientOption func(*Client)

ClientOption is a function which modifies the ionia client.

func WithRegion

func WithRegion(region string) ClientOption

WithRegion returns a ClientOption which sets the Client's region to the given value.

type Count

type Count struct {
	Used    int
	Seconds int
}

Count represents a rate limit count return by a request.

type CurrentGameInfo

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

CurrentGameInfo contains current game info.

type CurrentGameParticipant

type CurrentGameParticipant struct {
	ProfileIconID            int64                     `json:"profileIconId"`
	ChampionID               int64                     `json:"championId"`
	SummonerName             string                    `json:"summonerName"`
	GameCustomizationObjects []GameCustomizationObject `json:"gameCustomizationObjects"`
	Bot                      bool                      `json:"bot"`
	Perks                    Perks                     `json:"perks"`
	Spell2ID                 int64                     `json:"spell2Id"`
	TeamID                   int64                     `json:"teamId"`
	Spell1ID                 int64                     `json:"spell1Id"`
	SummonerID               int64                     `json:"summonerId"`
}

CurrentGameParticipant contains current game participant information.

type FeaturedGameInfo

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

FeaturedGameInfo contains featured game information.

type FeaturedGames

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

FeaturedGames contains featured games information.

type GameCustomizationObject

type GameCustomizationObject struct {
	Category string `json:"category"`
	Content  string `json:"content"`
}

GameCustomizationObject contains game customization information.

type GoldDTO

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

GoldDTO contains item gold data.

type GroupDTO

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

GroupDTO contains item group data.

type ImageDTO

type ImageDTO struct {
	Full   string `json:"full"`
	Group  string `json:"group"`
	Sprite string `json:"sprite"`
	H      int    `json:"h"`
	W      int    `json:"w"`
	Y      int    `json:"y"`
	X      int    `json:"x"`
}

ImageDTO contains image data.

type Incident

type Incident struct {
	Active    bool      `json:"active"`
	CreatedAt string    `json:"created_at"`
	ID        int64     `json:"id"`
	Updates   []Message `json:"updates"`
}

Incident contains incident data.

type InfoDTO

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

InfoDTO contains champion information.

type InventoryDataStatsDTO

type InventoryDataStatsDTO struct {
	PercentCritDamageMod     float64 `json:"PercentCritDamageMod"`
	PercentSpellBlockMod     float64 `json:"PercentSpellBlockMod"`
	PercentHPRegenMod        float64 `json:"PercentHPRegenMod"`
	PercentMovementSpeedMod  float64 `json:"PercentMovementSpeedMod"`
	FlatSpellBlockMod        float64 `json:"FlatSpellBlockMod"`
	FlatCritDamageMod        float64 `json:"FlatCritDamageMod"`
	FlatEnergyPoolMod        float64 `json:"FlatEnergyPoolMod"`
	PercentLifeStealMod      float64 `json:"PercentLifeStealMod"`
	FlatMPPoolMod            float64 `json:"FlatMPPoolMod"`
	FlatMovementSpeedMod     float64 `json:"FlatMovementSpeedMod"`
	PercentAttackSpeedMod    float64 `json:"PercentAttackSpeedMod"`
	FlatBlockMod             float64 `json:"FlatBlockMod"`
	PercentBlockMod          float64 `json:"PercentBlockMod"`
	FlatEnergyRegenMod       float64 `json:"FlatEnergyRegenMod"`
	PercentSpellVampMod      float64 `json:"PercentSpellVampMod"`
	FlatMPRegenMod           float64 `json:"FlatMPRegenMod"`
	PercentDodgeMod          float64 `json:"PercentDodgeMod"`
	FlatAttackSpeedMod       float64 `json:"FlatAttackSpeedMod"`
	FlatArmorMod             float64 `json:"FlatArmorMod"`
	FlatHPRegenMod           float64 `json:"FlatHPRegenMod"`
	PercentMagicDamageMod    float64 `json:"PercentMagicDamageMod"`
	PercentMPPoolMod         float64 `json:"PercentMPPoolMod"`
	FlatMagicDamageMod       float64 `json:"FlatMagicDamageMod"`
	PercentMPRegenMod        float64 `json:"PercentMPRegenMod"`
	PercentPhysicalDamageMod float64 `json:"PercentPhysicalDamageMod"`
	FlatPhysicalDamageMod    float64 `json:"FlatPhysicalDamageMod"`
	PercentHPPoolMod         float64 `json:"PercentHPPoolMod"`
	PercentArmorMod          float64 `json:"PercentArmorMod"`
	PercentCritChanceMod     float64 `json:"PercentCritChanceMod"`
	PercentEXPBonus          float64 `json:"PercentEXPBonus"`
	FlatHPPoolMod            float64 `json:"FlatHPPoolMod"`
	FlatCritChanceMod        float64 `json:"FlatCritChanceMod"`
	FlatEXPBonus             float64 `json:"FlatEXPBonus"`
}

InventoryDataStatsDTO contains stats for inventory (e.g. runes and items).

type ItemDTO

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

ItemDTO contains item data.

type ItemListDTO

type ItemListDTO struct {
	Data    map[string]ItemDTO `json:"data"`
	Version string             `json:"version"`
	Tree    []ItemTreeDTO      `json:"tree"`
	Groups  []GroupDTO         `json:"groups"`
	Type    string             `json:"type"`
}

ItemListDTO contains item list data.

type ItemTreeDTO

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

ItemTreeDTO contains item tree data.

type LanguageStringsDTO

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

LanguageStringsDTO contains language strings data.

type LeagueItemDTO

type LeagueItemDTO struct {
	Rank             string        `json:"rank"`
	HotStreak        bool          `json:"hotStreak"`
	MiniSeries       MiniSeriesDTO `json:"miniSeries"`
	Wins             int           `json:"wins"`
	Veteran          bool          `json:"veteran"`
	Losses           int           `json:"losses"`
	FreshBlood       bool          `json:"freshBlood"`
	PlayerOrTeamName string        `json:"playerOrTeamName"`
	Inactive         bool          `json:"inactive"`
	PlayerOrTeamID   string        `json:"playerOrTeamId"`
	LeaguePoints     int           `json:"leaguePoints"`
}

LeagueItemDTO represents a player or ranked team in a league.

type LeagueListDTO

type LeagueListDTO struct {
	LeagueID string          `json:"leagueId"`
	Tier     string          `json:"tier"`
	Entries  []LeagueItemDTO `json:"entries"`
	Queue    string          `json:"queue"`
	Name     string          `json:"name"`
}

LeagueListDTO contains information about a ranked league.

type LeaguePositionDTO

type LeaguePositionDTO struct {
	Rank             string        `json:"rank"`
	QueueType        string        `json:"queueType"`
	HotStreak        bool          `json:"hotStreak"`
	MiniSeries       MiniSeriesDTO `json:"miniSeries"`
	Wins             int           `json:"wins"`
	Veteran          bool          `json:"veteran"`
	Losses           int           `json:"losses"`
	FreshBlood       bool          `json:"freshBlood"`
	LeagueID         string        `json:"leagueId"`
	PlayerOrTeamName string        `json:"playerOrTeamName"`
	Inactive         bool          `json:"inactive"`
	PlayerOrTeamID   string        `json:"playerOrTeamId"`
	LeagueName       string        `json:"leagueName"`
	Tier             string        `json:"tier"`
	LeaguePoints     int           `json:"leaguePoints"`
}

LeaguePositionDTO represents the position of a summoner in a league.

type LeagueService

type LeagueService service

LeagueService represents the League-V3 API methods. https://developer.riotgames.com/api-methods/#league-v3

func (*LeagueService) ByLeagueID

func (l *LeagueService) ByLeagueID(leagueID string) (*LeagueListDTO, *http.Response, error)

ByLeagueID gets information for the league with the given ID, including inactive entries.

WARNING: Consistently looking up leagues that don't exist will result in a blacklist.

func (*LeagueService) ChallengerLeagueByQueue

func (l *LeagueService) ChallengerLeagueByQueue(queue string) (*LeagueListDTO, *http.Response, error)

ChallengerLeagueByQueue gets the challenger league information for the given queue.

func (*LeagueService) MasterLeagueByQueue

func (l *LeagueService) MasterLeagueByQueue(queue string) (*LeagueListDTO, *http.Response, error)

MasterLeagueByQueue gets the master league information for the given queue.

func (*LeagueService) PositionsBySummonerID

func (l *LeagueService) PositionsBySummonerID(summonerID int64) ([]LeaguePositionDTO, *http.Response, error)

PositionsBySummonerID gets league positions in all queues for the given summoner ID.

type LevelTipDTO

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

LevelTipDTO contains champion level tip data.

type Limit

type Limit struct {
	Allowed int
	Seconds int
}

Limit represents a limit returned by a request. These limits are the Application, Method, and Service rate limits.

type LobbyEventDTO

type LobbyEventDTO struct {
	EventType  string `json:"eventType"`
	SummonerID string `json:"summonerId"`
	Timestamp  string `json:"timestamp"`
}

LobbyEventDTO contains lobby event data.

type LobbyEventDTOWrapper

type LobbyEventDTOWrapper struct {
	EventList []LobbyEventDTO `json:"eventList"`
}

LobbyEventDTOWrapper contains a slice of LobbyEventDTO.

type MapDataDTO

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

MapDataDTO contains map data.

type MapDetailsDTO

type MapDetailsDTO struct {
	MapName               string   `json:"mapName"`
	Image                 ImageDTO `json:"image"`
	MapID                 int64    `json:"mapId"`
	UnpurchasableItemList []int64  `json:"unpurchasableItemList"`
}

MapDetailsDTO contains map details data.

type MasteryDTO

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

MasteryDTO contains mastery data.

type MasteryListDTO

type MasteryListDTO struct {
	Data    map[string]MasteryDTO `json:"data"`
	Version string                `json:"version"`
	Tree    MasteryTreeDTO        `json:"tree"`
	Type    string                `json:"type"`
}

MasteryListDTO contains mastery list data.

type MasteryTreeDTO

type MasteryTreeDTO struct {
	Resolve  []MasteryTreeListDTO `json:"Resolve"`
	Defense  []MasteryTreeListDTO `json:"Defense"`
	Utility  []MasteryTreeListDTO `json:"Utility"`
	Offense  []MasteryTreeListDTO `json:"Offense"`
	Ferocity []MasteryTreeListDTO `json:"Ferocity"`
	Cunning  []MasteryTreeListDTO `json:"Cunning"`
}

MasteryTreeDTO contains mastery tree data.

type MasteryTreeItemDTO

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

MasteryTreeItemDTO contains mastery tree item data.

type MasteryTreeListDTO

type MasteryTreeListDTO struct {
	MasteryTreeItems []MasteryTreeItemDTO `json:"masteryTreeItems"`
}

MasteryTreeListDTO contains mastery tree list data.

type MatchByAccountIDOption

type MatchByAccountIDOption func(*MatchByAccountIDOptions)

MatchByAccountIDOption is a function which modifies the MatchByAccountIDOptions.

type MatchByAccountIDOptions

type MatchByAccountIDOptions struct {
	// The end time to use for filtering matchlist specified as epoch milliseconds.
	// If beginTime is specified, but not endTime, then these parameters are ignored.
	// If endTime is specified, but not beginTime, then beginTime defaults to the start
	// of the account's match history. If both are specified, then endTime should be
	// greater than beginTime. The maximum time range allowed is one week, otherwise
	// a 400 error code is returned.
	EndTime int64 `url:"endTime"`

	// The begin index to use for filtering matchlist. If beginIndex is specified,
	// but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is
	// specified, but not beginIndex, then beginIndex defaults to 0. If both are
	// specified, then endIndex must be greater than beginIndex. The maximum range
	// allowed is 100, otherwise a 400 error code is returned.
	BeginIndex int `url:"beginIndex"`

	// The begin time to use for filtering matchlist specified as epoch milliseconds.
	// If beginTime is specified, but not endTime, then these parameters are ignored.
	// If endTime is specified, but not beginTime, then beginTime defaults to the start
	// of the account's match history. If both are specified, then endTime should be
	// greater than beginTime. The maximum time range allowed is one week, otherwise a
	// 400 error code is returned.
	BeginTime int64 `url:"beginTime"`

	// Slice of champion IDs for filtering the matchlist.
	Champion []int `url:"champion"`

	// 	The end index to use for filtering matchlist. If beginIndex is specified, but
	// not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified,
	// but not beginIndex, then beginIndex defaults to 0. If both are specified, then
	// endIndex must be greater than beginIndex. The maximum range allowed is 100,
	// otherwise a 400 error code is returned.
	EndIndex int `url:"endIndex"`

	// Slice of queue IDs for filtering the matchlist.
	Queue []int `url:"queue"`

	// Slice of season IDs for filtering the matchlist.
	Season []int `url:"season"`
}

MatchByAccountIDOptions specifies the optional parameters for the match by account ID service method.

type MatchDTO

type MatchDTO struct {
	SeasonID              int                      `json:"seasonId"`
	QueueID               int                      `json:"queueId"`
	GameID                int64                    `json:"gameId"`
	ParticipantIdentities []ParticipantIdentityDTO `json:"participantIdentities"`
	GameVersion           string                   `json:"gameVersion"`
	PlatformID            string                   `json:"platformId"`
	GameMode              string                   `json:"gameMode"`
	MapID                 int                      `json:"mapId"`
	GameType              string                   `json:"gameType"`
	Teams                 []TeamStatsDTO           `json:"teams"`
	Participants          []ParticipantDTO         `json:"participants"`
	GameDuration          int64                    `json:"gameDuration"`
	GameCreation          int64                    `json:"gameCreation"`
}

MatchDTO contains match data.

type MatchEventDTO

type MatchEventDTO struct {
	EventType               string           `json:"eventType"`
	TowerType               string           `json:"towerType"`
	TeamID                  int              `json:"teamId"`
	AscendedType            string           `json:"ascendedType"`
	KillerID                int              `json:"killerId"`
	LevelUpType             string           `json:"levelUpType"`
	PointCaptured           string           `json:"pointCaptured"`
	AssistingParticipantIds []int            `json:"assistingParticipantIds"`
	WardType                string           `json:"wardType"`
	MonsterType             string           `json:"monsterType"`
	Type                    string           `json:"type"`
	SkillSlot               int              `json:"skillSlot"`
	VictimID                int              `json:"victimId"`
	Timestamp               int64            `json:"timestamp"`
	AfterID                 int              `json:"afterId"`
	MonsterSubType          string           `json:"monsterSubType"`
	LaneType                string           `json:"laneType"`
	ItemID                  int              `json:"itemId"`
	ParticipantID           int              `json:"participantId"`
	BuildingType            string           `json:"buildingType"`
	CreatorID               int              `json:"creatorId"`
	Position                MatchPositionDTO `json:"position"`
	BeforeID                int              `json:"beforeId"`
}

MatchEventDTO contains information about a match event.

Type Legal Values: CHAMPION_KILL, WARD_PLACED, WARD_KILL, BUILDING_KILL, ELITE_MONSTER_KILL, ITEM_PURCHASED, ITEM_SOLD, ITEM_DESTROYED, ITEM_UNDO, SKILL_LEVEL_UP, ASCENDED_EVENT, CAPTURE_POINT, PORO_KING_SUMMON.

type MatchFrameDTO

type MatchFrameDTO struct {
	Timestamp         int64                            `json:"timestamp"`
	ParticipantFrames map[int]MatchParticipantFrameDTO `json:"participantFrames"`
	Events            []MatchEventDTO                  `json:"events"`
}

MatchFrameDTO contains match frame data.

type MatchMasteryDTO

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

MatchMasteryDTO contains mastery data for a match.

type MatchParticipantFrameDTO

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

MatchParticipantFrameDTO contains participant frame data for a match.

type MatchPositionDTO

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

MatchPositionDTO contains information about the position of an object on the map.

type MatchReferenceDTO

type MatchReferenceDTO struct {
	Lane       string `json:"lane"`
	GameID     int64  `json:"gameId"`
	Champion   int    `json:"champion"`
	PlatformID string `json:"platformId"`
	Season     int    `json:"season"`
	Queue      int    `json:"queue"`
	Role       string `json:"role"`
	Timestamp  int64  `json:"timestamp"`
}

MatchReferenceDTO contains match reference data.

type MatchRuneDTO

type MatchRuneDTO struct {
	RuneID int `json:"runeId"`
	Rank   int `json:"rank"`
}

MatchRuneDTO contains rune data for a match.

type MatchService

type MatchService service

MatchService represents the Match-V3 API methods. https://developer.riotgames.com/api-methods/#match-v3

func (*MatchService) MatchByID

func (m *MatchService) MatchByID(matchID int64) (*MatchDTO, *http.Response, error)

MatchByID retrieves match data by ID.

func (*MatchService) MatchByIDAndTournamentCode

func (m *MatchService) MatchByIDAndTournamentCode(matchID int64, tournamentCode string) (*MatchDTO, *http.Response, error)

MatchByIDAndTournamentCode retrieves a match by ID and tournament code.

func (*MatchService) MatchIDsByTournamentCode

func (m *MatchService) MatchIDsByTournamentCode(tournamentCode string) ([]int64, *http.Response, error)

MatchIDsByTournamentCode retrieves match IDs for the given tournament code.

func (*MatchService) MatchTimelineByID

func (m *MatchService) MatchTimelineByID(matchID int64) (*MatchTimelineDTO, *http.Response, error)

MatchTimelineByID retrieves a match timeline by match ID.

func (*MatchService) MatchesByAccountID

func (m *MatchService) MatchesByAccountID(accountID int64, opts ...MatchByAccountIDOption) (*MatchlistDTO, *http.Response, error)

MatchesByAccountID retrieves matches by account ID.

func (*MatchService) RecentMatches

func (m *MatchService) RecentMatches(accountID int64) (*MatchlistDTO, *http.Response, error)

RecentMatches retrieves the last 20 matches played on a given account ID.

type MatchTimelineDTO

type MatchTimelineDTO struct {
	Frames        []MatchFrameDTO `json:"frames"`
	FrameInterval int64           `json:"frameInterval"`
}

MatchTimelineDTO contains match timeline data.

type MatchlistDTO

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

MatchlistDTO contains match list data.

type Message

type Message struct {
	Severity     string        `json:"severity"`
	Author       string        `json:"author"`
	CreatedAt    string        `json:"created_at"`
	Translations []Translation `json:"translations"`
	UpdatedAt    string        `json:"updated_at"`
	Content      string        `json:"content"`
	ID           string        `json:"id"`
}

Message contains message data.

type MetaDataDTO

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

MetaDataDTO contains meta data.

type MiniSeriesDTO

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

MiniSeriesDTO contains information about a league item's current mini series.

type Observer

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

Observer contains observer information.

type Participant

type Participant struct {
	ProfileIconID int64  `json:"profileIconId"`
	ChampionID    int64  `json:"championId"`
	SummonerName  string `json:"summonerName"`
	Bot           bool   `json:"bot"`
	Spell2ID      int64  `json:"spell2Id"`
	TeamID        int64  `json:"teamId"`
	Spell1ID      int64  `json:"spell1Id"`
}

Participant contains participant information.

type ParticipantDTO

type ParticipantDTO struct {
	Stats                     ParticipantStatsDTO    `json:"stats"`
	ParticipantID             int                    `json:"participantId"`
	Runes                     []RuneDTO              `json:"runes"`
	Timeline                  ParticipantTimelineDTO `json:"timeline"`
	TeamID                    int                    `json:"teamId"`
	Spell2ID                  int                    `json:"spell2Id"`
	Masteries                 []MasteryDTO           `json:"masteries"`
	HighestAchievedSeasonTier string                 `json:"highestAchievedSeasonTier"`
	Spell1ID                  int                    `json:"spell1Id"`
	ChampionID                int                    `json:"championId"`
}

ParticipantDTO contains participant data.

type ParticipantIdentityDTO

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

ParticipantIdentityDTO contains participant identity data.

type ParticipantStatsDTO

type ParticipantStatsDTO 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"`
}

ParticipantStatsDTO contains participant stats data.

type ParticipantTimelineDTO

type ParticipantTimelineDTO 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"`
	CPPerMinDeltas              map[string]float64 `json:"xpPerMinDeltas"`
	Role                        string             `json:"role"`
	DamageTakenDiffPerMinDeltas map[string]float64 `json:"damageTakenDiffPerMinDeltas"`
	DamageTakenPerMinDeltas     map[string]float64 `json:"damageTakenPerMinDeltas"`
}

ParticipantTimelineDTO contains participant timeline data.

type PassiveDTO

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

PassiveDTO contains champion passive data.

type Perks

type Perks struct {
	PerkStyle    int64   `json:"perkStyle"`
	PerkIDs      []int64 `json:"perkids"`
	PerkSubStyle int64   `json:"perkSubStyle"`
}

Perks contains perks information.

type PlayerDTO

type PlayerDTO 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"`
}

PlayerDTO contains player data.

type ProfileIconDataDTO

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

ProfileIconDataDTO contains profile icon data.

type ProfileIconDetailsDTO

type ProfileIconDetailsDTO struct {
	Image ImageDTO `json:"image"`
	ID    int64    `json:"id"`
}

ProfileIconDetailsDTO contains profile icon details data.

type ProviderRegistration

type ProviderRegistration struct {
	// The provider's callback URL to which tournament game results in this region should
	// be posted. The URL must be well-formed, use the http or https protocol, and use
	// the default port for the protocol (http URLs must use port 80, https URLs must
	// use port 443).
	URL string `json:"url"`

	// The region in which the provider will be running tournaments.
	// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR)
	Region string `json:"region"`
}

ProviderRegistration specifies the required parameters for the Tournament Stub providers service method.

type Rate

type Rate struct {
	Limits map[int]Limit
	Counts map[int]Count
}

Rate represents the current rate limit state of a rate limit. This can be either an Application, Method, or Service rate limit.

type RealmDTO

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

RealmDTO contains realm data.

type RecommendedDTO

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

RecommendedDTO contains champion recommended data.

type ReforgedRuneDTO

type ReforgedRuneDTO struct {
	RunePathName string `json:"runePathName"`
	RunePathID   int    `json:"runePathId"`
	Name         string `json:"name"`
	ID           int    `json:"id"`
	Key          string `json:"key"`
	ShortDesc    string `json:"shortDesc"`
	LongDesc     string `json:"longDesc"`
	Icon         string `json:"icon"`
}

ReforgedRuneDTO contains reforged rune data.

type ReforgedRunePathDTO

type ReforgedRunePathDTO struct {
	Slots []ReforgedRuneSlotDTO `json:"slots"`
	Icon  string                `json:"icon"`
	ID    int                   `json:"id"`
	Key   string                `json:"key"`
	Name  string                `json:"name"`
}

ReforgedRunePathDTO contains reforged rune path data.

type ReforgedRuneSlotDTO

type ReforgedRuneSlotDTO struct {
	Runes []ReforgedRuneDTO `json:"runes"`
}

ReforgedRuneSlotDTO contains reforged rune slot data.

type RuneDTO

type RuneDTO struct {
	Stats                RuneStatsDTO `json:"stats"`
	Name                 string       `json:"name"`
	Tags                 []string     `json:"tags"`
	Image                ImageDTO     `json:"image"`
	SanitizedDescription string       `json:"sanitizedDescription"`
	Rune                 MetaDataDTO  `json:"rune"`
	ID                   int          `json:"id"`
	Description          string       `json:"description"`
}

RuneDTO contains rune data.

type RuneListDTO

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

RuneListDTO contains rune list data.

type RuneStatsDTO

type RuneStatsDTO struct {
	PercentTimeDeadModPerLevel         int64
	PercentArmorPenetrationModPerLevel int64
	PercentCritDamageMod               int64
	PercentSpellBlockMod               int64
	PercentHPRegenMod                  int64
	PercentMovementSpeedMod            int64
	FlatSpellBlockMod                  int64
	FlatEnergyRegenModPerLevel         int64
	FlatEnergyPoolMod                  int64
	FlatMagicPenetrationModPerLevel    int64
	PercentLifeStealMod                int64
	FlatMPPoolMod                      int64
	PercentCooldownMod                 int64
	PercentMagicPenetrationMod         int64
	FlatArmorPenetrationModPerLevel    int64
	FlatMovementSpeedMod               int64
	FlatTimeDeadModPerLevel            int64
	FlatArmorModPerLevel               int64
	PercentAttackSpeedMod              int64
	FlatDodgeModPerLevel               int64
	PercentMagicDamageMod              int64
	PercentBlockMod                    int64
	FlatDodgeMod                       int64
	FlatEnergyRegenMod                 int64
	FlatHPModPerLevel                  int64
	PercentAttackSpeedModPerLevel      int64
	PercentSpellVampMod                int64
	FlatMPRegenMod                     int64
	PercentHPPoolMod                   int64
	PercentDodgeMod                    int64
	FlatAttackSpeedMod                 int64
	FlatArmorMod                       int64
	FlatMagicDamageModPerLevel         int64
	FlatHPRegenMod                     int64
	PercentPhysicalDamageMod           int64
	FlatCritChanceModPerLevel          int64
	FlatSpellBlockModPerLevel          int64
	PercentTimeDeadMod                 int64
	FlatBlockMod                       int64
	PercentMPPoolMod                   int64
	FlatMagicDamageMod                 int64
	PercentMPRegenMod                  int64
	PercentMovementSpeedModPerLevel    int64
	PercentCooldownModPerLevel         int64
	FlatMPModPerLevel                  int64
	FlatEnergyModPerLevel              int64
	FlatPhysicalDamageMod              int64
	FlatHPRegenModPerLevel             int64
	FlatCritDamageMod                  int64
	PercentArmorMod                    int64
	FlatMagicPenetrationMod            int64
	PercentCritChanceMod               int64
	FlatPhysicalDamageModPerLevel      int64
	PercentArmorPenetrationMod         int64
	PercentEXPBonus                    int64
	FlatMPRegenModPerLevel             int64
	PercentMagicPenetrationModPerLevel int64
	FlatTimeDeadMod                    int64
	FlatMovementSpeedModPerLevel       int64
	FlatGoldPer10Mod                   int64
	FlatArmorPenetrationMod            int64
	FlatCritDamageModPerLevel          int64
	FlatHPPoolMod                      int64
	FlatCritChanceMod                  int64
	FlatEXPBonus                       int64
}

RuneStatsDTO contains stats for runes.

type Service

type Service struct {
	Status    string     `json:"status"`
	Incidents []Incident `json:"incidents"`
	Name      string     `json:"name"`
	Slug      string     `json:"slug"`
}

Service contains service data.

type ShardStatus

type ShardStatus struct {
	Name      string    `json:"name"`
	RegionTag string    `json:"region_tag"`
	HostName  string    `json:"hostname"`
	Services  []Service `json:"services"`
	Slug      string    `json:"slug"`
	Locales   []string  `json:"locales"`
}

ShardStatus contains shard status data.

type SkinDTO

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

SkinDTO contains champion skin data.

type SpectatorService

type SpectatorService service

SpectatorService represents the Spectator-V3 API methods. https://developer.riotgames.com/api-methods/#spectator-v3

func (*SpectatorService) CurrentGame

func (s *SpectatorService) CurrentGame(summonerID int64) (*CurrentGameInfo, *http.Response, error)

CurrentGame retrieves the current game information for the given summoner ID.

func (*SpectatorService) FeaturedGames

func (s *SpectatorService) FeaturedGames() (*FeaturedGames, *http.Response, error)

FeaturedGames retrieves a list of featured games.

type SpellVarsDTO

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

SpellVarsDTO contains spell vars data.

type StaticChampionDTO

type StaticChampionDTO struct {
	Info        InfoDTO            `json:"info"`
	EnemyTips   []string           `json:"enemytips"`
	Stats       StatsDTO           `json:"stats"`
	Name        string             `json:"name"`
	Title       string             `json:"title"`
	Image       ImageDTO           `json:"image"`
	Tags        []string           `json:"tags"`
	Partype     string             `json:"partype"`
	Skins       []SkinDTO          `json:"skin"`
	Passive     PassiveDTO         `json:"passive"`
	Recommended RecommendedDTO     `json:"recommended"`
	AllyTips    []string           `json:"allytips"`
	Key         string             `json:"key"`
	Lore        string             `json:"lore"`
	ID          int                `json:"id"`
	Blurb       string             `json:"blurb"`
	Spells      []ChampionSpellDTO `json:"spells"`
}

StaticChampionDTO contains champion data.

type StaticChampionListDTO

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

StaticChampionListDTO contains champion list data.

type StaticDataChampionsOption

type StaticDataChampionsOption func(*StaticDataChampionsOptions)

StaticDataChampionsOption is a function which modifies the StaticDataChampionsOptions.

type StaticDataChampionsOptions

type StaticDataChampionsOptions struct {
	// Locale of the data to be returned.
	// Default: Locale of the client's region.
	Locale string `url:"locale,omitempty"`

	// Patch version for the data to be returned.
	// A list of valid versions can be obtained from the /versions endpoint.
	// Default: Latest version for the client's region.
	Version string `url:"version,omitempty"`

	// Tags to return additional data.
	// To return all additional data, use the tag 'all'.
	// Default: type, version, data, id, key, name, and title are returned.
	ChampionListData []string `url:"champListData,omitempty"`

	// Tags to return additional data.
	// To return all additional data, use the tag 'all'.
	// Default: type, version, data, id, key, name, and title are returned.
	Tags []string `url:"tags,omitempty"`

	// If true, the returned data will use the champions' IDs as keys.
	// Otherwise, the champions' keys will be used instead.
	// Default: false.
	DataByID bool `url:"dataById,omitempty"`
}

StaticDataChampionsOptions specifies the optional parameters to the Static Data champions service methods.

type StaticDataItemsOption

type StaticDataItemsOption func(*StaticDataItemsOptions)

StaticDataItemsOption is a function which modifies the StaticDataItemsOptions.

type StaticDataItemsOptions

type StaticDataItemsOptions struct {
	// Locale of the data to be returned.
	// Default: Locale of the client's region.
	Locale string `url:"locale,omitempty"`

	// Patch version for the data to be returned.
	// A list of valid versions can be obtained from the /versions endpoint.
	// Default: Latest version for the client's region.
	Version string `url:"version,omitempty"`

	// Tags to return additional data.
	// To return all additional data, use the tag 'all'.
	// Default: type, version, data, id, name, description, plaintext, and group are returned.
	ItemListData []string `url:"itemListData,omitempty"`

	// Tags to return additional data.
	// To return all additional data, use the tag 'all'.
	// Default: type, version, data, id, name, description, plaintext, and group are returned.
	Tags []string `url:"tags,omitempty"`
}

StaticDataItemsOptions specifies the optional parameters to the Static Data items service methods.

type StaticDataLanguageStringsOption

type StaticDataLanguageStringsOption func(*StaticDataLanguageStringsOptions)

StaticDataLanguageStringsOption is a function which modifies the StaticDataLanguageStringsOptions.

type StaticDataLanguageStringsOptions

type StaticDataLanguageStringsOptions struct {
	Locale  string `url:"locale"`
	Version string `url:"version"`
}

StaticDataLanguageStringsOptions specifies the optional parameters to the Static Data language strings service method.

type StaticDataMapsOption

type StaticDataMapsOption func(*StaticDataMapsOptions)

StaticDataMapsOption is a function which modifies the StaticDataMapsOptions.

type StaticDataMapsOptions

type StaticDataMapsOptions struct {
	Locale  string `url:"locale"`
	Version string `url:"version"`
}

StaticDataMapsOptions specifies the optional parameters to the Static Data maps service method.

type StaticDataMasteriesOption

type StaticDataMasteriesOption func(*StaticDataMasteriesOptions)

StaticDataMasteriesOption is a function which modifies the StaticDataMasteriesOptions.

type StaticDataMasteriesOptions

type StaticDataMasteriesOptions struct {
	Locale          string   `url:"locale"`
	Version         string   `url:"version"`
	Tags            []string `url:"tags"`
	MasteryListData []string `url:"masteryListData"`
}

StaticDataMasteriesOptions specifies the optional parameters to the Static Data masteries service method.

type StaticDataMasteryOption

type StaticDataMasteryOption func(*StaticDataMasteryOptions)

StaticDataMasteryOption is a function which modifies the StaticDataMasteryOptions.

type StaticDataMasteryOptions

type StaticDataMasteryOptions struct {
	MasteryData []string `url:"masteryData"`
	Locale      string   `url:"locale"`
	Version     string   `url:"version"`
	Tags        []string `url:"tags"`
}

StaticDataMasteryOptions specifies the optional parameters to the Static Data mastery service method.

type StaticDataProfileIconsOption

type StaticDataProfileIconsOption func(*StaticDataProfileIconsOptions)

StaticDataProfileIconsOption is a function which modifies the StaticDataProfileIconsOptions.

type StaticDataProfileIconsOptions

type StaticDataProfileIconsOptions struct {
	Locale  string `url:"locale"`
	Version string `url:"version"`
}

StaticDataProfileIconsOptions specifies the optional parameters to the Static Data profile icons service method.

type StaticDataReforgedRuneOption

type StaticDataReforgedRuneOption func(*StaticDataReforgedRuneOptions)

StaticDataReforgedRuneOption is a function which modifies the StaticDataReforgedRuneOptions.

type StaticDataReforgedRuneOptions

type StaticDataReforgedRuneOptions struct {
	Version string `url:"version"`
	Locale  string `url:"locale"`
}

StaticDataReforgedRuneOptions specifies the optional parameters to the Static Data reforged runes service method.

type StaticDataRuneListOption

type StaticDataRuneListOption func(*StaticDataRuneListOptions)

StaticDataRuneListOption is a function which modifies the StaticDataRuneListOptions.

type StaticDataRuneListOptions

type StaticDataRuneListOptions struct {
	Locale       string   `url:"locale"`
	Version      string   `url:"version"`
	RuneListData []string `url:"runeListData"`
	Tags         []string `url:"tags"`
}

StaticDataRuneListOptions specifies the optional parameters for the Static Data rune service method.

type StaticDataRuneOption

type StaticDataRuneOption func(*StaticDataRuneOptions)

StaticDataRuneOption is a function which modifies the StaticDataRuneOptions.

type StaticDataRuneOptions

type StaticDataRuneOptions struct {
	Locale   string   `url:"locale"`
	Version  string   `url:"version"`
	RuneData []string `url:"runeData"`
	Tags     []string `url:"tags"`
}

StaticDataRuneOptions specifies the optional parameters for the Static Data rune service method.

type StaticDataService

type StaticDataService service

StaticDataService represents the LOL-Static-Data-V3 API methods. https://developer.riotgames.com/api-methods/#lol-static-data-v3

func (*StaticDataService) ChampionByID

func (s *StaticDataService) ChampionByID(championID int64, opts ...StaticDataChampionsOption) (*StaticChampionDTO, *http.Response, error)

ChampionByID gets champion information by champion ID.

func (*StaticDataService) Champions

Champions retrieves a list of champion information.

func (*StaticDataService) ItemByID

func (s *StaticDataService) ItemByID(itemID int64, opts ...StaticDataItemsOption) (*ItemDTO, *http.Response, error)

ItemByID retrieves an item by ID.

func (*StaticDataService) Items

Items retrieves a list of items.

func (*StaticDataService) LanguageStrings

LanguageStrings retrieves language strings data.

func (*StaticDataService) Languages

func (s *StaticDataService) Languages() ([]string, *http.Response, error)

Languages retrieves supported languages data.

func (*StaticDataService) Maps

Maps retrieves map data.

func (*StaticDataService) Masteries

Masteries retrieves the list of masteries.

func (*StaticDataService) MasteryByID

func (s *StaticDataService) MasteryByID(masteryID int64, opts ...StaticDataMasteryOption) (*MasteryDTO, *http.Response, error)

MasteryByID retrieves a mastery by ID.

func (*StaticDataService) ProfileIcons

ProfileIcons retrieves profile icons.

func (*StaticDataService) Realms

func (s *StaticDataService) Realms() (*RealmDTO, *http.Response, error)

Realms retrieves realms data.

func (*StaticDataService) ReforgedRuneByID

func (s *StaticDataService) ReforgedRuneByID(runeID int, opts ...StaticDataReforgedRuneOption) (*ReforgedRuneDTO, *http.Response, error)

ReforgedRuneByID retrieves a reforged rune by ID.

func (*StaticDataService) ReforgedRunePathByID

func (s *StaticDataService) ReforgedRunePathByID(pathID int, opts ...StaticDataReforgedRuneOption) (*ReforgedRunePathDTO, *http.Response, error)

ReforgedRunePathByID retrieves a reforged rune path by ID.

func (*StaticDataService) ReforgedRunePaths

ReforgedRunePaths retrieves reforged rune paths.

func (*StaticDataService) ReforgedRunes

ReforgedRunes retrieves reforged runes.

func (*StaticDataService) RuneByID

func (s *StaticDataService) RuneByID(runeID int64, opts ...StaticDataRuneOption) (*RuneDTO, *http.Response, error)

RuneByID retrieves a rune by ID.

func (*StaticDataService) Runes

Runes retrieves the list of runes.

func (*StaticDataService) SummonerSpellByID

func (s *StaticDataService) SummonerSpellByID(summonerSpellID int64, opts ...StaticDataSpellOption) (*SummonerSpellDTO, *http.Response, error)

SummonerSpellByID retrieves a summoner spell by ID.

func (*StaticDataService) SummonerSpells

SummonerSpells retrieves summoner spell list.

func (s *StaticDataService) TarballLinks(opts ...TarballLinksOption) (*string, *http.Response, error)

TarballLinks retrieves full tarball link.

func (*StaticDataService) Versions

func (s *StaticDataService) Versions() ([]string, *http.Response, error)

Versions retrieves a list of valid versions.

type StaticDataSpellListOption

type StaticDataSpellListOption func(*StaticDataSpellListOptions)

StaticDataSpellListOption is a function which modifies the StaticDataSpellListOptions.

type StaticDataSpellListOptions

type StaticDataSpellListOptions struct {
	Locale        string   `url:"locale"`
	Version       string   `url:"version"`
	SpellListData []string `url:"spellListData"`
	DataByID      bool     `url:"dataById"`
	Tags          []string `url:"tags"`
}

StaticDataSpellListOptions specifies the optional parameters for the Static Data spell list service method.

type StaticDataSpellOption

type StaticDataSpellOption func(*StaticDataSpellOptions)

StaticDataSpellOption is a function which modifies the StaticDataSpellOptions.

type StaticDataSpellOptions

type StaticDataSpellOptions struct {
	Locale    string   `url:"locale"`
	Version   string   `url:"version"`
	SpellData []string `url:"spellData"`
	DataByID  bool     `url:"dataById"`
	Tags      []string `url:"tags"`
}

StaticDataSpellOptions specifies the optional parameters for the Static Data spell service method.

type StatsDTO

type StatsDTO struct {
	ArmorPerLevel        float64 `json:"armorperlevel"`
	HPPerLevel           float64 `json:"hpperlevel"`
	AttackDamage         float64 `json:"attackdamage"`
	MPPerLevel           float64 `json:"mpperlevel"`
	AttackSpeedOffset    float64 `json:"attackspeedoffset"`
	Armor                float64 `json:"armor"`
	HP                   float64 `json:"hp"`
	HPRegenPerLevel      float64 `json:"hpregenperlevel"`
	SpellBlock           float64 `json:"spellblock"`
	AttackRange          float64 `json:"attackrange"`
	MoveSpeed            float64 `json:"movespeed"`
	AttackDamagePerLevel float64 `json:"attackdamageperlevel"`
	MPRegenPerLevel      float64 `json:"mpregenperlevel"`
	MP                   float64 `json:"mp"`
	SpellBlockPerLevel   float64 `json:"spellblockperlevel"`
	Crit                 float64 `json:"crit"`
	MPRegen              float64 `json:"mpregen"`
	AttackSpeedPerLevel  float64 `json:"attackspeedperlevel"`
	HPRegen              float64 `json:"hpregen"`
	CritPerLevel         float64 `json:"critperlevel"`
}

StatsDTO contains champion stats data.

type StatusService

type StatusService service

StatusService represents the LOL-Status-V3 API methods. https://developer.riotgames.com/api-methods/#lol-status-v3

func (*StatusService) ShardData

func (s *StatusService) ShardData() (*ShardStatus, *http.Response, error)

ShardData retrieves the League of Legends status for the given shard.

type SummonerDTO

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

SummonerDTO contains summoner information.

type SummonerService

type SummonerService service

SummonerService represents the Match-V3 API methods. https://developer.riotgames.com/api-methods/#summoner-v3/GET_getByAccountId

func (*SummonerService) ByAccountID

func (s *SummonerService) ByAccountID(accountID int64) (*SummonerDTO, *http.Response, error)

ByAccountID retrieves a summoner by account ID.

func (*SummonerService) BySummonerID

func (s *SummonerService) BySummonerID(summonerID int64) (*SummonerDTO, *http.Response, error)

BySummonerID retrives a summoner by summoner ID.

func (*SummonerService) BySummonerName

func (s *SummonerService) BySummonerName(summonerName string) (*SummonerDTO, *http.Response, error)

BySummonerName retrieves a summoner by summoner name.

type SummonerSpellDTO

type SummonerSpellDTO struct {
	Vars                 []SpellVarsDTO `json:"vars"`
	Image                ImageDTO       `json:"image"`
	CostBurn             string         `json:"costBurn"`
	Cooldown             []int64        `json:"cooldown"`
	EffectBurn           []string       `json:"effectBurn"`
	ID                   int            `json:"id"`
	CooldownBurn         string         `json:"cooldownBurn"`
	Tooltip              string         `json:"tooltip"`
	MaxRank              int            `json:"maxrank"`
	RangeBurn            string         `json:"rangeBurn"`
	Description          string         `json:"description"`
	Effect               [][]int64      `json:"effect"`
	Key                  string         `json:"key"`
	LevelTip             LevelTipDTO    `json:"leveltip"`
	Modes                []string       `json:"modes"`
	Resource             string         `json:"resource"`
	Name                 string         `json:"name"`
	CostType             string         `json:"costType"`
	SanitizedDescription string         `json:"sanitizedDescription"`
	SanitizedTooltip     string         `json:"sanitizedTooltip"`
	Range                interface{}    `json:"range"` // This field is either a List of Integer or the String 'self' for spells that target one's own champion.
	Cost                 []int          `json:"cost"`
	SummonerLevel        int            `json:"summonerLevel"`
}

SummonerSpellDTO contains summoner spell data.

type SummonerSpellListDTO

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

SummonerSpellListDTO contains summoner spell list data.

type TarballLinksOption

type TarballLinksOption func(*TarballLinksOptions)

TarballLinksOption is a function which modifies the TarballLinksOptions.

type TarballLinksOptions

type TarballLinksOptions struct {
	Version string `url:"version"`
}

TarballLinksOptions specifies the optional parameters for the Static Data tarball links service method.

type TeamBansDTO

type TeamBansDTO struct {
	PickTurn   int `json:"pickTurn"`
	ChampionID int `json:"championId"`
}

TeamBansDTO contains team bans data.

type TeamStatsDTO

type TeamStatsDTO struct {
	FirstDragon          bool          `json:"firstDragon"`
	FirstInhibitor       bool          `json:"firstInhibitor"`
	Bans                 []TeamBansDTO `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"`
}

TeamStatsDTO contains team stats data.

type ThirdPartyCodeService

type ThirdPartyCodeService service

ThirdPartyCodeService represents the Match-V3 API methods. https://developer.riotgames.com/api-methods/#third-party-code-v3

func (*ThirdPartyCodeService) BySummonerID

func (t *ThirdPartyCodeService) BySummonerID(summonerID int64) (*string, *http.Response, error)

BySummonerID retrieves third party code for a given summoner ID.

type TournamentCode

type TournamentCode struct {
	// Optional list of participants in order to validate the players eligible to join the lobby.
	// NOTE: Riot does not currently enforce participants at the team level, but rather the
	// aggregate of teamOne and teamTwo. Riot may add the ability to enforce at the team level
	// in the future.
	AllowedSummonerIDs []int `json:"allowedSummonerIds"`

	// The map type of the game. (Legal values: SUMMONERS_RIFT, TWISTED_TREELINE, HOWLING_ABYSS)
	MapType string `json:"mapType"`

	// Optional string that may contain any data in any format, if specified at all.
	// Used to denote any custom information about the game.
	Metadata string `json:"metadata"`

	// The pick type of the game.
	// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
	PickType string `json:"pickType"`

	// The spectator type of the game. (Legal values: NONE, LOBBYONLY, ALL)
	SpectatorType string `json:"spectatorType"`

	// The team size of the game. Valid values are 1-5.
	TeamSize int `json:"teamSize"`
}

TournamentCode represents the required parameters for the Tournament codes service method.

type TournamentCodeDTO

type TournamentCodeDTO struct {
	Map          string  `json:"map"`
	Code         string  `json:"code"`
	Spectators   string  `json:"spectators"`
	Region       string  `json:"region"`
	ProviderID   int     `json:"providerId"`
	TeamSize     int     `json:"teamSize"`
	Participants []int64 `json:"participants"`
	PickType     string  `json:"pickType"`
	TournamentID int     `json:"tournamentId"`
	LobbyName    string  `json:"lobbyName"`
	Password     string  `json:"password"`
	ID           int     `json:"id"`
	Metadata     string  `json:"metaData"`
}

TournamentCodeDTO contains tournament code data.

type TournamentCodeUpdate

type TournamentCodeUpdate struct {
	AllowedSummonerIDs []int  `json:"allowedSummonerIds"`
	MapType            string `json:"mapType"`
	PickType           string `json:"pickType"`
	SpectatorType      string `json:"spectatorType"`
}

TournamentCodeUpdate specifies the optional body parameters for the Tournament code update service method.

type TournamentCodesOption

type TournamentCodesOption func(*TournamentCodesOptions)

TournamentCodesOption is a function that modifies the TournamentCodesOptions.

type TournamentCodesOptions

type TournamentCodesOptions struct {
	// The number of codes to create (max 1000).
	Count int `url:"count"`

	// The tournament ID.
	TournamentID int64 `url:"tournamentId"`
}

TournamentCodesOptions specifies the optional parameters for the Tournament Stub codes service method.

type TournamentRegistration

type TournamentRegistration struct {
	// The optional name of the tournament.
	Name string `json:"name"`

	// The provider ID to specify the regional registered provider data to associate this tournament.
	ProviderID int `json:"providerId"`
}

TournamentRegistration specifies the required parameters for the Tournament Stub tournaments service method.

type TournamentService

type TournamentService service

TournamentService represents the Tournament-Stub-V3 API methods. https://developer.riotgames.com/api-methods/#tournament-v3

func (*TournamentService) Codes

Codes creates a tournament code for the given tournament.

func (*TournamentService) LobbyEvents

func (t *TournamentService) LobbyEvents(tournamentCode string) (*LobbyEventDTOWrapper, *http.Response, error)

LobbyEvents retrieves a list of lobby events by tournament code.

func (*TournamentService) Provider

Provider creates a tournament provider and returns its ID.

func (*TournamentService) Tournament

Tournament creates a mock tournament and returns its ID.

func (*TournamentService) TournamentCode

func (t *TournamentService) TournamentCode(tournamentCode string) (*TournamentCodeDTO, *http.Response, error)

TournamentCode retrieves the tournament code information for the given tournament code.

func (*TournamentService) UpdateTournament

func (t *TournamentService) UpdateTournament(tournamentCode string, tcu *TournamentCodeUpdate) (*http.Response, error)

UpdateTournament updates the pick type, map, spectator type, or allowed summoners for the given code.

type TournamentStubService

type TournamentStubService service

TournamentStubService represents the Tournament-Stub-V3 API methods. https://developer.riotgames.com/api-methods/#tournament-stub-v3

func (*TournamentStubService) Codes

Codes creates a mock tournament code for the given tournament.

func (*TournamentStubService) LobbyEventsByCode

func (t *TournamentStubService) LobbyEventsByCode(tournamentCode string) (*LobbyEventDTOWrapper, *http.Response, error)

LobbyEventsByCode retrieves a list of lobby events for the given tournament code.

func (*TournamentStubService) Provider

Provider creates a mock tournament provider and returns its ID.

func (*TournamentStubService) Tournament

Tournament creates a mock tournament and returns its ID.

type Translation

type Translation struct {
	Locale    string `json:"locale"`
	Content   string `json:"content"`
	UpdatedAt string `json:"updated_at"`
}

Translation contains translation data.

Jump to

Keyboard shortcuts

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