golio: github.com/KnutZuidema/golio Index | Files | Directories

package golio

import "github.com/KnutZuidema/golio"

Package golio is a wrapper for the Riot API and the Data Dragon service. It is written purely in Go and provides idiomatic access to all API endpoints.


client := golio.NewClient(golio.RegionEuropeWest, "API KEY",
	http.DefaultClient, log.StandardLogger())
summoner, _ := client.GetSummonerByName("SK Jenax")
fmt.Printf("%s is a level %d summoner\n", summoner.Name, summoner.SummonerLevel)
champion, _ := client.GetChampion("Ashe")
mastery, err := client.GetChampionMastery(summoner.ID, champion.Key)
if err != nil {
	fmt.Printf("%s has not played any games on %s\n", summoner.Name, champion.Name)
} else {
	fmt.Printf("%s has mastery level %d with %d points on %s\n", summoner.Name, mastery.ChampionLevel,
		mastery.ChampionPoints, champion.Name)
challengers, _ := client.GetChallengerLeague(api.QueueRankedSolo)
rank1 := challengers.GetRank(0)
fmt.Printf("%s is the highest ranked player with %d league points\n", rank1.SummonerName, rank1.LeaguePoints)


Package Files


type Client Uses

type Client struct {

Client is a client for both the Riot API and the Data Dragon service

func NewClient Uses

func NewClient(region api.Region, apiKey string, client api.Doer, logger log.FieldLogger) *Client

NewClient returns a new client for both the Riot API and the Data Dragon service


apiPackage api contains the implementation for all Riot API and Data Dragon endpoints, as well as constant values used throughout the API and error values for known error return codes from the Riot API
mockPackage mock includes mock constructs used for testing the API.
modelPackage model includes all API object models.

Package golio imports 2 packages (graph). Updated 2019-08-03. Refresh now. Tools for package owners.