lol

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChampionEndpointURL            = "/lol/platform/v3/champion-rotations"
	StatusEndpointURL              = "/lol/status/v4/platform-data"
	SpectatorEndpointURL           = "/lol/spectator/v4/featured-games"
	SpectatorBySummonerEndpointURL = "/lol/spectator/v4/active-games/by-summoner/%s"
)

League of Legends endpoints

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveGameBySummonerID added in v0.3.0

type ActiveGameBySummonerID struct {
	GameID            int    `json:"gameId"`
	MapID             int    `json:"mapId"`
	GameMode          string `json:"gameMode"`
	GameType          string `json:"gameType"`
	GameQueueConfigID int    `json:"gameQueueConfigId"`
	Participants      []struct {
		TeamID                   int    `json:"teamId"`
		Spell1ID                 int    `json:"spell1Id"`
		Spell2ID                 int    `json:"spell2Id"`
		ChampionID               int    `json:"championId"`
		ProfileIconID            int    `json:"profileIconId"`
		SummonerName             string `json:"summonerName"`
		Bot                      bool   `json:"bot"`
		SummonerID               string `json:"summonerId"`
		GameCustomizationObjects []struct {
			Category string `json:"category"`
			Content  string `json:"content"`
		} `json:"gameCustomizationObjects"`
		Perks struct {
			PerkIds      []int `json:"perkIds"`
			PerkStyle    int   `json:"perkStyle"`
			PerkSubStyle int   `json:"perkSubStyle"`
		} `json:"perks"`
	} `json:"participants"`
	Observers struct {
		EncryptionKey string `json:"encryptionKey"`
	} `json:"observers"`
	PlatformID      string `json:"platformId"`
	BannedChampions []struct {
		ChampionID int `json:"championId"`
		TeamID     int `json:"teamId"`
		PickTurn   int `json:"pickTurn"`
	} `json:"bannedChampions"`
	GameStartTime int `json:"gameStartTime"`
	GameLength    int `json:"gameLength"`
}

type ChampionEndpoint

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

func (*ChampionEndpoint) FreeRotation

func (c *ChampionEndpoint) FreeRotation(region api.Region) (*ChampionInfoDTO, error)

Get Free Champions Rotation

type ChampionInfoDTO added in v0.3.0

type ChampionInfoDTO struct {
	FreeChampionIds              []int16 `json:"freeChampionIds"`
	FreeChampionIdsForNewPlayers []int16 `json:"freeChampionIdsForNewPlayers"`
	MaxNewPlayerLevel            uint8   `json:"maxNewPlayerLevel"`
}

type FeaturedGamesDTO added in v0.3.0

type FeaturedGamesDTO struct {
	GameList []struct {
		GameID            int    `json:"gameId"`
		MapID             int    `json:"mapId"`
		GameMode          string `json:"gameMode"`
		GameType          string `json:"gameType"`
		GameQueueConfigID int    `json:"gameQueueConfigId"`
		Participants      []struct {
			TeamID        int    `json:"teamId"`
			Spell1ID      int    `json:"spell1Id"`
			Spell2ID      int    `json:"spell2Id"`
			ChampionID    int    `json:"championId"`
			ProfileIconID int    `json:"profileIconId"`
			SummonerName  string `json:"summonerName"`
			Bot           bool   `json:"bot"`
		} `json:"participants"`
		Observers struct {
			EncryptionKey string `json:"encryptionKey"`
		} `json:"observers"`
		PlatformID      string `json:"platformId"`
		BannedChampions []struct {
			ChampionID int `json:"championId"`
			TeamID     int `json:"teamId"`
			PickTurn   int `json:"pickTurn"`
		} `json:"bannedChampions"`
		GameStartTime int `json:"gameStartTime"`
		GameLength    int `json:"gameLength"`
	} `json:"gameList"`
	ClientRefreshInterval int `json:"clientRefreshInterval"`
}

type LOLClient

type LOLClient struct {
	Champion  *ChampionEndpoint
	Status    *StatusEndpoint
	Spectator *SpectatorEndpoint
	// contains filtered or unexported fields
}

func NewLOLClient

func NewLOLClient(client *internal.InternalClient) *LOLClient

Creates a new LOLClient using an InternalClient provided

type PlatformDataDTO added in v0.3.0

type PlatformDataDTO struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Locales      []string `json:"locales"`
	Maintenances []struct {
		ArchiveAt time.Time `json:"archive_at"`
		Titles    []struct {
			Content string `json:"content"`
			Locale  string `json:"locale"`
		} `json:"titles"`
		UpdatedAt        time.Time `json:"updated_at"`
		IncidentSeverity string    `json:"incident_severity"`
		Platforms        []string  `json:"platforms"`
		Updates          []struct {
			UpdatedAt    string `json:"updated_at"`
			Translations []struct {
				Content string `json:"content"`
				Locale  string `json:"locale"`
			} `json:"translations"`
			Author           string    `json:"author"`
			Publish          bool      `json:"publish"`
			CreatedAt        time.Time `json:"created_at"`
			ID               int       `json:"id"`
			PublishLocations []string  `json:"publish_locations"`
		} `json:"updates"`
		CreatedAt         time.Time `json:"created_at"`
		ID                int       `json:"id"`
		MaintenanceStatus string    `json:"maintenance_status"`
	} `json:"maintenances"`
	Incidents []struct {
		ArchiveAt time.Time `json:"archive_at"`
		Titles    []struct {
			Content string `json:"content"`
			Locale  string `json:"locale"`
		} `json:"titles"`
		UpdatedAt        time.Time `json:"updated_at"`
		IncidentSeverity string    `json:"incident_severity"`
		Platforms        []string  `json:"platforms"`
		Updates          []struct {
			UpdatedAt    time.Time `json:"updated_at"`
			Translations []struct {
				Content string `json:"content"`
				Locale  string `json:"locale"`
			} `json:"translations"`
			Author           string    `json:"author"`
			Publish          bool      `json:"publish"`
			CreatedAt        time.Time `json:"created_at"`
			ID               int       `json:"id"`
			PublishLocations []string  `json:"publish_locations"`
		} `json:"updates"`
		CreatedAt         time.Time `json:"created_at"`
		ID                int       `json:"id"`
		MaintenanceStatus string    `json:"maintenance_status"`
	} `json:"incidents"`
}

type SpectatorEndpoint added in v0.3.0

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

func (*SpectatorEndpoint) ActiveGameBySummonerID added in v0.3.0

func (c *SpectatorEndpoint) ActiveGameBySummonerID(region api.Region, summonerId string) (*ActiveGameBySummonerID, error)

Get an active game by summoner ID

func (*SpectatorEndpoint) FeaturedGames added in v0.3.0

func (c *SpectatorEndpoint) FeaturedGames(region api.Region) (*FeaturedGamesDTO, error)

Get featured games in a region

type StatusEndpoint added in v0.2.2

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

func (*StatusEndpoint) GetStatus added in v0.3.0

func (c *StatusEndpoint) GetStatus(region api.Region) (*PlatformDataDTO, error)

Get Status

Jump to

Keyboard shortcuts

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