govalo

package module
v0.3.6-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 3 Imported by: 0

README

GoValo

GoValo is a Valorant Client API library built for go. Designed for simplicity and ease of use you can get up in running in a few lines of code.

⚡️ Get Started

package main

import (
	"fmt"

	"github.com/itsbradn/govalo"
)

func main() {
	api, err := govalo.Setup("na", USERNAME, PASSWORD)

	if err != nil {
		fmt.Print(err)
		return
	}

	userinfo, err := valapi.GetUserInfo()

	if err != nil {
		fmt.Print(err)
		return
	}

	fmt.Printf("%s#%s\n", userinfo.Account.GameName, userinfo.Account.TagLine)
}

🎯 Endpoints

Match History

func main() {
	api, err := govalo.Setup("na", USERNAME, PASSWORD)
	if err != nil {
		fmt.Print(err)
		return
	}

	userinfo, err := valapi.GetUserInfo()
	if err != nil {
		fmt.Print(err)
		return
	}

	history, err := valapi.GetMatchHistory(userinfo.PlayerUUID, &govalo.MatchHistoryOptions{
		StartIndex: 0
		EndIndex:   5
	})
	if err != nil {
		fmt.Print(err)
		return
	}

	fmt.Printf("Most recent match: %s\n", history.History[0].MatchID)
}

Competitive Updates

func main() {
	api, err := govalo.Setup("na", USERNAME, PASSWORD)
	if err != nil {
		fmt.Print(err)
		return
	}

	userinfo, err := valapi.GetUserInfo()
	if err != nil {
		fmt.Print(err)
		return
	}

	competitiveUpdates, err := valapi.GetCompetitiveUpdates(userinfo.PlayerUUID, &govalo.CompetitiveUpdatesOptions{
		StartIndex: 0
		EndIndex:   5
	})
	if err != nil {
		fmt.Print(err)
		return
	}

	fmt.Printf("Most recent competitive update: %s\n", competitiveUpdates.Matches[0])
}

Documentation

Index

Constants

View Source
const (
	VALORANT_REGION_NA    string = "na"
	VALORANT_REGION_LATAM string = "latam"
	VALORANT_REGION_BR    string = "br"
	VALORANT_REGION_EU    string = "eu"
	VALORANT_REGION_AP    string = "ap"
	VALORANT_REGION_KR    string = "kr"
)
View Source
const (
	VALORANT_SHARD_NA  string = "na"
	VALORANT_SHARD_PBE string = "pbe"
	VALORANT_SHARD_EU  string = "eu"
	VALORANT_SHARD_AP  string = "ap"
	VALORANT_SHARD_KR  string = "kr"
)
View Source
const (
	OWNED_ITEM_TYPE_AGENTS        string = "01bb38e1-da47-4e6a-9b3d-945fe4655707"
	OWNED_ITEM_TYPE_CONTRACTS     string = "f85cb6f7-33e5-4dc8-b609-ec7212301948"
	OWNED_ITEM_TYPE_SPRAYS        string = "d5f120f8-ff8c-4aac-92ea-f2b5acbe9475"
	OWNED_ITEM_TYPE_GUN_BUDDIES   string = "dd3bf334-87f3-40bd-b043-682a57a8dc3a"
	OWNED_ITEM_TYPE_CARDS         string = "3f296c07-64c3-494c-923b-fe692a4fa1bd"
	OWNED_ITEM_TYPE_SKINS         string = "e7c63390-eda7-46e0-bb7a-a6abdacd2433"
	OWNED_ITEM_TYPE_SKIN_VARIANTS string = "3ad1b2b2-acdb-4524-852f-954a76ddae0a"
	OWNED_ITEM_TYPE_TITLES        string = "de7caa6b-adf7-4588-bbd1-143831e786c6"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompetitiveUpdatesOptions

type CompetitiveUpdatesOptions = api.CompetitiveUpdatesOptions

type GoValoAPI

type GoValoAPI struct {
	Region string `json:"region"`
	Shard  string `json:"shard"`
	PUUID  string
}

func Setup

func Setup(region, username, password string) (*GoValoAPI, error)

func (*GoValoAPI) GetAccountXP

func (vapi *GoValoAPI) GetAccountXP() (*api.AccountExperienceResponseBody, error)

func (*GoValoAPI) GetCompetitiveUpdates

func (vapi *GoValoAPI) GetCompetitiveUpdates(uuid string, options *CompetitiveUpdatesOptions) (*api.CompetitiveUpdatesResponseBody, error)

func (*GoValoAPI) GetLeaderboard

func (vapi *GoValoAPI) GetLeaderboard(seasonID string, options *LeaderboardOptions) (*api.LeaderboardResponseBody, error)

func (*GoValoAPI) GetMatchDetails

func (vapi *GoValoAPI) GetMatchDetails(uuid string) (*api.MatchDetailsResponseBody, error)

func (*GoValoAPI) GetMatchHistory

func (vapi *GoValoAPI) GetMatchHistory(uuid string, options *MatchHistoryOptions) (*api.MatchHistoryResponseBody, error)

func (*GoValoAPI) GetNameService

func (vapi *GoValoAPI) GetNameService(uuid string) (*api.NameServiceResponseBody, error)

func (*GoValoAPI) GetOwnedItems

func (vapi *GoValoAPI) GetOwnedItems(itemType string) (*api.OwnedItemsResponseBody, error)

func (*GoValoAPI) GetPlayerLoadout

func (vapi *GoValoAPI) GetPlayerLoadout() (*api.PlayerLoadoutResponseBody, error)

func (*GoValoAPI) GetPlayerMMR

func (vapi *GoValoAPI) GetPlayerMMR(puuid string) (*api.PlayerMMRResponseBody, error)

func (*GoValoAPI) GetSelfNameService

func (vapi *GoValoAPI) GetSelfNameService() (*api.NameServiceResponseBody, error)

func (*GoValoAPI) GetStorePrices

func (vapi *GoValoAPI) GetStorePrices() (*api.PricesResponseBody, error)

func (*GoValoAPI) GetStorefront

func (vapi *GoValoAPI) GetStorefront() (*api.StoreFrontResponseBody, error)

func (*GoValoAPI) GetUserInfo

func (vapi *GoValoAPI) GetUserInfo() (*api.UserInfoResponseBody, error)

func (*GoValoAPI) GetWallet

func (vapi *GoValoAPI) GetWallet() (*api.WalletResponseBody, error)

type LeaderboardOptions

type LeaderboardOptions = api.LeaderboardOptions

type MatchHistoryOptions

type MatchHistoryOptions = api.MatchHistoryOptions

Directories

Path Synopsis
internal
api
pkg

Jump to

Keyboard shortcuts

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