lor

package
v0.0.0-...-10a1391 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeckURL = "/lor/deck/v1/decks/me"

	InventoryURL = "/lor/inventory/v1/cards/me"

	MatchByIDURL = "/lor/match/v1/matches/%s"
	MatchListURL = "/lor/match/v1/matches/by-puuid/%s/ids"

	RankedURL = "/lor/ranked/v1/leaderboards"

	StatusURL = "/lor/status/v1/platform-data"
)

Legends of Runeterra endpoint URLs.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardDTO

type CardDTO struct {
	Code  string `json:"code"`
	Count string `json:"count"`
}

type DeckDTO

type DeckDTO struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Code string `json:"code"`
}

type DeckEndpoint

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

func (*DeckEndpoint) Create

func (e *DeckEndpoint) Create(region Region, accessToken string, code string, name string) (string, error)

Create a new deck for the calling user.

func (*DeckEndpoint) List

func (e *DeckEndpoint) List(region Region, accessToken string) (*[]DeckDTO, error)

Get a list of the calling user's decks.

type GameMode

type GameMode string
const (
	ConstructedMode GameMode = "Constructed"
	ExpeditionsMode GameMode = "Expeditions"
	TutorialMode    GameMode = "Tutorial"
)

type GameType

type GameType string
const (
	RankedGame           GameType = "Ranked"
	NormalGame           GameType = "Normal"
	AIGame               GameType = "AI"
	TutorialGame         GameType = "Tutorial"
	VanillaTrialGame     GameType = "VanillaTrial"
	SingletonGame        GameType = "Singleton"
	StandardGauntletGame GameType = "StandardGauntlet"
)

type InfoDTO

type InfoDTO struct {
	GameMode         GameMode     `json:"game_mode"`
	GameType         GameType     `json:"game_type"`
	GameStartTimeUtc string       `json:"game_start_time_utc"`
	GameVersion      string       `json:"game_version"`
	Players          []PlayersDTO `json:"players"`
	// Total turns taken by both players.
	TotalTurnCount int `json:"total_turn_count"`
}

type InventoryEndpoint

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

func (*InventoryEndpoint) Cards

func (e *InventoryEndpoint) Cards(region Region, accessToken string) (*[]CardDTO, error)

Return a list of cards owned by the calling user.

type LORClient

type LORClient struct {
	Deck      *DeckEndpoint
	Inventory *InventoryEndpoint
	Match     *MatchEndpoint
	Ranked    *RankedEndpoint
	Status    *StatusEndpoint
	// contains filtered or unexported fields
}

func NewLORClient

func NewLORClient(client *internal.InternalClient) *LORClient

Returns a new LORClient using the InternalClient provided.

type LeaderboardDTO

type LeaderboardDTO struct {
	// A list of players in Master tier.
	Players []LeaderboardPlayersDTO `json:"players"`
}

type LeaderboardPlayersDTO

type LeaderboardPlayersDTO struct {
	Name string `json:"name"`
	Rank int    `json:"rank"`
	// League points.
	Lp int `json:"lp"`
}

type MatchDTO

type MatchDTO struct {
	// Match metadata.
	Metadata MetadataDTO `json:"metadata"`
	// Match info.
	Info InfoDTO `json:"info"`
}

type MatchEndpoint

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

func (*MatchEndpoint) ByID

func (e *MatchEndpoint) ByID(region Region, matchID string) (*MatchDTO, error)

Get match by ID.

func (*MatchEndpoint) List

func (e *MatchEndpoint) List(region Region, puuid string) (*[]string, error)

Get a list of match ids by PUUID.

type MetadataDTO

type MetadataDTO struct {
	// Match data version.
	DataVersion string `json:"data_version"`
	// Match ID.
	MatchID string `json:"match_id"`
	// A list of participant PUUIDs.
	Participants []string `json:"participants"`
}

type PlayersDTO

type PlayersDTO struct {
	PUUID  string `json:"puuid"`
	DeckID string `json:"deck_id"`
	// Code for the deck played. Refer to LOR documentation for details on deck codes.
	DeckCode    string   `json:"deck_code"`
	Factions    []string `json:"factions"`
	GameOutcome string   `json:"game_outcome"`
	// The order in which the players took turns.
	OrderOfPlay int `json:"order_of_play"`
}

type RankedEndpoint

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

func (*RankedEndpoint) Leaderboards

func (e *RankedEndpoint) Leaderboards(region Region) (*LeaderboardDTO, error)

Get the players in Master tier.

The leaderboard is updated once an hour.

type Region

type Region string
const (
	Americas Region = "americas"
	Europe   Region = "europe"
	APAC     Region = "apac"
	SEA      Region = "sea"
)

Legends of Runeterra regions.

type StatusEndpoint

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

func (*StatusEndpoint) PlatformStatus

func (e *StatusEndpoint) PlatformStatus(region Region) (*api.PlatformDataDTO, error)

Get Legends of Runeterra status for the given platform.

Jump to

Keyboard shortcuts

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