equinox

package module
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 7 Imported by: 1

README

Equinox

GoDoc Test Status

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.

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

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Equinox

type Equinox struct {
	Riot *riot.RiotClient
	LOL  *lol.LOLClient
	TFT  *tft.TFTClient
	LOR  *lor.LORClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(key string) (*Equinox, error)

Creates a new Equinox client with a default configuration

  • `Cluster` : api.Americas
  • `LogLevel` : api.FatalLevel
  • `Timeout` : 10
  • `Retry` : true

func NewClientWithConfig added in v0.3.0

func NewClientWithConfig(config *api.EquinoxConfig) (*Equinox, error)

Creates a new Equinox client using a custom configuration.

If you don't specify a Timeout this will disable the timeout for the http.Client.

Directories

Path Synopsis
codegen module

Jump to

Keyboard shortcuts

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