ovrstat

package
v0.0.0-...-13d1a95 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 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 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   statsCollection `json:"quickPlayStats"`
	CompetitiveStats statsCollection `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 Rating

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

Jump to

Keyboard shortcuts

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