Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PlatformPC is a platform for PCs (mouseKeyboard in the page) PlatformPC = "pc" // PlatformConsole is a consolidated platform of all consoles PlatformConsole = "console" )
Variables ¶
View Source
var ( // ErrPlayerNotFound is thrown when a player doesn't exist ErrPlayerNotFound = errors.New("Player not found! No Players 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"` HeroSpecific map[string]interface{} `json:"heroSpecific"` Game map[string]interface{} `json:"game"` MatchAwards map[string]interface{} `json:"matchAwards"` // Deaths appears to have been removed, so we hide it. Deaths map[string]interface{} `json:"deaths,omitempty"` }
CareerStats holds very detailed stats for each hero
type CompetitiveStatsCollection ¶
type CompetitiveStatsCollection struct { Season *int `json:"season"` StatsCollection }
type Platform ¶
type Platform struct { Name string Active bool RankWrapper *goquery.Selection ProfileView *goquery.Selection }
Platform represents a supported platform (PC, Console)
type Player ¶
type Player struct { BattleTag string `json:"battleTag"` Portrait string `json:"portrait"` Frame string `json:"frame"` IsPublic bool `json:"isPublic"` }
Player represents a response from the search-by-name api request
type PlayerStats ¶
type PlayerStats struct { Icon string `json:"icon"` Name string `json:"name"` Endorsement int `json:"endorsement"` EndorsementIcon string `json:"endorsementIcon"` Title string `json:"title"` Ratings []Rating `json:"ratings"` GamesPlayed int `json:"gamesPlayed"` GamesWon int `json:"gamesWon"` GamesLost int `json:"gamesLost"` QuickPlayStats QuickPlayStatsCollection `json:"quickPlayStats"` CompetitiveStats CompetitiveStatsCollection `json:"competitiveStats"` Private bool `json:"private"` }
PlayerStats holds all stats on a specified Overwatch player
func Stats ¶
func Stats(platformKey, tag string) (*PlayerStats, error)
Stats retrieves player stats Universal method if you don't need to differentiate it
type PlayerStatsProfile ¶
type PlayerStatsProfile struct { Icon string `json:"icon"` Name string `json:"name"` Endorsement int `json:"endorsement"` EndorsementIcon string `json:"endorsementIcon"` Title string `json:"title"` Ratings []Rating `json:"ratings"` Private bool `json:"private"` }
func ProfileStats ¶
func ProfileStats(platformKey, tag string) (*PlayerStatsProfile, error)
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"` WeaponAccuracy int `json:"weaponAccuracy"` CriticalHitAccuracy int `json:"criticalHitAccuracy"` 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.