val

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentURL = "/val/content/v1/contents"

	MatchByIDURL   = "/val/match/v1/matches/%s"
	MatchListURL   = "/val/match/v1/matchlists/by-puuid/%s"
	MatchRecentURL = "/val/match/v1/recent-matches/by-queue/%s"

	RankedURL = "/val/ranked/v1/leaderboards/by-act/%s"

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

Valorant endpoints

Variables

This section is empty.

Functions

This section is empty.

Types

type AbilityCastDTO added in v0.8.1

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

type AbilityDTO added in v0.8.1

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

type ActsDTO

type ActsDTO struct {
	ID             string            `json:"id"`
	ParentID       string            `json:"parentId"`
	Type           string            `json:"type"`
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	IsActive       bool              `json:"isActive"`
}

type AdditionalPropDTO

type AdditionalPropDTO struct {
	RankedRatingThreshold int `json:"rankedRatingThreshold"`
	StartingPage          int `json:"startingPage"`
	StartingIndex         int `json:"startingIndex"`
}

type CeremoniesDTO

type CeremoniesDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type CharactersDTO

type CharactersDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type CharmLevelsDTO

type CharmLevelsDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type CharmsDTO

type CharmsDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type ChromasDTO

type ChromasDTO struct {
	Name              string            `json:"name"`
	LocalizedNamesDTO LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID                string            `json:"id"`
	AssetName         string            `json:"assetName"`
}

type CoachDTO added in v0.8.1

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

type ContentDTO

type ContentDTO struct {
	Version      string            `json:"version"`
	Characters   []CharactersDTO   `json:"characters"`
	Maps         []MapsDTO         `json:"maps"`
	Chromas      []ChromasDTO      `json:"chromas"`
	Skins        []SkinsDTO        `json:"skins"`
	SkinLevels   []SkinLevelsDTO   `json:"skinLevels"`
	Equips       []EquipsDTO       `json:"equips"`
	GameModes    []GameModesDTO    `json:"gameModes"`
	Sprays       []SpraysDTO       `json:"sprays"`
	SprayLevels  []SprayLevelsDTO  `json:"sprayLevels"`
	Charms       []CharmsDTO       `json:"charms"`
	CharmLevels  []CharmLevelsDTO  `json:"charmLevels"`
	PlayerCards  []PlayerCardsDTO  `json:"playerCards"`
	PlayerTitles []PlayerTitlesDTO `json:"playerTitles"`
	Acts         []ActsDTO         `json:"acts"`
	Ceremonies   []CeremoniesDTO   `json:"ceremonies"`
}

type ContentEndpoint

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

func (*ContentEndpoint) AllLocales

func (s *ContentEndpoint) AllLocales(region Region) (*ContentDTO, error)

Get content with all available locales.

func (*ContentEndpoint) ByLocale

func (s *ContentEndpoint) ByLocale(region Region, locale Locale) (*LocalizedContentDTO, error)

Get content filtered by locale.

Locale defaults to en-US.

type DamageDTO added in v0.8.1

type DamageDTO struct {
	Receiver  string `json:"receiver"`
	Damage    int    `json:"damage"`
	Legshots  int    `json:"legshots"`
	Bodyshots int    `json:"bodyshots"`
	Headshots int    `json:"headshots"`
}

type EconomyDTO added in v0.8.1

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

type EquipsDTO

type EquipsDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type FinishingDamageDTO added in v0.8.1

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

type GameModesDTO

type GameModesDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
	AssetPath      string            `json:"assetPath"`
}

type HistoryDTO added in v0.8.1

type HistoryDTO struct {
	MatchID             string `json:"matchId"`
	GameStartTimeMillis int    `json:"gameStartTimeMillis"`
	TeamID              string `json:"teamId"`
}

type KillDTO added in v0.8.1

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

type LeaderboardDTO

type LeaderboardDTO struct {
	// The act id for the given leaderboard. Act ids can be found using the val-content API.
	ActID   string       `json:"actId"`
	Players []PlayersDTO `json:"players"`
	// The total number of players in the leaderboard.
	TotalPlayers          int            `json:"totalPlayers"`
	ImmortalStartingPage  int            `json:"immortalStartingPage"`
	ImmortalStartingIndex int            `json:"immortalStartingIndex"`
	TopTierRRThreshold    int            `json:"topTierRRThreshold"`
	TierDetails           TierDetailsDTO `json:"tierDetails"`
	StartIndex            int            `json:"startIndex"`
	Query                 string         `json:"query"`
	// The shard for the given leaderboard.
	Shard Region `json:"shard"`
}

type Locale

type Locale string
const (
	ArabicAE     Locale = "ar-AE"
	GermanDE     Locale = "de-DE"
	EnglishUS    Locale = "en-US"
	SpanishES    Locale = "es-ES"
	SpanishMX    Locale = "es-MX"
	FrenchFR     Locale = "fr-FR"
	IndonesianID Locale = "id-ID"
	ItalianIT    Locale = "it-IT"
	JapaneseJP   Locale = "ja-JP"
	KoreanKR     Locale = "ko-KR"
	PortuguesePL Locale = "pl-PL"
	PortugueseBR Locale = "pt-BR"
	RussianRU    Locale = "RuRU"
	ThaiTH       Locale = "th-TH"
	TurkishTR    Locale = "tr-TR"
	VietnameseVN Locale = "vi-VN"
	ChineseCN    Locale = "zh-CN"
	ChineseTW    Locale = "zh-TW"
)

type LocalizedContentDTO

type LocalizedContentDTO struct {
	Version    string `json:"version"`
	Characters []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"characters"`
	Maps []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
		AssetPath string `json:"assetPath,omitempty"`
	} `json:"maps"`
	Chromas []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"chromas"`
	Skins []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"skins"`
	SkinLevels []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"skinLevels"`
	Equips []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"equips"`
	GameModes []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
		AssetPath string `json:"assetPath"`
	} `json:"gameModes"`
	Sprays []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"sprays"`
	SprayLevels []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"sprayLevels"`
	Charms []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"charms"`
	CharmLevels []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"charmLevels"`
	PlayerCards []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"playerCards"`
	PlayerTitles []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"playerTitles"`
	Acts []struct {
		ID       string `json:"id"`
		ParentID string `json:"parentId"`
		Type     string `json:"type"`
		Name     string `json:"name"`
		IsActive bool   `json:"isActive"`
	} `json:"acts"`
	Ceremonies []struct {
		Name      string `json:"name"`
		ID        string `json:"id"`
		AssetName string `json:"assetName"`
	} `json:"ceremonies"`
}

type LocalizedNamesDTO

type LocalizedNamesDTO struct {
	ArAE string `json:"ar-AE"`
	DeDE string `json:"de-DE"`
	EnUS string `json:"en-US"`
	EsES string `json:"es-ES"`
	EsMX string `json:"es-MX"`
	FrFR string `json:"fr-FR"`
	IDID string `json:"id-ID"`
	ItIT string `json:"it-IT"`
	JaJP string `json:"ja-JP"`
	KoKR string `json:"ko-KR"`
	PlPL string `json:"pl-PL"`
	PtBR string `json:"pt-BR"`
	RuRU string `json:"ru-RU"`
	ThTH string `json:"th-TH"`
	TrTR string `json:"tr-TR"`
	ViVN string `json:"vi-VN"`
	ZhCN string `json:"zh-CN"`
	ZhTW string `json:"zh-TW"`
}

type LocationDTO added in v0.8.1

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

type MapsDTO

type MapsDTO struct {
	Name              string            `json:"name"`
	LocalizedNamesDTO LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID                string            `json:"id"`
	AssetName         string            `json:"assetName"`
	AssetPath         string            `json:"assetPath,omitempty"`
}

type MatchDTO added in v0.8.1

type MatchDTO struct {
	MatchInfo    MatchInfoDTO     `json:"matchInfo"`
	Players      []MatchPlayerDTO `json:"players"`
	Coaches      []CoachDTO       `json:"coaches"`
	Teams        []TeamDTO        `json:"teams"`
	RoundResults []RoundResultDTO `json:"roundResults"`
}

type MatchEndpoint added in v0.8.1

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

func (*MatchEndpoint) ByID added in v0.8.1

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

Get match by ID.

func (*MatchEndpoint) List added in v0.8.1

func (m *MatchEndpoint) List(region Region, PUUID string) (*MatchListDTO, error)

Get matchlist for games played by PUUID.

func (*MatchEndpoint) Recent added in v0.8.1

func (m *MatchEndpoint) Recent(region Region, queue Queue) (*RecentMatchesDTO, error)

Get recent matches.

Returns a list of match ids that have completed in the last 10 minutes for live regions and 12 hours for the esports routing value.

NA/LATAM/BR share a match history deployment. As such, recent matches will return a combined list of matches from those three regions.

Requests are load balanced so you may see some inconsistencies as matches are added/removed from the list.

type MatchInfoDTO added in v0.8.1

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

type MatchListDTO added in v0.8.1

type MatchListDTO struct {
	PUUID   string       `json:"puuid"`
	History []HistoryDTO `json:"history"`
}

type MatchPlayerDTO added in v0.8.1

type MatchPlayerDTO 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           StatsDTO `json:"stats"`
	CompetitiveTier int      `json:"competitiveTier"`
	PlayerCard      string   `json:"playerCard"`
	PlayerTitle     string   `json:"playerTitle"`
}

type PlayerCardsDTO

type PlayerCardsDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type PlayerLocationDTO added in v0.8.1

type PlayerLocationDTO struct {
	PUUID       string      `json:"puuid"`
	ViewRadians int         `json:"viewRadians"`
	Location    LocationDTO `json:"location"`
}

type PlayerStatsDTO added in v0.8.1

type PlayerStatsDTO struct {
	PUUID   string      `json:"puuid"`
	Kills   []KillDTO   `json:"kills"`
	Damage  []DamageDTO `json:"damage"`
	Score   int         `json:"score"`
	Economy EconomyDTO  `json:"economy"`
	Ability AbilityDTO  `json:"ability"`
}

type PlayerTitlesDTO

type PlayerTitlesDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type PlayersDTO

type PlayersDTO struct {
	// This field may be omitted if the player has been anonymized.
	PUUID string `json:"puuid"`
	// This field may be omitted if the player has been anonymized.
	GameName string `json:"gameName"`
	// This field may be omitted if the player has been anonymized.
	TagLine         string `json:"tagLine"`
	LeaderboardRank int    `json:"leaderboardRank"`
	RankedRating    int    `json:"rankedRating"`
	NumberOfWins    int    `json:"numberOfWins"`
	CompetitiveTier int    `json:"competitiveTier"`
}

type Queue added in v0.8.1

type Queue string
const (
	Competitive Queue = "competitive"
	Unrated     Queue = "unrated"
	SpikeRush   Queue = "spikerush"
	Tournament  Queue = "tournamentmode"
)

type RankedEndpoint

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

func (*RankedEndpoint) LeaderboardsByActID

func (r *RankedEndpoint) LeaderboardsByActID(region Region, actID string, size uint8, start int) (*LeaderboardDTO, error)

Get leaderboard for the competitive queue.

Size defaults to 200. Valid values: 1 to 200.

Start defaults to 0.

type RecentMatchesDTO added in v0.8.1

type RecentMatchesDTO struct {
	CurrentTime int      `json:"currentTime"`
	MatchIDs    []string `json:"matchIds"`
}

type Region

type Region string
const (
	AP      Region = "ap"
	NA      Region = "na"
	LATAM   Region = "latam"
	ESPORTS Region = "esports"
	BR      Region = "br"
	EU      Region = "eu"
	KR      Region = "kr"
)

Valorant regions

type RoundResultDTO added in v0.8.1

type RoundResultDTO 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  []PlayerLocationDTO `json:"plantPlayerLocations"`
	PlantLocation         LocationDTO         `json:"plantLocation"`
	PlantSite             string              `json:"plantSite"`
	DefuseRoundTime       int                 `json:"defuseRoundTime"`
	DefusePlayerLocations []PlayerLocationDTO `json:"defusePlayerLocations"`
	DefuseLocation        LocationDTO         `json:"defuseLocation"`
	PlayerStats           []PlayerStatsDTO    `json:"playerStats"`
	RoundResultCode       string              `json:"roundResultCode"`
}

type SkinLevelsDTO

type SkinLevelsDTO struct {
	Name              string            `json:"name"`
	LocalizedNamesDTO LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID                string            `json:"id"`
	AssetName         string            `json:"assetName"`
}

type SkinsDTO

type SkinsDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type SprayLevelsDTO

type SprayLevelsDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type SpraysDTO

type SpraysDTO struct {
	Name           string            `json:"name"`
	LocalizedNames LocalizedNamesDTO `json:"localizedNames,omitempty"`
	ID             string            `json:"id"`
	AssetName      string            `json:"assetName"`
}

type StatsDTO added in v0.8.1

type StatsDTO 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   AbilityCastDTO `json:"abilityCasts"`
}

type StatusEndpoint

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

func (*StatusEndpoint) PlatformStatus

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

Get VALORANT status for the given platform.

type TeamDTO added in v0.8.1

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

type TierDetailsDTO

type TierDetailsDTO struct {
	Num21 AdditionalPropDTO `json:"21"`
	Num22 AdditionalPropDTO `json:"22"`
	Num23 AdditionalPropDTO `json:"23"`
	Num24 AdditionalPropDTO `json:"24"`
}

type VALClient

type VALClient struct {
	Content *ContentEndpoint
	Match   *MatchEndpoint
	Ranked  *RankedEndpoint
	Status  *StatusEndpoint
	// contains filtered or unexported fields
}

func NewVALClient

func NewVALClient(client *internal.InternalClient) *VALClient

Returns a new client using the API key provided.

Jump to

Keyboard shortcuts

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