Documentation ¶
Index ¶
- Variables
- type Client
- type LeagueDTO
- type LeagueEntryDTO
- type LeagueMethod
- type LeaguePositionDTO
- type LeaguePositionSlice
- type LeagueResponseMap
- type MatchListDto
- type MatchListMethod
- type MatchListOptions
- type MatchReferenceDto
- type MiniSeriesDTO
- type Platform
- type QueueType
- type SummonerDTO
- type SummonerMethod
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAPIKeyRequired = errors.New("Required APIKey is missing") ErrUnknownPlatformId = errors.New("Unknown platform id") )
View Source
var Platforms = []Platform{
{"NA1", "North America", "NA"},
{"BR1", "Brazil", "BR"},
{"EUN1", "EU Nordic & East ", "EUNE"},
{"EUW1", "EU West", "EUW"},
{"JP1", "Japan", "JP"},
{"KR", "Korea", "KR"},
{"LA1", "Latin America North", "LAN"},
{"LA2", "Latin America South", "LAS"},
{"OC1", "Oceania", "OCE"},
{"PBE1", "PBE", "PBE"},
{"RU", "Russia", "RU"},
{"TR1", "Turkey", "TR"},
}
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { APIKey string Summoner *SummonerMethod League *LeagueMethod MatchList *MatchListMethod RateLimiter *throttled.GCRARateLimiter // contains filtered or unexported fields }
type LeagueDTO ¶
type LeagueDTO struct { // The league's queue type. Queue string `json:"queue"` // The league's tier. Tier string `json:"tier"` // Specifies the relevant participant that is a member of this league // (i.e., a requested summoner ID, a requested team ID, or the ID of // a team to which one of the requested summoners belongs). Only // present when full league is requested so that participant's entry // can be identified. Not present when individual entry is requested. ParticipantId string `json:"participantId,omitempty"` // This name is an internal place-holder name only. Display and // localization of names in the game client are handled client-side. Name string `json:"name,omitempty"` // The requested league entries. Entries []LeagueEntryDTO `json:"entries"` }
LeagueDTO struct describes a response to a League api call
type LeagueEntryDTO ¶
type LeagueEntryDTO struct { // Specifies if the participant is fresh blood. IsFreshBlood bool `json:"isFreshBlood"` // The league division of the participant. Division string `json:"division"` // The playstyle of the participant. Playstyle string `json:"playstyle"` // Mini series data for the participant. Only present if the participant // is currently in a mini series. MiniSeries *MiniSeriesDTO `json:"miniSeries,omitempty"` // The number of wins for the participant. Wins int `json:"wins"` // The number of losses for the participant. Losses int `json:"losses"` // The ID of the participant (i.e., summoner or team) represented by // this entry. PlayerOrTeamId string `json:"playerOrTeamId"` // The name of the the participant (i.e., summoner or team) represented // by this entry. PlayerOrTeamName string `json:"playerOrTeamName"` // Specifies if the participant is on a hot streak. IsHotStreak bool `json:"isHotStreak"` // Specifies if the participant is inactive. IsInactive bool `json:"isInactive"` // Specifies if the participant is a veteran. IsVeteran bool `json:"isVeteran"` // The league points of the participant. LeaguePoints int `json:"leaguePoints"` }
LeagueEntryDTO describes an entry in response to a League api call
type LeagueMethod ¶
type LeagueMethod struct {
// contains filtered or unexported fields
}
func (*LeagueMethod) EntryBySummoner ¶
func (m *LeagueMethod) EntryBySummoner(summonerId int64, platformId string) (LeagueResponseMap, error)
func (*LeagueMethod) PositionsBySummoner ¶
func (m *LeagueMethod) PositionsBySummoner(summonerId int64, platformId string) (LeaguePositionSlice, error)
type LeaguePositionDTO ¶
type LeaguePositionDTO struct { // Name of the League LeagueName string `json:"leagueName"` // Specifies if the participant is fresh blood. FreshBlood bool `json:"freshBlood"` // The league rank of the participant: I, II, III, IV, V Rank string `json:"rank"` // Mini series data for the participant. Only present if the participant // is currently in a mini series. MiniSeries *MiniSeriesDTO `json:"miniSeries,omitempty"` // The number of wins for the participant. Wins int `json:"wins"` // The number of losses for the participant. Losses int `json:"losses"` // The ID of the participant (i.e., summoner or team) represented by // this entry. PlayerOrTeamId string `json:"playerOrTeamId"` // The name of the the participant (i.e., summoner or team) represented // by this entry. PlayerOrTeamName string `json:"playerOrTeamName"` // Specifies if the participant is on a hot streak. HotStreak bool `json:"hotStreak"` // Specifies if the participant is inactive. Inactive bool `json:"inactive"` // Specifies if the participant is a veteran. Veteran bool `json:"veteran"` // The league points of the participant. LeaguePoints int `json:"leaguePoints"` }
LeaguePositionDto describes a single position entry for a summoner in a League
type LeaguePositionSlice ¶
type LeaguePositionSlice []LeaguePositionDTO
type LeagueResponseMap ¶
Map of summonerId (string version) to slice of LeagueDTO structures
type MatchListDto ¶
type MatchListDto struct { Matches []MatchReferenceDto `json:"matches,omitempty"` TotalGames int `json:"totalGames"` StartIndex int `json:"startIndex"` EndIndex int `json:"endIndex"` }
MatchList struct describes a response to a Match List api call
type MatchListMethod ¶
type MatchListMethod struct {
// contains filtered or unexported fields
}
func (*MatchListMethod) ByAccount ¶
func (m *MatchListMethod) ByAccount(accountId int64, platformId string, options *MatchListOptions) (*MatchListDto, error)
type MatchListOptions ¶
type MatchListOptions struct { // The end time to use for fetching games specified as epoch milliseconds. EndTime int64 `url:"endTime,omitempty"` // The end index to use for fetching games. EndIndex int `url:"endIndex,omitempty"` // Set of queue IDs for filtering matchlist. Queues []QueueType `url:"queue,omitempty"` // Set of season IDs for filtering matchlist. Seasons []int `url:"season,omitempty"` // The begin time to use for fetching games specified as epoch milliseconds. BeginTime int64 `url:"beginTime,omitempty"` // The begin index to use for fetching games. BeginIndex int `url:"beginIndex,omitempty"` // Comma-separated list of champion IDs to use for fetching games. Champions []int `url:"champion,omitempty"` }
type MatchReferenceDto ¶
type MatchReferenceDto struct { Lane string `json:"lane"` Champion int `json:"champion"` PlatformId string `json:"platformId"` Timestamp int64 `json:"timestamp"` // Epoch milliseconds Region string `json:"region"` GameId int64 `json:"gameId"` Queue int `json:"queue"` Role string `json:"role"` Season int `json:"season"` }
type MiniSeriesDTO ¶
type MiniSeriesDTO struct { // String showing the current, sequential mini series progress where // 'W' represents a win, 'L' represents a loss, and 'N' represents a // game that hasn't been played yet. Progress string `json:"progress"` // Number of current losses in the mini series. Losses int `json:"losses"` // Number of wins required for promotion. Target int `json:"target"` // Number of current wins in the mini series. Wins int `json:"wins"` }
type Platform ¶
type Platform struct { Id string // e.g. "NA1" Name string // e.g. "North America" RegionId string // e.g. "NA" }
Platform struct describes a Riot Platform
func GetPlatform ¶
GetPlatform returns the platform description for a given platform id (case-insensitive)
func GetPlatformByRegion ¶
GetPlatform returns the platform description for a given platform id (case-insensitive)
type QueueType ¶
type QueueType int
const ( CUSTOM QueueType = 0 // Custom games NORMAL_3x3 QueueType = 8 // Normal 3v3 games NORMAL_5x5_BLIND QueueType = 2 // Normal 5v5 Blind Pick games NORMAL_5x5_DRAFT QueueType = 14 // Normal 5v5 Draft Pick games RANKED_SOLO_5x5 QueueType = 4 // Ranked Solo 5v5 games RANKED_PREMADE_5x5 QueueType = 6 // Ranked Premade 5v5 games (Deprecated) RANKED_PREMADE_3x3 QueueType = 9 // Historical Ranked Premade 3v3 games (Deprecated) RANKED_FLEX_TT QueueType = 9 // Ranked Flex Twisted Treeline games RANKED_TEAM_3x3 QueueType = 41 // Ranked Team 3v3 games (Deprecated) RANKED_TEAM_5x5 QueueType = 42 // Ranked Team 5v5 games ODIN_5x5_BLIND QueueType = 16 // Dominion 5v5 Blind Pick games ODIN_5x5_DRAFT QueueType = 17 // Dominion 5v5 Draft Pick games BOT_5x5 QueueType = 7 // Historical Summoner's Rift Coop vs AI games (Deprecated) BOT_ODIN_5x5 QueueType = 25 // Dominion Coop vs AI games BOT_5x5_INTRO QueueType = 31 // Summoner's Rift Coop vs AI Intro Bot games BOT_5x5_BEGINNER QueueType = 32 // Summoner's Rift Coop vs AI Beginner Bot games BOT_5x5_INTERMEDIATE QueueType = 33 // Historical Summoner's Rift Coop vs AI Intermediate Bot games BOT_TT_3x3 QueueType = 52 // Twisted Treeline Coop vs AI games GROUP_FINDER_5x5 QueueType = 61 // Team Builder games ARAM_5x5 QueueType = 65 // ARAM games ONEFORALL_5x5 QueueType = 70 // One for All games FIRSTBLOOD_1x1 QueueType = 72 // Snowdown Showdown 1v1 games FIRSTBLOOD_2x2 QueueType = 73 // Snowdown Showdown 2v2 games SR_6x6 QueueType = 75 // Summoner's Rift 6x6 Hexakill games URF_5x5 QueueType = 76 // Ultra Rapid Fire games ONEFORALL_MIRRORMODE_5x5 QueueType = 78 // One for All (Mirror mode) BOT_URF_5x5 QueueType = 83 // Ultra Rapid Fire games played against AI games NIGHTMARE_BOT_5x5_RANK1 QueueType = 91 // Doom Bots Rank 1 games NIGHTMARE_BOT_5x5_RANK2 QueueType = 92 // Doom Bots Rank 2 games NIGHTMARE_BOT_5x5_RANK5 QueueType = 93 // Doom Bots Rank 5 games ASCENSION_5x5 QueueType = 96 // Ascension games HEXAKILL QueueType = 98 // Twisted Treeline 6x6 Hexakill games BILGEWATER_ARAM_5x5 QueueType = 100 // Butcher's Bridge games KING_PORO_5x5 QueueType = 300 // King Poro games COUNTER_PICK QueueType = 310 // Nemesis games BILGEWATER_5x5 QueueType = 313 // Black Market Brawlers games SIEGE QueueType = 315 // Nexus Siege games DEFINITELY_NOT_DOMINION_5x5 QueueType = 317 // Definitely Not Dominion games ARURF_5X5 QueueType = 318 // All Random URF games ARSR_5x5 QueueType = 325 // All Random Summoner's Rift games TEAM_BUILDER_DRAFT_UNRANKED_5x5 QueueType = 400 // Normal 5v5 Draft Pick games TEAM_BUILDER_DRAFT_RANKED_5x5 QueueType = 410 // Ranked 5v5 Draft Pick games (Deprecated) TEAM_BUILDER_RANKED_SOLO QueueType = 420 // Ranked Solo games from current season that use Team Builder matchmaking RANKED_FLEX_SR QueueType = 440 // Ranked Flex Summoner's Rift games ASSASSINATE_5x5 QueueType = 600 // Blood Hunt Assassin games DARKSTAR_3x3 QueueType = 610 // Darkstar games )
type SummonerDTO ¶
type SummonerDTO struct { // ID of the summoner icon associated with the summoner. ProfileIconId int `json:"profileIconId"` // Summoner name. Name string `json:"name"` // Summoner level associated with the summoner. SummonerLevel int64 `json:"summonerLevel"` // Date summoner was last modified specified as epoch milliseconds. // The following events will update this timestamp: profile icon change, // playing the tutorial or advanced tutorial, finishing a game, summoner name change RevisionDate int64 `json:"revisionDate"` // Summoner ID. Id int64 `json:"id"` // Account ID. AccountId int64 `json:"accountId"` }
Platform struct describes a Riot Platform
type SummonerMethod ¶
type SummonerMethod struct {
// contains filtered or unexported fields
}
func (*SummonerMethod) ByName ¶
func (m *SummonerMethod) ByName(name, platformId string) (*SummonerDTO, error)
Click to show internal directories.
Click to hide internal directories.