api

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 4 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,
		},
	}

	UnauthorizedError = ErrorResponse{
		Status: Status{
			Message:    "Unauthorized",
			StatusCode: http.StatusUnauthorized,
		},
	}

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

	RateLimitedError = ErrorResponse{
		Status: Status{
			Message:    "Rate limited",
			StatusCode: http.StatusTooManyRequests,
		},
	}
)

Functions

This section is empty.

Types

type Cluster added in v0.7.1

type Cluster string
const (
	Americas Cluster = "americas"
	Europe   Cluster = "europe"
	Esports  Cluster = "esports"
	Asia     Cluster = "asia"
)

Riot API clusters

type Division added in v0.6.0

type Division string
const (
	I   Division = "I"
	II  Division = "II"
	III Division = "III"
	IV  Division = "IV"
)

type EquinoxConfig added in v0.3.0

type EquinoxConfig struct {
	// Riot API Key.
	Key string
	// Cluster name, using the nearest cluster to you is recommended.
	Cluster Cluster
	// Log level. Default: api.FatalLevel
	LogLevel LogLevel
	// 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
}

An config object for the EquinoxClient.

func (*EquinoxConfig) MarshalLogObject added in v0.7.0

func (c *EquinoxConfig) MarshalLogObject(encoder zapcore.ObjectEncoder) error

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 Game added in v0.7.1

type Game string
const (
	LOR Game = "lor"
	VAL Game = "val"
)

type LogLevel added in v0.7.0

type LogLevel int8
const (
	DebugLevel LogLevel = -1
	InfoLevel  LogLevel = 0
	WarnLevel  LogLevel = 1
	ErrorLevel LogLevel = 2
	FatalLevel LogLevel = 5
)

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