equinox

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 4 Imported by: 1

README

Equinox

This shouldn't be used in any production environment, this is just a practice tool for me to learn CI/CD using Github actions and tests in golang. But hey, unless you really want to use this package just so you can use for the single endpoint implemented, hey uh, have fun.

I was recommended Alex Pliutau's video on youtube and got curious about other aspects like tests.

TODO

Improve project structure

I think the best approach for this project would be to separate LOL and others Riot games in modules, although I am not certain on how I would implement this yet. Currently, even if I supported just LOL endpoints, the project would quickly become a mess to navigate. This should be solved before I even try to implement other endpoints.

Tests

I am not sure if tests are 'good enough', I am just checking if errors are Nil and the response is NotNil using testify.

Documentation

Index

Constants

View Source
const (
	LOLBaseURL          = "/lol/platform"
	ChampionEndpointURL = "/v3/champion-rotations"
)

URLs

Variables

This section is empty.

Functions

This section is empty.

Types

type Champion

type Champion struct {
	*Equinox
}

func (*Champion) FreeRotation

func (c *Champion) FreeRotation(region Region) (*FreeChampionsRotation, error)

Free Champions Rotation

type Equinox

type Equinox struct {
	LOL *LOLClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(key string) *Equinox

Returns a new Equinox client using the API key provided

type ErrorResponse

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

type FreeChampionsRotation

type FreeChampionsRotation struct {
	FreeChampionIds              []int `json:"freeChampionIds"`
	FreeChampionIdsForNewPlayers []int `json:"freeChampionIdsForNewPlayers"`
	MaxNewPlayerLevel            int   `json:"maxNewPlayerLevel"`
}

type LOLClient

type LOLClient struct {
	*Equinox
	Champion
}

func NewLOLClient

func NewLOLClient(base *Equinox) *LOLClient

type Region

type Region string
const (
	BR1 Region = "br1"
	NA1 Region = "na1"
)

Region enums

Directories

Path Synopsis
codegen module

Jump to

Keyboard shortcuts

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