Documentation ¶
Overview ¶
Package heimer 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.
Example:
client := heimer.NewClient("API KEY", heimer.WithRegion(api.RegionNorthAmerica), heimer.WithLogger(logrus.New().WithField("foo", "bar"))) summoner, _ := client.Riot.Summoner.GetByName("SK Jenax") fmt.Printf("%s is a level %d summoner\n", summoner.Name, summoner.SummonerLevel) champion, _ := client.DataDragon.GetChampion("Ashe") mastery, err := client.Riot.ChampionMastery.Get(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.Riot.League.GetChallenger(api.QueueRankedSolo) rank1 := challengers.GetRank(0) fmt.Printf("%s is the highest ranked player with %d league points\n", rank1.SummonerName, rank1.LeaguePoints)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Riot *riot.Client DataDragon *datadragon.Client Static *static.Client // contains filtered or unexported fields }
Client is a client for both the Riot API and the Data Dragon service
type Option ¶
type Option func(*Client)
Option is used to alter the attributes of a client
func WithClient ¶
WithClient sets the given http client for the heimer client
func WithLogger ¶
func WithLogger(l log.FieldLogger) Option
WithLogger sets the given logger for the heimer client
func WithRegion ¶
WithRegion sets the given region for the heimer client
Directories ¶
Path | Synopsis |
---|---|
Package api contains constant values for regions and error values for known error return codes from the various APIs
|
Package api contains constant values for regions and error values for known error return codes from the various APIs |
Package datadragon provides methods for retrieving data from the DataDragon API.
|
Package datadragon provides methods for retrieving data from the DataDragon API. |
mock
Package mock includes mock constructs used for testing the API.
|
Package mock includes mock constructs used for testing the API. |
Package riot provides methods for accessing the Riot API for League of Legends.
|
Package riot provides methods for accessing the Riot API for League of Legends. |
Package static provides methods to access static data and constant values used by the Riot API.
|
Package static provides methods to access static data and constant values used by the Riot API. |
Click to show internal directories.
Click to hide internal directories.