gololapi

package module
v0.0.0-...-c32d560 Latest Latest
Warning

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

Go to latest
Published: May 1, 2017 License: MIT Imports: 10 Imported by: 0

README

GoLolApi Build Status

A wrapper around the League Of Legends API written in Go.

Getting Started

Installing
go get github.com/Djipyy/GoLolApi
Exemple
package main

import (
	"fmt"

	gololapi "github.com/Djipyy/GoLolApi"
)

func main() {
	api := gololapi.NewAPI(gololapi.EUW, "YOUR_API_KEY", 0.8) //0.8 is the rate limit for the developpement key, you should change it if you have a production key
	summ := api.GetSummonerByID(71248364)
	fmt.Printf("His summoner name is %s", summ.Name)

	fmt.Println(api.GetFeaturedGames()) //This will return the current featured games of the region
}

Built With

  • go-cache - Library used for caching
  • rate - Library for the rate limiting

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EUW  = Region{Name: "EUW", PlatformID: "EUW1", Host: "https://euw1.api.riotgames.com"}
	BR   = Region{Name: "BR", PlatformID: "BR1", Host: "https://br1.api.riotgames.com"}
	EUNE = Region{Name: "EUNE", PlatformID: "EUN1", Host: "https://eun1.api.riotgames.com"}
	JP   = Region{Name: "JP", PlatformID: "JP1", Host: "https://jp1.api.riotgames.com"}
	KR   = Region{Name: "KR", PlatformID: "KR", Host: "https://kr.api.riotgames.com"}
	LAN  = Region{Name: "LAN", PlatformID: "LA1", Host: "https://la1.api.riotgames.com"}
	LAS  = Region{Name: "LAS", PlatformID: "LA2", Host: "https://la2.api.riotgames.com"}
	NA   = Region{Name: "NA", PlatformID: "NA1", Host: "https://na1.api.riotgames.com"}
	OCE  = Region{Name: "OCE", PlatformID: "OC1", Host: "https://oc1.api.riotgames.com"}
	TR   = Region{Name: "TR", PlatformID: "TR1", Host: "https://tr1.api.riotgames.com"}
	RU   = Region{Name: "RU", PlatformID: "RU", Host: "https://ru.api.riotgames.com"}
	PBE  = Region{Name: "PBE", PlatformID: "PBE1", Host: "https://pbe1.api.riotgames.com"}
)

Defines the different regions

Functions

func GetEndpointURI

func GetEndpointURI(endpointPath string, options map[string]string) (uri string, hasParameters bool)

GetEndpointURI Returns a URI with the options added to the original endpoint.

func MinifySummonerName

func MinifySummonerName(name string) (r string)

MinifySummonerName Returns a string without spaces and in lower characters.

Types

type BannedChampion

type BannedChampion struct {
	PickTurn   int
	ChampionID int
	TeamID     int
}

BannedChampion Represents a banned champion.

type BasicDataDto

type BasicDataDto struct {
	Gold                 GoldDto
	PlainText            string
	HideFromAll          bool
	InStore              bool
	Into                 []string
	ID                   int
	Stats                BasicDataStatsDto
	Colloq               string
	Maps                 map[string]bool
	SpecialRecipe        int
	Image                ImageDto
	Description          string
	Tags                 []string
	RequiredChampion     string
	From                 []string
	Group                string
	ConsumeOnFull        bool
	Name                 string
	Consumed             bool
	SanitizedDescription string
	Depth                int
	Rune                 MetaDataDto
	Stacks               int
}

BasicDataDto This object contains basic data.

type BasicDataStatsDto

type BasicDataStatsDto struct {
	RPercentMagicPenetrationModPerLevel float64
	RFlatEnergyModPerLevel              float64
	PercentMagicDamageMod               float64
	PercentCritDamageMod                float64
	PercentSpellBlockMod                float64
	PercentHPRegenMod                   float64
	PercentMovementSpeedMod             float64
	FlatSpellBlockMod                   float64
	PercentHPPoolMod                    float64
	FlatEnergyPoolMod                   float64
	RFlatDodgeMod                       float64
	PercentLifeStealMod                 float64
	RFlatMPRegenModPerLevel             float64
	FlatMPPoolMod                       float64
	RFlatGoldPer10Mod                   float64
	FlatMovementSpeedMod                float64
	RPercentCooldownMod                 float64
	RFlatMPModPerLevel                  float64
	RPercentCooldownModPerLevel         float64
	PercentAttackSpeedMod               float64
	RPercentMagicPenetrationMod         float64
	PercentBlockMod                     float64
	RFlatTimeDeadModPerLevel            float64
	FlatEnergyRegenMod                  float64
	RPercentAttackSpeedModPerLevel      float64
	PercentSpellVampMod                 float64
	FlatMPRegenMod                      float64
	RFlatTimeDeadMod                    float64
	RFlatMagicDamageModPerLevel         float64
	FlatAttackSpeedMod                  float64
	RFlatMagicPenetrationMod            float64
	RFlatCritChanceModPerLevel          float64
	PercentMPRegenMod                   float64
	PercentDodgeMod                     float64
	RFlatHPModPerLevel                  float64
	PercentPhysicalDamageMod            float64
	RFlatDodgeModPerLevel               float64
	RPercentMovementSpeedModPerLevel    float64
	RFlatSpellBlockModPerLevel          float64
	FlatBlockMod                        float64
	PercentMPPoolMod                    float64
	FlatMagicDamageMod                  float64
	RFlatMagicPenetrationModPerLevel    float64
	FlatHPRegenMod                      float64
	RFlatPhysicalDamageModPerLevel      float64
	RFlatEnergyRegenModPerLevel         float64
	FlatPhysicalDamageMod               float64
	RPercentTimeDeadMod                 float64
	FlatCritDamageMod                   float64
	RFlatArmorPenetrationMod            float64
	PercentArmorMod                     float64
	PercentCritChanceMod                float64
	RFlatArmorPenetrationModPerLevel    float64
	RFlatArmorModPerLevel               float64
	RFlatHPRegenModPerLevel             float64
	RPercentTimeDeadModPerLevel         float64
	PercentEXPBonus                     float64
	RFlatCritDamageModPerLevel          float64
	RFlatMovementSpeedModPerLevel       float64
	RPercentArmorPenetrationMod         float64
	RPercentArmorPenetrationModPerLevel float64
	FlatEXPBonus                        float64
	FlatHPPoolMod                       float64
	FlatCritChanceMod                   float64
	FlatArmorMod                        float64
}

BasicDataStatsDto This object contains basic data stats.

type BlockDto

type BlockDto struct {
	Items   []BlockItemDto
	RecMath bool
	Type    string
}

BlockDto This object contains champion recommended block data.

type BlockItemDto

type BlockItemDto struct {
	Count int
	ID    int
}

BlockItemDto This object contains champion recommended block item data.

type Champion

type Champion struct {
	ID                int
	FreeToPlay        bool
	Active            bool
	BotMMEnabled      bool
	BotEnabled        bool
	RankedPlayEnabled bool
}

Champion Hold a champion data that was retrived by the Champion-V3 endpoint

type ChampionList

type ChampionList struct {
	Champions []Champion
}

ChampionList Holds a list of Champion in Champions

type ChampionMastery

type ChampionMastery struct {
	ChestGranted         bool
	Level                int `json:"championLevel"`
	Points               int `json:"championPoints"`
	ID                   int `json:"championID"`
	PID                  int `json:"playerId"`
	PointsUntilNextLevel int `json:"championPointsUntilNextLevel"`
	PointsSinceLastLevel int `json:"championPointsSinceLastLevel"`
	LastPlayTime         int `json:"lastPlayTime"`
}

ChampionMastery Contains Champion Mastery information.

type ChampionSpellDto

type ChampionSpellDto struct {
	CooldownBurn         string
	Ressource            string
	LevelTip             LevelTipDto
	Vars                 []SpellVarsDto
	CostType             string
	Image                ImageDto
	SanitizedDescription string
	SanitizedTooltip     string
	Effect               [][]float32
	Tooltip              string
	MaxRank              int
	CostBurn             string
	RangeBurn            string
	Range                interface{}
	Cooldown             []float32
	Cost                 []int
	Key                  string
	Description          string
	EffectBurn           []string
	AltImages            []ImageDto
	Name                 string
}

ChampionSpellDto This object contains champion spell data.

type CurrentGameInfo

type CurrentGameInfo struct {
	GameID            int
	GameStartTime     int
	PlatformID        string
	GameMode          string
	MapID             int
	GameType          string
	BannedChampions   []BannedChampion
	Observers         Observer
	Participants      []CurrentGameParticipant
	GameLength        int
	GameQueueConfigID int
}

CurrentGameInfo Contains the information about a current game.

type CurrentGameParticipant

type CurrentGameParticipant struct {
	ProfileIconID    int
	ChampionID       int
	SummonerName     string
	Bot              bool
	SummonerSpell1ID int `json:"spell1Id"`
	SummonerSpell2ID int `json:"spell2Id"`
	TeamID           int
	SummonerID       int
	Runes            []Rune
	Masteries        []Mastery
}

CurrentGameParticipant Contains information about a participant of a current game.

type FeaturedGameInfo

type FeaturedGameInfo struct {
	GameID            int
	GameStartTime     int
	PlatformID        string
	GameMode          string
	MapID             int
	GameType          string
	BannedChampions   []BannedChampion
	Observers         Observer
	Participants      []CurrentGameParticipant
	GameLength        int
	GameQueueConfigID int
}

FeaturedGameInfo Contains the information about a featured game.

type FeaturedGames

type FeaturedGames struct {
	ClientRefreshInterval int
	Games                 []FeaturedGameInfo `json:"gameList"`
}

FeaturedGames Contains a list of featured games.

type GoLOLAPI

type GoLOLAPI struct {
	Region Region
	APIKey string
	// contains filtered or unexported fields
}

GoLOLAPI This holds the api.It has the receiver for many of the API Endpoints.

func NewAPI

func NewAPI(region Region, APIKey string, rpers float64) (api GoLOLAPI)

NewAPI Returns an instance of the api you can use.

func (*GoLOLAPI) GetChallengerLeague

func (api *GoLOLAPI) GetChallengerLeague(queue string) (league League)

GetChallengerLeague Get challenger tier leagues.

func (*GoLOLAPI) GetChampîon

func (api *GoLOLAPI) GetChampîon(ID int) (champion Champion)

GetChampîon Make a request to the Champion-V3 endpoint and returns a Champion

func (*GoLOLAPI) GetChampîons

func (api *GoLOLAPI) GetChampîons(onlyFreeToPlay bool) (champions ChampionList)

GetChampîons Make a request to the Champion-V3 endpoint and returns a ChampionList

func (*GoLOLAPI) GetFeaturedGames

func (api *GoLOLAPI) GetFeaturedGames() (games FeaturedGames, e error)

GetFeaturedGames Get list of featured games.

func (*GoLOLAPI) GetMasterLeague

func (api *GoLOLAPI) GetMasterLeague(queue string) (league League)

GetMasterLeague Get master tier leagues.

func (*GoLOLAPI) GetMatchData

func (api *GoLOLAPI) GetMatchData(id float64) (match MatchData)

GetMatchData Get match by match ID

func (*GoLOLAPI) GetMatchTimeline

func (api *GoLOLAPI) GetMatchTimeline(id float64) (timeline MatchTimeline)

GetMatchTimeline Get match timeline by match ID.

func (*GoLOLAPI) GetShardStatus

func (api *GoLOLAPI) GetShardStatus() (status ShardStatus)

GetShardStatus Make a request to the Lol-Status-V3 endpoint and returns a ShardStatus

func (*GoLOLAPI) GetSummonerByAccountID

func (api *GoLOLAPI) GetSummonerByAccountID(ID int) (s Summoner)

GetSummonerByAccountID Get a summoner by account ID.

func (*GoLOLAPI) GetSummonerByID

func (api *GoLOLAPI) GetSummonerByID(ID int) (s Summoner)

GetSummonerByID Get a summoner by summoner ID.

func (*GoLOLAPI) GetSummonerByName

func (api *GoLOLAPI) GetSummonerByName(name string) (s Summoner)

GetSummonerByName Get a summoner by summoner name.

func (*GoLOLAPI) RequestEndpoint

func (api *GoLOLAPI) RequestEndpoint(path string, cacheDuration time.Duration) (r []byte, e error)

RequestEndpoint Query and endpoint, put it in the cache and return the answer.

func (*GoLOLAPI) RequestLegacyEndpoint

func (api *GoLOLAPI) RequestLegacyEndpoint(path string, cacheDuration time.Duration, withparameters bool) (r []byte, e error)

RequestLegacyEndpoint Query and endpoint, put it in the cache and return the answer. Works with legacy endpoints (not v3).

func (*GoLOLAPI) RequestStaticData

func (api *GoLOLAPI) RequestStaticData(path string, cacheDuration time.Duration, withparameters bool) (r []byte, e error)

RequestStaticData Query and endpoint, put it in the cache and return the answer. Works with the Static Data and doesn't trigger the rate limit.

func (*GoLOLAPI) StaticDataGetChampions

func (api *GoLOLAPI) StaticDataGetChampions(version int, locale string, complete bool) (list StaticChampionList)

StaticDataGetChampions Retrieves champion list.

func (*GoLOLAPI) StaticDataGetItemByID

func (api *GoLOLAPI) StaticDataGetItemByID(ID int, version string, locale string, complete bool) (item ItemDto, e error)

StaticDataGetItemByID Retrieves item by ID.

func (*GoLOLAPI) StaticDataGetItems

func (api *GoLOLAPI) StaticDataGetItems(version string, locale string, complete bool) (list ItemListDto)

StaticDataGetItems Retrieves item list.

func (*GoLOLAPI) StaticDataGetLanguageStrings

func (api *GoLOLAPI) StaticDataGetLanguageStrings(version string, locale string) (strings LanguageStringsDto)

StaticDataGetLanguageStrings Retrieve language strings data.

func (*GoLOLAPI) StaticDataGetLanguages

func (api *GoLOLAPI) StaticDataGetLanguages() (list []string)

StaticDataGetLanguages Retrieve supported languages data.

func (*GoLOLAPI) StaticDataGetMaps

func (api *GoLOLAPI) StaticDataGetMaps(version string, locale string) (maps MapDataDto)

StaticDataGetMaps Retrieve map data.

func (*GoLOLAPI) StaticDataGetMasteries

func (api *GoLOLAPI) StaticDataGetMasteries(version string, locale string, complete bool) (list MasteryListDto)

StaticDataGetMasteries Retrieves mastery list.

func (*GoLOLAPI) StaticDataGetMasteryByID

func (api *GoLOLAPI) StaticDataGetMasteryByID(ID int, version string, locale string, complete bool) (result MasteryDto, e error)

StaticDataGetMasteryByID Retrieves mastery item by ID.

func (*GoLOLAPI) StaticDataGetRealm

func (api *GoLOLAPI) StaticDataGetRealm() (realm RealmDto)

StaticDataGetRealm Retrieve realm data.

func (*GoLOLAPI) StaticDataGetRuneByID

func (api *GoLOLAPI) StaticDataGetRuneByID(ID int, version string, locale string, complete bool) (result RuneDto, e error)

StaticDataGetRuneByID Retrieves rune by ID.

func (*GoLOLAPI) StaticDataGetRunes

func (api *GoLOLAPI) StaticDataGetRunes(version string, locale string, complete bool) (list RuneListDto)

StaticDataGetRunes Retrieves rune list.

func (*GoLOLAPI) StaticDataGetSummonerSpellByID

func (api *GoLOLAPI) StaticDataGetSummonerSpellByID(ID int, version string, locale string, complete bool) (result SummonerSpellDto, e error)

StaticDataGetSummonerSpellByID Retrieves summoner spell by ID.

func (*GoLOLAPI) StaticDataGetSummonerSpells

func (api *GoLOLAPI) StaticDataGetSummonerSpells(version string, locale string, complete bool) (list SummonerSpellListDto)

StaticDataGetSummonerSpells Retrieves summoner spell list.

func (*GoLOLAPI) StaticDataGetVersions

func (api *GoLOLAPI) StaticDataGetVersions() (versions []string)

StaticDataGetVersions Retrieve version data.

type GoldDto

type GoldDto struct {
	Sell        int
	Total       int
	Base        int
	Purchasable bool
}

GoldDto This object contains item gold data.

type GroupDto

type GroupDto struct {
	MaxGroupOwnable string
	Key             string
}

GroupDto This object contains item group data.

type ImageDto

type ImageDto struct {
	Full       string
	Group      string
	Sprite     string
	H, W, Y, X int
}

ImageDto This object contains image data.

type InfoDto

type InfoDto struct {
	Difficulty int
	Attack     int
	Defense    int
	Magic      int
}

InfoDto This object contains champion information.

type ItemDto

type ItemDto struct {
	Gold                 GoldDto
	PlainText            string
	HideFromAll          bool
	InStore              bool
	Into                 []string
	ID                   int
	Stats                BasicDataStatsDto
	Colloq               string
	Maps                 map[string]bool
	SpecialRecipe        int
	Image                ImageDto
	Description          string
	From                 []string
	Group                string
	ConsumeOnFull        bool
	Name                 string
	Consumed             bool
	SanitizedDescription string
	Depth                int
	Rune                 MetaDataDto
	Stacks               int
}

ItemDto This object contains item tree data.

type ItemListDto

type ItemListDto struct {
	Data    map[string]ItemDto
	Tree    []ItemTreeDto
	Version string
	Groups  []GroupDto
	Basic   BasicDataDto
	Type    string
}

ItemListDto This object contains item list data.

type ItemTreeDto

type ItemTreeDto struct {
	Header string
	Tags   []string
}

ItemTreeDto This object contains item tree data.

type LanguageStringsDto

type LanguageStringsDto struct {
	Data    map[string]string
	Version string
	Type    string
}

LanguageStringsDto This object contains language strings data.

type League

type League struct {
	Queue         string
	Tier          string
	ParticipantID string
	Name          string
	Entries       []LeagueEntry
}

League This object contains league information.

type LeagueEntry

type LeagueEntry struct {
	IsFreshBlood     bool
	Division         string
	Playstyle        string
	MiniSeries       MiniSeries
	Wins             int
	Losses           int
	PlayerOrTeamID   string
	PlayerOrTeamName string
	IsHotStreak      bool
	IsInactive       bool
	IsVeteran        bool
	LeaguePoints     int
}

LeagueEntry This object contains league participant information representing a summoner or team.

type LevelTipDto

type LevelTipDto struct {
	Effect []string
	Label  []string
}

LevelTipDto This object contains champion level tip data.

type MapDataDto

type MapDataDto struct {
	Data    map[string]MapDetailsDto
	Version string
	Type    string
}

MapDataDto This object contains map data.

type MapDetailsDto

type MapDetailsDto struct {
	MapName               string
	Image                 ImageDto
	ID                    float64 `json:"mapId"`
	UnpurchasableItemList []float64
}

MapDetailsDto This object contains map details data.

type Mastery

type Mastery struct {
	ID   int `json:"masteryId"`
	Rank int
}

Mastery Holds the ID and Rank from a mastery.Is obtained via the Masteries-V3 endpoint

type MasteryDto

type MasteryDto struct {
	Prereq               string
	MasteryTree          string
	Name                 string
	Ranks                int
	Image                ImageDto
	SanitizedDescription []string
	ID                   int
	Description          []string
}

MasteryDto This object contains mastery data.

type MasteryListDto

type MasteryListDto struct {
	Data    map[string]MasteryDto
	Version string
	Tree    MasteryTreeDto
	Type    string
}

MasteryListDto This object contains mastery list data.

type MasteryPage

type MasteryPage struct {
	Current   bool
	Masteries []Mastery
	Name      string
	ID        float64
}

MasteryPage Holds the data of a mastery page.

type MasteryPages

type MasteryPages struct {
	Pages []MasteryPage
	ID    int
}

MasteryPages Holds the mastery pages of a summoner in Pages and his summoner ID in ID.

type MasteryTreeDto

type MasteryTreeDto struct {
	Resolve  []MasteryTreeListDto
	Ferocity []MasteryTreeListDto
	Cunning  []MasteryTreeListDto
}

MasteryTreeDto This object contains mastery tree data.

type MasteryTreeItemDto

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

MasteryTreeItemDto This object contains mastery tree item data.

type MasteryTreeListDto

type MasteryTreeListDto struct {
	MasteryTreeItems []MasteryTreeItemDto
}

MasteryTreeListDto This object contains mastery tree list data.

type MatchData

type MatchData struct {
	SeasonID              int
	QueueID               int
	GameID                float64
	ParticipantIdentities []ParticipantIdentity
	GameVersion           string
	PlatformID            string
	GameMode              string
	MapID                 int
	GameType              string
	Teams                 []TeamStats
	Participants          []Participant
	GameDuration          float64
	GameCreation          float64
}

MatchData This object contains the data of a match.

type MatchEvent

type MatchEvent struct {
	Timestamp float64
	Type      string
}

MatchEvent This object contains event data.

type MatchFrame

type MatchFrame struct {
	Timestamp float64
	Frames    map[int]MatchParticipantFrame `json:"participantFrames"`
	Events    []MatchEvent
}

MatchFrame This object contains a frame of a timeline.

type MatchList

type MatchList struct {
	Matches    []MatchReference
	TotalGames int
	StartIndex int
	EndIndex   int
}

MatchList This object contains a list of matches.

type MatchParticipantFrame

type MatchParticipantFrame struct {
	TotalGold           int
	TeamScore           int
	ParticipantID       int
	Level               int
	CurrentGold         int
	MinionsKilled       int
	DominionScore       int
	Position            MatchPosition
	Xp                  int
	JungleMinionsKilled int
}

MatchParticipantFrame This object contains a participant data in a MatchFrame.

type MatchPosition

type MatchPosition struct {
	X, Y int
}

MatchPosition This object contains the coordinates of a participant.

type MatchReference

type MatchReference struct {
	Lane       string
	ID         float64 `json:"gameId"`
	Champion   int
	PlatformID string
	Season     int
	Queue      int
	Role       string
	Timestamp  float64
}

MatchReference This object contains a reference to a match.

type MatchTimeline

type MatchTimeline struct {
	Frames        []MatchFrame
	FrameInterval float64
}

MatchTimeline This object contains the timeline of a match.

type MetaDataDto

type MetaDataDto struct {
	Tier   string
	Type   string
	IsRune bool
}

MetaDataDto This object contains meta data.

type MiniSeries

type MiniSeries struct {
	Progress string
	Losses   int
	Wins     int
	Target   int
}

MiniSeries This object contains mini series information.

type Observer

type Observer struct {
	EncryptionKey string
}

Observer Contains the encryption key of a game.Used for spectating

type Participant

type Participant struct {
	Stats                     ParticipantStats
	ParticipantID             int
	Runes                     []RuneDto
	Timeline                  ParticipantTimeline
	TeamID                    int
	Spell2Id                  int
	Masteries                 []MasteryDto
	HighestAchievedSeasonTier string
	Spell1ID                  int
	ChampionID                int
}

Participant This object contains participant data.

type ParticipantIdentity

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

ParticipantIdentity This object contains the identity of a participant. Only works in ranked matches.

type ParticipantStats

type ParticipantStats struct {
	PhysicalDamageDealt             float64
	NeutralMinionsKilledTeamJungle  int
	MagicDamageDealt                float64
	TotalPlayerScore                int
	Deaths                          int
	Win                             bool
	NeutralMinionsKilledEnemyJungle int
	AltarsCaptured                  int
	LargestCriticalStrike           int
	TotalDamageDealt                float64
	MagicDamageDealtToChampions     float64
	MagicalDamageTaken              float64
	VisionWardsBoughtInGame         int
	LargestMultiKill                int
	LargestKillingSpree             int
	Item1                           int
	QuadraKills                     int
	TeamObjective                   int
	TotalTimeCrowdControlDealt      int
	Float64estTimeSpentLiving       int
	WasAfk                          bool
	WardsKilled                     int
	FirstTowerAssist                bool
	EarlySurrenderAccomplice        bool
	Leaver                          bool
	FirstTowerKill                  bool
	Item2                           int
	Item3                           int
	CausedEarlySurrender            bool
	FirstBloodAssist                bool
	Item6                           int
	WardsPlaced                     int
	Item4                           int
	Item5                           int
	TurretKills                     int
	TripleKills                     int
	ChampLevel                      int
	NodeNeutralizeAssist            int
	FirstInhibitorKill              bool
	GoldEarned                      int
	TeamEarlySurrendered            bool
	UnrealKills                     int
	Kills                           int
	DoubleKills                     int
	NodeCaptureAssist               int
	TrueDamageTaken                 float64
	NodeNeutralize                  int
	FirstInhibitorAssist            bool
	Assists                         int
	TotalScoreRank                  int
	NeutralMinionsKilled            int
	ObjectivePlayerScore            int
	CombatPlayerScore               int
	AltarsNeutralized               int
	PhysicalDamageDealtToChampions  float64
	GoldSpent                       int
	TrueDamageDealt                 float64
	GameEndedInSurrender            bool
	TrueDamageDealtToChampions      float64
	ParticipantID                   int
	PentaKills                      int
	GameEndedInEarlySurrender       bool
	TotalHeal                       float64
	TotalMinionsKilled              int
	FirstBloodKill                  bool
	NodeCapture                     int
	SightWardsBoughtInGame          int
	TotalDamageDealtToChampions     float64
	TotalUnitsHealed                int
	InhibitorKills                  int
	TotalDamageTaken                float64
	KillingSprees                   int
	Item0                           int
	PhysicalDamageTaken             float64
}

ParticipantStats This object contains the statistics of a Participant.

type ParticipantTimeline

type ParticipantTimeline struct {
	Lane                        string
	ParticipantID               int
	CsDiffPerMinDeltas          map[string]float64
	GoldPerMinDeltas            map[string]float64
	XpDiffPerMinDeltas          map[string]float64
	CreepsPerMinDeltas          map[string]float64
	XpPerMinDeltas              map[string]float64
	Role                        string
	DamageTakenDiffPerMinDeltas map[string]float64
	DamageTakenPerMinDeltas     map[string]float64
}

ParticipantTimeline This object contains the timeline of a Participant.

type PassiveDto

type PassiveDto struct {
	Image                ImageDto
	Description          string
	SanitizedDescription string
	Name                 string
}

PassiveDto This object contains champion passive data.

type Player

type Player struct {
	CurrentPlatformID string
	SummonerName      string
	MatchHistoryURI   string
	PlatformID        string
	CurrentAccountID  float64
	ProfileIcon       int
	SummonerID        float64
	AccountID         float64
}

Player This object contains player information.

type RealmDto

type RealmDto struct {
	Lg             string
	Dd             string
	L              string
	N              map[string]string
	ProfileIconMax int
	Store          string
	V              string
	Cdn            string
	CSS            string
}

RealmDto This object contains realm data.

type RecommendedDto

type RecommendedDto struct {
	Map      string
	Champion string
	Title    string
	Priority bool
	Mode     string
	Type     string
	// contains filtered or unexported fields
}

RecommendedDto This object contains champion recommended data.

type Region

type Region struct {
	Name       string
	PlatformID string
	Host       string
}

Region Struct containing information about a region

type Rune

type Rune struct {
	Count int
	ID    int `json:"runeId"`
}

Rune Holds the data of a rune .To get more information about the rune, you need to query the Static Data.

type RuneDto

type RuneDto struct {
	PlainText            string
	HideFromAll          bool
	InStore              bool
	Into                 []string
	ID                   int
	Stats                BasicDataStatsDto
	Colloq               string
	Maps                 map[string]bool
	SpecialRecipe        int
	Image                ImageDto
	Description          string
	Tags                 []string
	RequiredChampion     string
	From                 []string
	Group                string
	ConsumeOnFull        bool
	Name                 string
	Consumed             bool
	SanitizedDescription string
	Depth                int
	Rune                 MetaDataDto
	Stacks               int
}

RuneDto This object contains rune data.

type RuneListDto

type RuneListDto struct {
	Data    map[string]RuneDto
	Version string
	Type    string
	Basic   BasicDataDto
}

RuneListDto This object contains rune list data.

type RunePage

type RunePage struct {
	Current bool
	Slots   []RuneSlot
	Name    string
	ID      int
}

RunePage Holds the data of a rune page.The runes are in Slots.

type RunePages

type RunePages struct {
	Pages []RunePage
	ID    int
}

RunePages Holds the runes pages of a summoner and his summoner ID.

type RuneSlot

type RuneSlot struct {
	RuneSlotID int
	ID         int `json:"runeId"`
}

RuneSlot Holds the data of a rune slot.To get more information about the rune, you need to query the Static Data.

type ShardService

type ShardService struct {
	Status    string
	Incidents []StatusIncident
	Name      string
	Slug      string
}

ShardService Data from a service

type ShardStatus

type ShardStatus struct {
	Name      string
	RegionTag string `json:"region_tag"`
	Hostname  string
	Services  []ShardService
	Slug      string
	Locales   []string
}

ShardStatus Holds the response from the Lol-Status-V3 endpoint.

type SkinDto

type SkinDto struct {
	Num  int
	Name string
	ID   int
}

SkinDto This object contains champion skin data.

type SpellVarsDto

type SpellVarsDto struct {
	RanksWith string
	Dyn       string
	Link      string
	Coeff     []float32
	Key       string
}

SpellVarsDto This object contains spell vars data.

type StaticChampion

type StaticChampion struct {
	Info        InfoDto
	EnemyTips   []string
	Stats       StatsDto
	Name        string
	Title       string
	Image       ImageDto
	Tags        []string
	Partype     string
	Skins       []SkinDto
	Passive     PassiveDto
	Recommended []RecommendedDto
	AllyTips    []string
	Key         string
	Lore        string
	ID          int
	Blurb       string
	Spells      []ChampionSpellDto
}

StaticChampion This object contains champion data.

type StaticChampionList

type StaticChampionList struct {
	Data    map[string]StaticChampion
	Keys    map[string]string
	Version string
	Type    string
	Format  string
}

StaticChampionList This object contains champion list data.

type StatsDto

type StatsDto struct {
	Armorperlevel        float32
	Hpperlevel           float32
	Attackdamage         float32
	Mpperlevel           float32
	Attackspeedoffset    float32
	Armor                float32
	Hp                   float32
	Hpregenperlevel      float32
	Spellblock           float32
	Attackrange          float32
	Movespeed            float32
	Attackdamageperlevel float32
	Mpregenperlevel      float32
	Mp                   float32
	Spellblockperlevel   float32
	Crit                 float32
	Mpregen              float32
	Attackspeedperlevel  float32
	Hpregen              float32
	Critperlevel         float32
}

StatsDto This object contains champion stats data.

type StatusIncident

type StatusIncident struct {
	Active    bool
	CreatedAt string `json:"created_at"`
	ID        float64
	Updates   []StatusMessage
}

StatusIncident Data from an incident of a service

type StatusMessage

type StatusMessage struct {
	StatusMessage string
	Author        string
	CreatedAt     string `json:"created_at"`
	Translations  []StatusMessageTranslation
	UpdatedAt     string `json:"updated_at"`
	Content       string
	ID            string
}

StatusMessage A message of an accident.Contains the translations in Translations

type StatusMessageTranslation

type StatusMessageTranslation struct {
	Locale    string
	Content   string
	UpdatedAt string `json:"updated_at"`
}

StatusMessageTranslation Translation of a Message

type Summoner

type Summoner struct {
	Name          string  `json:"name"`
	ID            float64 `json:"id"`
	AccountID     float64 `json:"accountId"`
	Summonerlevel int     `json:"summonerLevel"`
	ProfileIconID int     `json:"profileIconId"`
	RevisionDate  int     `json:"revisionDate"`
	Region        *Region
	API           *GoLOLAPI
}

Summoner Contains a SummonerDto Object

func (*Summoner) GetChampionMasteries

func (s *Summoner) GetChampionMasteries() (masteries []ChampionMastery)

GetChampionMasteries Get all champion mastery entries.

func (*Summoner) GetCurrentGame

func (s *Summoner) GetCurrentGame() (game CurrentGameInfo, e error)

GetCurrentGame Get current game information for the given summoner ID.

func (*Summoner) GetLeagueEntries

func (s *Summoner) GetLeagueEntries() (leagues map[string][]League)

GetLeagueEntries Get league entries mapped by summoner ID for a given list of summoner ID. Returns all league entries for specified summoners and summoners' teams.

func (*Summoner) GetLeagues

func (s *Summoner) GetLeagues() (leagues map[string][]League)

GetLeagues Get leagues mapped by summoner ID for a given list of summoner ID. Returns all leagues for specified summoners and his teams. Entries for each requested participant (i.e., each summoner and related teams) will be included in the returned leagues data, whether or not the participant is inactive. However, no entries for other inactive summoners or teams in the leagues will be included.

func (*Summoner) GetMasteryOfChampion

func (s *Summoner) GetMasteryOfChampion(championID int) (mastery ChampionMastery)

GetMasteryOfChampion Get mastery entry of a champion.

func (*Summoner) GetMasteryPages

func (s *Summoner) GetMasteryPages() (pages MasteryPages)

GetMasteryPages Makes a request to the Masteries-V3 endpoint and returns a MasteryPages struct

func (*Summoner) GetRecentMatches

func (s *Summoner) GetRecentMatches() (list MatchList)

GetRecentMatches Get matchlist for last 20 matches played of given summoner

func (*Summoner) GetRunePages

func (s *Summoner) GetRunePages() (pages RunePages)

GetRunePages Makes a request to the Runes-V3 endpoint and returns a RunePages struct

func (*Summoner) GetTotalChampionMastery

func (s *Summoner) GetTotalChampionMastery() (score int)

GetTotalChampionMastery Get a player's total champion mastery score, which is the sum of individual champion mastery levels.

type SummonerSpellDto

type SummonerSpellDto struct {
	Vars                 []SpellVarsDto
	Image                ImageDto
	CostBurn             string
	Cooldown             []float64
	EffectBurn           []string
	ID                   int
	CooldownBurn         string
	Tooltip              string
	MaxRank              int
	RangeBurn            string
	Description          string
	Effect               [][]float64
	Key                  string
	LevelTip             LevelTipDto
	Modes                []string
	Ressource            string
	Name                 string
	CostType             string
	SanitizedDescription string
	SanitizedTooltip     string
	Range                []int
	Cost                 []int
	SummonerLevel        int
}

SummonerSpellDto This object contains summoner spell data.

type SummonerSpellListDto

type SummonerSpellListDto struct {
	Data    map[string]SummonerSpellDto
	Version string
	Type    string
}

SummonerSpellListDto This object contains summoner spell list data.

type TeamBans

type TeamBans struct {
	PickTurn   int
	ChampionID int
}

TeamBans This object contains the bans of a team.

type TeamStats

type TeamStats struct {
	FirstDragon          bool
	FirstInhibitor       bool
	Bans                 []TeamBans
	BaronKills           int
	FirstRiftHerald      bool
	FirstBaron           bool
	RiftHeraldKills      int
	FirstBlood           bool
	TeamID               int
	FirstTower           bool
	VilemawKills         int
	InhibitorKills       int
	TowerKills           int
	DominionVictoryScore int
	Win                  string
	DragonKills          int
}

TeamStats This object contains statistics of a match.

Jump to

Keyboard shortcuts

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