ddragon

package
v0.0.0-...-e1d3906 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ddragon provides bindings to the Riots data dragon CDN.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersion

func GetVersion(v string) (string, error)

GetVersion validates the given version v against the array of valid versions collected from the API. If v is empty or equals "latest", the most recent version string will be returned. If the given version string is invalid, an error will be returned.

func GetVersions

func GetVersions() (res []string, err error)

GetVersions returns an array of valid LoL patch version strings.

Types

type Champion

type Champion struct {
	UID  string `json:"uid"`
	Name string `json:"name"`
}

Champion describes a champion object.

func GetChampions

func GetChampions(v string) ([]*Champion, error)

GetChampions returns an array of Champion objects collected from the datadragon API.

type DDragon

type DDragon struct {
	Version   string      `json:"version"`
	Champions []*Champion `json:"champions"`
	Runes     []*RuneTree `json:"runes"`
}

DDragon wraps the current LoL patch version and information about champions and runes collected from Riot's Datadragon API.

var DDragonInstance *DDragon

func Fetch

func Fetch(version string) (d *DDragon, err error)

Fetch collects version, champion and rune information from the Datadragon API and wraps them into a DDragon object returned.

type Rune

type Rune struct {
	UID       string `json:"uid"`
	Name      string `json:"name"`
	ShortDesc string `json:"shortDesc"`
	LongDesc  string `json:"longDesc"`
}

Rune describes the properties of a rune in a rune tree row.

type RuneSlot

type RuneSlot struct {
	Runes []*Rune `json:"runes"`
}

RuneSlot wraps a row of runes.

type RuneTree

type RuneTree struct {
	UID   string      `json:"uid"`
	Name  string      `json:"name"`
	Slots []*RuneSlot `json:"slots"`
}

RuneTree describes a rune tree and contains the rune slots for this tree.

func GetRunes

func GetRunes(v string) (res []*RuneTree, err error)

GetRunes returns an array of RuneTree objects collected from the datadragon API.

Jump to

Keyboard shortcuts

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