func (c *Client) GetChampions() ([]ChampionData, error) {
	unlock, toggle := internal.RWLockToggle(&c.championsMu)
	defer unlock()
	if atomic.CompareAndSwapUint32(&c.getChampionsToggle, 0, 1) {
		toggle()
		var champions map[string]ChampionData
		if err := c.getInto("/champion.json", &champions); err != nil {
			return nil, err
		}
		for _, champion := range champions {
			data := ChampionDataExtended{ChampionData: champion}
			c.championsByName[champion.Name] = data
		}
	}
	res := make([]ChampionData, 0, len(c.championsByName))
	for _, champion := range c.championsByName {
		res = append(res, champion.ChampionData)
	}
	return res, nil
}
GetChampions returns all existing champions
package datadragon
import (
	"encoding/json"
	"fmt"
	"net/http"
	"strconv"
	"strings"
	"sync"
	"sync/atomic"
	log "github.com/sirupsen/logrus"
	"github.com/KnutZuidema/golio/api"
	"github.com/KnutZuidema/golio/internal"
)
const (
	latestRuneAndMasteryVersion = "7.23.1"
	fallbackVersion             = "9.10.1"
	fallbackLanguage            = LanguageCodeUnitedStates
)
var (
	regionToRealmRegion = map[api.Region]string{
		api.RegionEuropeWest:        "euw",
		api.RegionEuropeNorthEast:   "eun",
		api.RegionJapan:             "jp",
		api.RegionKorea:             "kr",
		api.RegionLatinAmericaNorth: "lan",
		api.RegionLatinAmericaSouth: "las",
		api.RegionNorthAmerica:      "na",
		api.RegionOceania:           "oce",
		api.RegionPBE:               "pbe",
		api.RegionRussia:            "ru",
		api.RegionTurkey:            "tr",
		api.RegionBrasil:            "br",
	}
)
type Client struct {
	logger             log.FieldLogger
	Version            string
	Language           languageCode
	client             internal.Doer
	championsMu        sync.RWMutex
	championsByName    map[string]ChampionDataExtended
	getChampionsToggle uint32
	profileIconsMu     sync.RWMutex
	profileIcons       []ProfileIcon
	itemsMu            sync.RWMutex
	items              []Item
	masteriesMu        sync.RWMutex
	masteries          []Mastery
	runesMu            sync.RWMutex
	runes              []Item
	summonersMu        sync.RWMutex
	summoners          []SummonerSpell
}
func NewClient(client internal.Doer, region api.Region, logger log.FieldLogger) *Client {
	c := &Client{
		client:          client,
		logger:          logger.WithField("client", "data dragon"),
		championsByName: map[string]ChampionDataExtended{},
	}
	if err := c.init(regionToRealmRegion[region]); err != nil {
		c.Version = fallbackVersion
		c.Language = fallbackLanguage
	}
	return c
}
func (c *Client) init(region string) error {
	var res struct {
		Version  string `json:"v"`
		Language string `json:"l"`
	}
	response, err := c.doRequest(dataDragonBaseURL, fmt.Sprintf("/realms/%s.json", region))
	if err != nil {
		return err
	}
	if response.Body == nil {
		return fmt.Errorf("no response body")
	}
	if err := json.NewDecoder(response.Body).Decode(&res); err != nil {
		return err
	}
	c.Version = res.Version
	c.Language = languageCode(res.Language)
	return nil
}