liveclientdata

package
v0.0.0-...-9b756e1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LIVE_CLIENT_DATA_URL string = "https://127.0.0.1:2999/liveclientdata"

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI() *API

func (*API) Get

func (a *API) Get(e string, params url.Values) (*http.Response, error)

func (*API) GetActivePlayer

func (a *API) GetActivePlayer() (ActivePlayer, error)

GetActivePlayer gets all data about the active player.

func (*API) GetActivePlayerAbilities

func (a *API) GetActivePlayerAbilities() (Abilities, error)

GetActivePlayerAbilities gets Abilities for the active player.

func (*API) GetActivePlayerName

func (a *API) GetActivePlayerName() (string, error)

GetActivePlayerName returns the player name.

func (*API) GetActivePlayerRunes

func (a *API) GetActivePlayerRunes() (FullRunes, error)

GetActivePlayerRunes retrieves the full list of runes for the active player.

func (*API) GetAllGameData

func (a *API) GetAllGameData() (AllGameData, error)

func (*API) GetAllPlayers

func (a *API) GetAllPlayers() ([]Player, error)

GetAllPlayers retrieves the list of heroes in the game and their stats.

func (*API) GetEvents

func (a *API) GetEvents() (Events, error)

GetEvents gets a list of events that have occurred in the game.

func (*API) GetGameData

func (a *API) GetGameData() (GameData, error)

GetGameData gets basic data about the game.

func (*API) GetPlayerItems

func (a *API) GetPlayerItems(playerName string) ([]Item, error)

GetPlayerItems retrieves the list of items for the player.

func (*API) GetPlayerMainRunes

func (a *API) GetPlayerMainRunes(playerName string) (Runes, error)

GetPlayerMainRunes retrieves the basic runes of any player.

func (*API) GetPlayerScores

func (a *API) GetPlayerScores(playerName string) (Scores, error)

GetPlayerScores retrieves the list of the current scores for the player.

func (*API) GetPlayerSummonerSpells

func (a *API) GetPlayerSummonerSpells(playerName string) (SummonerSpells, error)

GetPlayerSummonerSpells retrieves the list of the summoner spells for the player.

func (*API) HTTPClient

func (a *API) HTTPClient(c *http.Client) *API

HTTPClient sets the HTTP Client used by the LiveClientData API

type APIError

type APIError struct {
	ErrorCode             string      `json:"errorCode"`
	HTTPStatus            int         `json:"httpStatus"`
	ImplementationDetails interface{} `json:"implementationDetails"`
	Message               string      `json:"message"`
}

type Abilities

type Abilities struct {
	E       Ability `json:"E"`
	Passive Ability `json:"Passive"`
	Q       Ability `json:"Q"`
	R       Ability `json:"R"`
	W       Ability `json:"W"`
}

type Ability

type Ability struct {
	AbilityLevel   int    `json:"abilityLevel,omitempty"`
	DisplayName    string `json:"displayName"`
	ID             string `json:"id"`
	RawDescription string `json:"rawDescription"`
	RawDisplayName string `json:"rawDisplayName"`
}

type ActivePlayer

type ActivePlayer struct {
	Abilities     Abilities     `json:"abilities"`
	ChampionStats ChampionStats `json:"championStats"`
	CurrentGold   float64       `json:"currentGold"`
	FullRunes     FullRunes     `json:"fullRunes"`
	Level         int           `json:"level"`
	SummonerName  string        `json:"summonerName"`
}

type AllGameData

type AllGameData struct {
	ActivePlayer ActivePlayer `json:"activePlayer"`
	AllPlayers   []Player     `json:"allPlayers"`
	Events       Events       `json:"events"`
	GameData     GameData     `json:"gameData"`
}

type ChampionStats

type ChampionStats struct {
	AbilityHaste                 float64 `json:"abilityHaste"`
	AbilityPower                 float64 `json:"abilityPower"`
	Armor                        float64 `json:"armor"`
	ArmorPenetrationFlat         float64 `json:"armorPenetrationFlat"`
	ArmorPenetrationPercent      float64 `json:"armorPenetrationPercent"`
	AttackDamage                 float64 `json:"attackDamage"`
	AttackRange                  float64 `json:"attackRange"`
	AttackSpeed                  float64 `json:"attackSpeed"`
	BonusArmorPenetrationPercent float64 `json:"bonusArmorPenetrationPercent"`
	BonusMagicPenetrationPercent float64 `json:"bonusMagicPenetrationPercent"`
	CritChance                   float64 `json:"critChance"`
	CritDamage                   float64 `json:"critDamage"`
	CurrentHealth                float64 `json:"currentHealth"`
	HealthRegenRate              float64 `json:"healthRegenRate"`
	LifeSteal                    float64 `json:"lifeSteal"`
	MagicLethality               float64 `json:"magicLethality"`
	MagicPenetrationFlat         float64 `json:"magicPenetrationFlat"`
	MagicPenetrationPercent      float64 `json:"magicPenetrationPercent"`
	MagicResist                  float64 `json:"magicResist"`
	MaxHealth                    float64 `json:"maxHealth"`
	MoveSpeed                    float64 `json:"moveSpeed"`
	PhysicalLethality            float64 `json:"physicalLethality"`
	ResourceMax                  float64 `json:"resourceMax"`
	ResourceRegenRate            float64 `json:"resourceRegenRate"`
	ResourceType                 string  `json:"resourceType"`
	ResourceValue                float64 `json:"resourceValue"`
	SpellVamp                    float64 `json:"spellVamp"`
	Tenacity                     float64 `json:"tenacity"`
}

type Event

type Event struct {
	EventID      int      `json:"EventID"`
	EventName    string   `json:"EventName"`
	EventTime    float64  `json:"EventTime"`
	Assisters    []string `json:"Assisters,omitempty"`
	DragonType   string   `json:"DragonType,omitempty"`
	KillerName   string   `json:"KillerName,omitempty"`
	Recipient    string   `json:"Recipient,omitempty"`
	Stolen       string   `json:"Stolen,omitempty"`
	TurretKilled string   `json:"TurretKilled,omitempty"`
	VictimName   string   `json:"VictimName,omitempty"`
}

type Events

type Events struct {
	Events []Event `json:"Events"`
}

type FullRunes

type FullRunes struct {
	GeneralRunes      []Rune `json:"generalRunes"`
	Keystone          Rune   `json:"keystone"`
	PrimaryRuneTree   Rune   `json:"primaryRuneTree"`
	SecondaryRuneTree Rune   `json:"secondaryRuneTree"`
	StatRunes         []Rune `json:"statRunes"`
}

type GameData

type GameData struct {
	GameMode   string  `json:"gameMode"`
	GameTime   float64 `json:"gameTime"`
	MapName    string  `json:"mapName"`
	MapNumber  int     `json:"mapNumber"`
	MapTerrain string  `json:"mapTerrain"`
}

type Item

type Item struct {
	CanUse         bool   `json:"canUse"`
	Consumable     bool   `json:"consumable"`
	Count          int    `json:"count"`
	DisplayName    string `json:"displayName"`
	ItemID         int    `json:"itemID"`
	Price          int    `json:"price"`
	RawDescription string `json:"rawDescription"`
	RawDisplayName string `json:"rawDisplayName"`
	Slot           int    `json:"slot"`
}

type Player

type Player struct {
	ChampionName    string         `json:"championName"`
	IsBot           bool           `json:"isBot"`
	IsDead          bool           `json:"isDead"`
	Items           []Item         `json:"items"`
	Level           int            `json:"level"`
	Position        string         `json:"position"`
	RawChampionName string         `json:"rawChampionName"`
	RespawnTimer    float64        `json:"respawnTimer"`
	Runes           Runes          `json:"runes"`
	Scores          Scores         `json:"scores"`
	SkinID          int            `json:"skinID"`
	SummonerName    string         `json:"summonerName"`
	SummonerSpells  SummonerSpells `json:"summonerSpells"`
	Team            string         `json:"team"`
}

type Rune

type Rune struct {
	DisplayName    string `json:"displayName,omitempty"`
	ID             int    `json:"id"`
	RawDescription string `json:"rawDescription"`
	RawDisplayName string `json:"rawDisplayName,omitempty"`
}

type Runes

type Runes struct {
	Keystone          Rune `json:"keystone"`
	PrimaryRuneTree   Rune `json:"primaryRuneTree"`
	SecondaryRuneTree Rune `json:"secondaryRuneTree"`
}

type Scores

type Scores struct {
	Assists    int     `json:"assists"`
	CreepScore int     `json:"creepScore"`
	Deaths     int     `json:"deaths"`
	Kills      int     `json:"kills"`
	WardScore  float64 `json:"wardScore"`
}

type SummonerSpell

type SummonerSpell struct {
	DisplayName    string `json:"displayName"`
	RawDescription string `json:"rawDescription"`
	RawDisplayName string `json:"rawDisplayName"`
}

type SummonerSpells

type SummonerSpells struct {
	SummonerSpellOne SummonerSpell `json:"summonerSpellOne"`
	SummonerSpellTwo SummonerSpell `json:"summonerSpellTwo"`
}

Jump to

Keyboard shortcuts

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