val

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegionAsiaPacific  api.Region = "ap"
	RegionBrazil       api.Region = "br"
	RegionESPORTS      api.Region = "esports"
	RegionEurope       api.Region = "eu"
	RegionKorea        api.Region = "kr"
	RegionLatinAmerica api.Region = "latam"
	RegionNorthAmerica api.Region = "na"
)

All existing regions

Variables

Functions

This section is empty.

Types

type Ability

type Ability struct {
	GrenadeEffects  string `json:"grenadeEffects"`
	Ability1Effects string `json:"ability1Effects"`
	Ability2Effects string `json:"ability2Effects"`
	UltimateEffects string `json:"ultimateEffects"`
}

Ability holds ability effects of a player in a round

type AbilityCasts

type AbilityCasts struct {
	GrenadeCasts  int `json:"grenadeCasts"`
	Ability1Casts int `json:"ability1Casts"`
	Ability2Casts int `json:"ability2Casts"`
	UltimateCasts int `json:"ultimateCasts"`
}

AbilityCasts number of casts of abilities for a player in a match

type Act

type Act struct {
	Name     string `json:"name"`
	ID       string `json:"id"`
	IsActive bool   `json:"isActive"`
}

Act LocalizedNames is excluded because it is not sent when locale is set in request

type Client

type Client struct {
	Content *ContentClient
	Status  *StatusClient
	Ranked  *RankedClient
	Match   *MatchClient
}

Client pools all methods for endpoints of the Valorant API.

func NewClient

func NewClient(base *internal.Client) *Client

NewClient returns a new instance of a League of Legends client.

type Coach

type Coach struct {
	PUUID  string `json:"puuid"`
	TeamID string `json:"teamId"`
}

Coach holds coach id and team id

type Content

type Content struct {
	Locale  string `json:"locale"`
	Content string `json:"content"`
}

Content represents titles and translations fields of Update and Status

type ContentClient

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

ContentClient provides methods for the content endpoints of the VALORANT API.

func (*ContentClient) GetContent

func (cc *ContentClient) GetContent(locale Locale) (*ContentInfo, error)

GetContent returns information about the in-game contents e.g. skins, maps, etc.

type ContentInfo

type ContentInfo struct {
	Version      string         `json:"version"`
	Characters   []*ContentItem `json:"characters"`
	Maps         []*ContentItem `json:"maps"`
	Chromas      []*ContentItem `json:"chromas"`
	Skins        []*ContentItem `json:"skins"`
	SkinLevels   []*ContentItem `json:"skinLevels"`
	Equips       []*ContentItem `json:"equips"`
	GameModes    []*ContentItem `json:"gameModes"`
	Sprays       []*ContentItem `json:"sprays"`
	SprayLevels  []*ContentItem `json:"sprayLevels"`
	Charms       []*ContentItem `json:"charms"`
	CharmLevels  []*ContentItem `json:"charmLevels"`
	PlayerCards  []*ContentItem `json:"playerCards"`
	PlayerTitles []*ContentItem `json:"playerTitles"`
	Acts         []*Act         `json:"acts"`
}

ContentInfo represents all contents currently available in the game

type ContentItem

type ContentItem struct {
	Name      string `json:"name"`
	ID        string `json:"id"`
	AssetName string `json:"assetName"`
	AssetPath string `json:"assetPath"`
}

ContentItem represents an individual content in ContentInfo

type Damage

type Damage struct {
	Receiver            string `json:"receiver"`
	Damage              bool   `json:"damage"`
	IsSecondaryFireMode bool   `json:"isSecondaryFireMode"`
	LegShots            bool   `json:"legshots"`
	BodyShots           bool   `json:"bodyshots"`
	Headshots           bool   `json:"headshots"`
}

Damage contains information of a damage

type Economy

type Economy struct {
	LoadOutValue int    `json:"loadoutValue"`
	Weapon       string `json:"weapon"`
	Armor        string `json:"armor"`
	Remaining    int    `json:"remaining"`
	Spent        int    `json:"spent"`
}

Economy holds economy information including spent credits

type FinishingDamage

type FinishingDamage struct {
	DamageType          string `json:"damageType"`
	DamageItem          string `json:"damageItem"`
	IsSecondaryFireMode bool   `json:"isSecondaryFireMode"`
}

FinishingDamage contains information of the finishing damage

type Kill

type Kill struct {
	TimeSinceGameStartMillis  int               `json:"timeSinceGameStartMillis"`
	TimeSinceRoundStartMillis int               `json:"timeSinceRoundStartMillis"`
	Killer                    string            `json:"killer"`
	Victim                    string            `json:"victim"`
	VictimLocation            Location          `json:"victimLocation"`
	Assistants                []string          `json:"assistants"`
	PlayerLocations           []PlayerLocations `json:"playerLocations"`
	FinishingDamage           FinishingDamage   `json:"finishingDamage"`
}

Kill contains information of kills e.g. killer, victim, finishing damage

type Leaderboard

type Leaderboard struct {
	Shard        string    `json:"shard"`
	ActID        string    `json:"actId"`
	TotalPlayers int64     `json:"totalPlayers"`
	Players      []*Player `json:"players"`
}

Leaderboard represents a leaderboard

type Locale

type Locale string

Locale string value for language

const (
	LocaleUnitedArabEmirates Locale = "ar-AE"
	LocaleGermany            Locale = "de-DE"
	LocaleUnitedKingdom      Locale = "en-GB"
	LocaleUnitedStates       Locale = "en-US"
	LocaleSpain              Locale = "es-ES"
	LocaleMexico             Locale = "es-MX"
	LocaleFrance             Locale = "fr-FR"
	LocaleIndonesia          Locale = "id-ID"
	LocaleItaly              Locale = "it-IT"
	LocaleJapan              Locale = "ja-JP"
	LocaleSouthKorea         Locale = "ko-KR"
	LocalePoland             Locale = "pl-PL"
	LocaleBrazil             Locale = "pt-BR"
	LocaleRussia             Locale = "ru-RU"
	LocaleThailand           Locale = "th-TH"
	LocaleTurkish            Locale = "tr-TR"
	LocaleVietnam            Locale = "vi-VN"
	LocaleChina              Locale = "zh-CN"
	LocaleTaiwan             Locale = "zh-TW"
)

All possible values of Locale

type Location

type Location struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Location represents the location for PlayerLocations

type Match

type Match struct {
	MatchInfo    MatchInfo     `json:"matchInfo"`
	Players      []MatchPlayer `json:"players"`
	Coaches      []Coach       `json:"coaches"`
	Teams        []Team        `json:"teams"`
	RoundResults []RoundResult `json:"roundResults"`
}

Match represents a match with related data including players, match info and teams

type MatchClient

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

MatchClient provides methods for the match endpoints of the VALORANT API.

func (*MatchClient) GetMatchByID

func (cc *MatchClient) GetMatchByID(matchID string) (*Match, error)

GetMatchByID returns information about a match using match id

func (*MatchClient) GetMatchListByPUUID

func (cc *MatchClient) GetMatchListByPUUID(puuid string) (*MatchList, error)

GetMatchListByPUUID returns match history as a list using player UUID

func (*MatchClient) GetRecentMatchesByQueue

func (cc *MatchClient) GetRecentMatchesByQueue(queue string) (*RecentMatches, error)

GetRecentMatchesByQueue returns last match IDs for live regions and e-sports routing

type MatchInfo

type MatchInfo struct {
	MatchID            string `json:"matchId"`
	MapID              string `json:"mapId"`
	GameLengthMillis   int    `json:"gameLengthMillis"`
	GameStartMillis    int64  `json:"gameStartMillis"`
	ProvisioningFlowID string `json:"provisioningFlowId"`
	IsCompleted        bool   `json:"isCompleted"`
	CustomGameName     string `json:"customGameName"`
	QueueID            string `json:"queueId"`
	GameMode           string `json:"gameMode"`
	IsRanked           bool   `json:"isRanked"`
	SeasonID           string `json:"seasonId"`
}

MatchInfo contains the data for a specific match

type MatchList

type MatchList struct {
	PUUID   string           `json:"puuid"`
	History []MatchListEntry `json:"history"`
}

MatchList represent match history of a player

type MatchListEntry

type MatchListEntry struct {
	MatchID             string `json:"matchId"`
	GameStartTimeMillis int64  `json:"gameStartTimeMillis"`
	QueueID             string `json:"queueId"`
}

MatchListEntry holds information regarding each match

type MatchPlayer

type MatchPlayer struct {
	PuuID           string      `json:"puuid"`
	GameName        string      `json:"gameName"`
	TagLine         string      `json:"tagLine"`
	TeamID          string      `json:"teamId"`
	PartyID         string      `json:"partyId"`
	CharacterID     string      `json:"characterId"`
	Stats           PlayerStats `json:"stats"`
	CompetitiveTier int         `json:"competitiveTier"`
	PlayerCard      string      `json:"playerCard"`
	PlayerTitle     string      `json:"playerTitle"`
}

MatchPlayer holds data of a player participating a match

type PlatformData

type PlatformData struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Locales      []string  `json:"locales"`
	Maintenances []*Status `json:"maintenances"`
	Incidents    []*Status `json:"incidents"`
}

PlatformData represents VALORANT status for given platform

type Player

type Player struct {
	PuuID           string `json:"puuid"`
	GameName        string `json:"gameName"`
	TagLine         string `json:"tagLine"`
	LeaderboardRank int64  `json:"leaderboardRank"`
	RankedRating    int64  `json:"rankedRating"`
	NumberOfWins    int64  `json:"numberOfWins"`
}

Player holds data of individual players in a leaderboard

type PlayerLocations

type PlayerLocations struct {
	PUUID       string   `json:"puuid"`
	ViewRadians float32  `json:"viewRadians"`
	Location    Location `json:"location"`
}

PlayerLocations represents player location for planting and defusing

type PlayerRoundStats

type PlayerRoundStats struct {
	PUUID   string   `json:"puuid"`
	Kills   []Kill   `json:"kills"`
	Damages []Damage `json:"damage"`
	Score   int      `json:"score"`
	Economy Economy  `json:"economy"`
	Ability Ability  `json:"ability"`
}

PlayerRoundStats holds player stats by round

type PlayerStats

type PlayerStats struct {
	Score          int          `json:"score"`
	RoundsPlayed   int          `json:"roundsPlayed"`
	Kills          int          `json:"kills"`
	Deaths         int          `json:"deaths"`
	Assists        int          `json:"assists"`
	PlaytimeMillis int          `json:"playtimeMillis"`
	AbilityCasts   AbilityCasts `json:"abilityCasts"`
}

PlayerStats stats of a player in a match

type RankedClient

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

RankedClient provides methods for the ranked endpoints of the VALORANT API.

func (*RankedClient) GetLeaderboardByActID

func (cc *RankedClient) GetLeaderboardByActID(actID string, startIndex, size int32) (*Leaderboard, error)

GetLeaderboardByActID returns leaderboard for the competitive queue by act ID

type RecentMatches

type RecentMatches struct {
	CurrentTime int64    `json:"currentTime"`
	MatchIDs    []string `json:"matchIds"`
}

RecentMatches represents last matches for live regions and e-sports routing

type RoundResult

type RoundResult struct {
	RoundNum              int                `json:"roundNum"`
	RoundResult           string             `json:"roundResult"`
	RoundCeremony         string             `json:"roundCeremony"`
	WinningTeam           string             `json:"winningTeam"`
	BombPlanter           string             `json:"bombPlanter"`
	BombDefuser           string             `json:"bombDefuser"`
	PlantRoundTime        int                `json:"plantRoundTime"`
	PlantPlayerLocations  []PlayerLocations  `json:"plantPlayerLocations"`
	PlantLocation         Location           `json:"plantLocation"`
	PlantSite             string             `json:"plantSite"`
	DefuseRoundTime       int                `json:"defuseRoundTime"`
	DefusePlayerLocations []PlayerLocations  `json:"defusePlayerLocations"`
	DefuseLocation        Location           `json:"defuseLocation"`
	PlayerStats           []PlayerRoundStats `json:"playerStats"`
	RoundResultCode       string             `json:"roundResultCode"`
}

RoundResult holds result data of a round

type Status

type Status struct {
	ID                int32      `json:"id"`
	MaintenanceStatus string     `json:"maintenance_status"`
	IncidentSeverity  string     `json:"incident_severity"`
	Titles            []*Content `json:"titles"`
	Updates           []*Update  `json:"updates"`
	CreatedAt         string     `json:"created_at"`
	ArchiveAt         string     `json:"archive_at"`
	UpdatedAt         string     `json:"updated_at"`
	Platforms         []string   `json:"platforms"`
}

Status represents current maintenance and incidents

type StatusClient

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

StatusClient provides methods for the status endpoints of the VALORANT API.

func (*StatusClient) GetPlatformData

func (cc *StatusClient) GetPlatformData() (*PlatformData, error)

GetPlatformData returns information about platform including maintenances and incidents

type Team

type Team struct {
	TeamID       string `json:"teamId"`
	Won          bool   `json:"won"`
	RoundsPlayed int    `json:"roundsPlayed"`
	RoundsWon    int    `json:"roundsWon"`
	NumPoints    int    `json:"numPoints"`
}

Team contains statistics of a team in a match

type Update

type Update struct {
	ID               int32      `json:"id"`
	Author           string     `json:"author"`
	Publish          bool       `json:"publish"`
	PublishLocations []string   `json:"publish_locations"`
	Translations     []*Content `json:"translations"`
	CreatedAt        string     `json:"created_at"`
	UpdatedAt        string     `json:"updated_at"`
}

Update holds data of current software updates for the platforms

Jump to

Keyboard shortcuts

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