medalha01 / equinox

Riot Games API client written in golang.

Home Page:https://pkg.go.dev/github.com/Kyagara/equinox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Equinox

equinox release (latest SemVer) GoDoc Test Status Test Coverage

Equinox is a Riot Games API client written in golang with the goal of providing an easy to use interface to interact with all of the Riot Games API endpoints and the Data Dragon service.

Implemented:

  • Data Dragon
  • Riot Account
  • League of Legends
  • Teamfight Tactics
  • Valorant
  • Legends of Runeterra

Installation

To install equinox you can either import it in a package:

import "github.com/Kyagara/equinox"

and run go get without any parameters, or, if you want to use the latest version from this repo, you can use the following command:

go get github.com/Kyagara/equinox@master

Example

package main

import (
	"fmt"

	"github.com/Kyagara/equinox"
	"github.com/Kyagara/equinox/lol"
)

func main() {
	// For custom configurations, you can use NewClientWithConfig(),
	// you will need to provide an api.EquinoxConfig{} object.
	client, err := equinox.NewClient("RIOT_API_KEY")

	if err != nil {
		fmt.Println("error creating client: ", err)
		return
	}

	// Get this week's champion rotations.
	rotation, err := client.LOL.Champion.Rotations(lol.BR1)

	if err != nil {
		fmt.Println("error retrieving champion rotations: ", err)
		return
	}

	fmt.Printf("%+v\n", rotation)
	// &{FreeChampionIDs:[17 43 56 62 67 79 85 90 133 145 147 157 201 203 245 518]
	// FreeChampionIDsForNewPlayers:[222 254 427 82 131 147 54 17 18 37]
	// MaxNewPlayerLevel:10}
}

Disclaimer

Equinox isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.

About

Riot Games API client written in golang.

https://pkg.go.dev/github.com/Kyagara/equinox

License:MIT License


Languages

Language:Go 100.0%