api

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Base API URL format
	BaseURLFormat = "https://%s.api.riotgames.com"
)

Variables

View Source
var (
	NotFoundError = ErrorResponse{
		Status: Status{
			Message:    "Not Found",
			StatusCode: http.StatusNotFound,
		},
	}

	ForbiddenError = ErrorResponse{
		Status: Status{
			Message:    "Forbidden",
			StatusCode: http.StatusForbidden,
		},
	}
)

Functions

This section is empty.

Types

type EquinoxConfig added in v0.3.0

type EquinoxConfig struct {
	// Riot API Key.
	Key string
	// Debug mode. Default: false
	Debug bool
	// Timeout for http.Request in seconds, 0 disables it. Default: 10
	Timeout time.Duration
	// Retry request if it returns a 429 status code. Default: true
	Retry bool
	// Retry count. Default: 1
	RetryCount int8
}

An config object for the EquinoxClient.

func NewTestEquinoxConfig added in v0.3.0

func NewTestEquinoxConfig() *EquinoxConfig

Creates an EquinoxConfig for tests.

type ErrorResponse added in v0.3.0

type ErrorResponse struct {
	Status Status `json:"status"`
}

func (ErrorResponse) Error added in v0.3.0

func (e ErrorResponse) Error() string

type Region

type Region string
const (
	RiotRouteAmericas Region = "americas"
	RiotRouteEurope   Region = "europe"
	RiotRouteAsia     Region = "asia"
)

Riot API routes

const (
	LOLRegionBR1  Region = "br1"
	LOLRegionEUN1 Region = "eun1"
	LOLRegionEUW1 Region = "euw1"
	LOLRegionJP1  Region = "jp1"
	LOLRegionKR   Region = "kr"
	LOLRegionLA1  Region = "la1"
	LOLRegionLA2  Region = "la2"
	LOLRegionNA1  Region = "na1"
	LOLRegionOC1  Region = "oc1"
	LOLRegionRU   Region = "ru"
	LOLRegionTR1  Region = "tr1"
)

League of Legends and Teamfight Tactics regions

const (
	VALRegionAP    Region = "ap"
	VALRegionBR    Region = "br"
	VALRegionEU    Region = "eu"
	VALRegionKR    Region = "kr"
	VALRegionLATAM Region = "latam"
	VALRegionNA    Region = "na"
)

Valorant regions

type Status added in v0.3.0

type Status struct {
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`
}

Jump to

Keyboard shortcuts

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