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 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 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 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
Click to show internal directories.
Click to hide internal directories.