ovrstat

package
v0.0.0-...-cdfc464 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PlatformXBL is platform : XBOX
	PlatformXBL = "xbl"

	// PlatformPSN is the platform : Playstation Network
	PlatformPSN = "psn"

	// PlatformPC is the platform : PC
	PlatformPC = "pc"

	PlatformNS = "nintendo-switch"
)

Variables

View Source
var (
	// ErrPlayerNotFound is thrown when a player doesn't exist
	ErrPlayerNotFound = errors.New("Player not found")

	// ErrInvalidPlatform is thrown when the passed params are incorrect
	ErrInvalidPlatform = errors.New("Invalid platform")
)

Functions

This section is empty.

Types

type CareerStats

type CareerStats struct {
	Assists       map[string]interface{} `json:"assists"`
	Average       map[string]interface{} `json:"average"`
	Best          map[string]interface{} `json:"best"`
	Combat        map[string]interface{} `json:"combat"`
	Deaths        map[string]interface{} `json:"deaths"`
	HeroSpecific  map[string]interface{} `json:"heroSpecific"`
	Game          map[string]interface{} `json:"game"`
	MatchAwards   map[string]interface{} `json:"matchAwards"`
	Miscellaneous map[string]interface{} `json:"miscellaneous"`
}

CareerStats holds very detailed stats for each hero

type CompetitiveStatsCollection

type CompetitiveStatsCollection struct {
	Season *int `json:"season"`
	StatsCollection
}

type Keywords

type Keywords []string

func (Keywords) Len

func (s Keywords) Len() int

func (Keywords) Less

func (s Keywords) Less(i, j int) bool

func (Keywords) Swap

func (s Keywords) Swap(i, j int)

type Platform

type Platform struct {
	Platform    string `json:"platform"`
	ID          int    `json:"id"`
	Name        string `json:"name"`
	URLName     string `json:"urlName"`
	PlayerLevel int    `json:"playerLevel"`
	Portrait    string `json:"portrait"`
	IsPublic    bool   `json:"isPublic"`
}

Platform represents a response from the search-by-name api request

type PlayerStats

type PlayerStats struct {
	Icon             string                     `json:"icon"`
	Name             string                     `json:"name"`
	Level            int                        `json:"level"`
	LevelIcon        string                     `json:"levelIcon"`
	Endorsement      int                        `json:"endorsement"`
	EndorsementIcon  string                     `json:"endorsementIcon"`
	Prestige         int                        `json:"prestige"`
	PrestigeIcon     string                     `json:"prestigeIcon"`
	Ratings          []Rating                   `json:"ratings"`
	GamesWon         int                        `json:"gamesWon"`
	QuickPlayStats   QuickPlayStatsCollection   `json:"quickPlayStats"`
	CompetitiveStats CompetitiveStatsCollection `json:"competitiveStats"`
	Private          bool                       `json:"private"`
}

PlayerStats holds all stats on a specified Overwatch player

func ConsoleStats

func ConsoleStats(platform, tag string) (*PlayerStats, error)

ConsoleStats retrieves player stats for Console

func PCStats

func PCStats(tag string) (*PlayerStats, error)

PCStats retrieves player stats for PC

func Stats

func Stats(platform, tag string) (*PlayerStats, error)

Stats retrieves player stats Universal method if you don't need to differentiate it

type QuickPlayStatsCollection

type QuickPlayStatsCollection struct {
	StatsCollection
}

type Rating

type Rating struct {
	Level    int    `json:"level"`
	Role     string `json:"role"`
	RoleIcon string `json:"roleIcon"`
	RankIcon string `json:"rankIcon"`
}

type StatsCollection

type StatsCollection struct {
	TopHeroes   map[string]*TopHeroStats `json:"topHeroes"`
	CareerStats map[string]*CareerStats  `json:"CareerStats"`
}

type TopHeroStats

type TopHeroStats struct {
	TimePlayed          string  `json:"timePlayed"`
	GamesWon            int     `json:"gamesWon"`
	WinPercentage       int     `json:"winPercentage"`
	WeaponAccuracy      int     `json:"weaponAccuracy"`
	EliminationsPerLife float64 `json:"eliminationsPerLife"`
	MultiKillBest       int     `json:"multiKillBest"`
	ObjectiveKills      float64 `json:"objectiveKills"`
}

TopHeroStats holds basic stats for each hero

Jump to

Keyboard shortcuts

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