Documentation ¶
Overview ¶
Package opendota provides a Client for accessing the OpenDota Api.
Here are some examples of requests:
// OpenDota client client := opendota.NewClient(httpClient) // Get Match Data match, res, err := client.MatchService.Match(3559037317) fmt.Println(match.DireTeam.Name, "VS", match.RadiantTeam.Name) // Get Player Data player, res, err := client.PlayerService.Player(111620041) fmt.Println(player.Profile.Name, player.SoloCompetitiveRank) // Player Param params := &opendota.PlayerParam{ Win: 0, } // Get Won Matches For Player wins, res, err := client.PlayerService.Matches(111620041, params) for _, game := range wins { fmt.Println(game.MatchID, game.HeroID) }
All required parameters are passed as arguments to functions. Additional arguments can be passed via the param objects.
Index ¶
- type APIError
- type Benchmark
- type BenchmarkPercentile
- type BenchmarkResult
- type BenchmarkService
- type Benchmarks
- type BuybackLog
- type Chat
- type Cheese
- type Client
- type Cosmetics
- type CountryMmr
- type CountryMmrRow
- type Distribution
- type DistributionService
- type ExplorerService
- type Field
- type GameWins
- type Health
- type HealthService
- type Hero
- type HeroDuration
- type HeroMatch
- type HeroMatchup
- type HeroPlayer
- type HeroRanking
- type HeroService
- func (s *HeroService) Durations(heroID int) ([]HeroDuration, *http.Response, error)
- func (s *HeroService) Heroes() ([]Hero, *http.Response, error)
- func (s *HeroService) Matches(heroID int) ([]HeroMatch, *http.Response, error)
- func (s *HeroService) Matchups(heroID int) ([]HeroMatchup, *http.Response, error)
- func (s *HeroService) Players(heroID int) ([]HeroPlayer, *http.Response, error)
- type HeroStat
- type HeroStatService
- type HostnameCounts
- type ItemTimings
- type ItemTimingsParam
- type LaneRoles
- type LaneRolesParam
- type League
- type LeagueService
- type LiveGame
- type LivePlayers
- type LiveService
- type Log
- type Match
- type MatchLeague
- type MatchPlayer
- type MatchService
- type MatchStatus
- type MatchTeam
- type MaxHeroHit
- type Metadata
- type MetadataService
- type MiscParam
- type MiscQueryResults
- type Mmr
- type MmrEstimate
- type MmrRow
- type Objective
- type ObsLog
- type PickBans
- type Player
- type PlayerCounts
- type PlayerHero
- type PlayerHistogram
- type PlayerMatch
- type PlayerParam
- type PlayerPeers
- type PlayerPros
- type PlayerRankings
- type PlayerRatings
- type PlayerService
- func (s *PlayerService) Counts(accountID int64, params *PlayerParam) (PlayerCounts, *http.Response, error)
- func (s *PlayerService) Heroes(accountID int64, params *PlayerParam) ([]PlayerHero, *http.Response, error)
- func (s *PlayerService) Histograms(accountID int64, field string, params *PlayerParam) ([]PlayerHistogram, *http.Response, error)
- func (s *PlayerService) Matches(accountID int64, params *PlayerParam) ([]PlayerMatch, *http.Response, error)
- func (s *PlayerService) Peers(accountID int64, params *PlayerParam) ([]PlayerPeers, *http.Response, error)
- func (s *PlayerService) Player(accountID int64) (Player, *http.Response, error)
- func (s *PlayerService) Pros(accountID int64, params *PlayerParam) ([]PlayerPros, *http.Response, error)
- func (s *PlayerService) Rankings(accountID int64) ([]PlayerRankings, *http.Response, error)
- func (s *PlayerService) Ratings(accountID int64) ([]PlayerRatings, *http.Response, error)
- func (s *PlayerService) RecentMatches(accountID int64) ([]PlayerMatch, *http.Response, error)
- func (s *PlayerService) Totals(accountID int64, params *PlayerParam) ([]PlayerTotals, *http.Response, error)
- func (s *PlayerService) WardMap(accountID int64, params *PlayerParam) (PlayerWardMap, *http.Response, error)
- func (s *PlayerService) WinLoss(accountID int64, params *PlayerParam) (WinLoss, *http.Response, error)
- func (s *PlayerService) WordCloud(accountID int64, params *PlayerParam) (PlayerWordCloud, *http.Response, error)
- type PlayerTotals
- type PlayerWardMap
- type PlayerWordCloud
- type ProMatch
- type ProMatchService
- type ProPlayer
- type ProPlayerService
- type Profile
- type PublicMatch
- type PublicMatchParam
- type PublicMatchService
- type QueryResult
- type Ranking
- type RankingService
- type RawPCT
- type Record
- type RecordService
- type RedisUsage
- type Replay
- type ReplayService
- type RunesLog
- type ScenariosService
- type Schema
- type SchemaService
- type Search
- type SearchParams
- type SearchService
- type Status
- type StatusService
- type Sum
- type Team
- type TeamHeroes
- type TeamMatch
- type TeamPlayers
- type TeamService
- func (s *TeamService) Heroes(teamID int64) ([]TeamHeroes, *http.Response, error)
- func (s *TeamService) Matches(teamID int64) ([]TeamMatch, *http.Response, error)
- func (s *TeamService) Players(teamID int64) ([]TeamPlayers, *http.Response, error)
- func (s *TeamService) Team(teamID int64) (Team, *http.Response, error)
- func (s *TeamService) Teams() ([]Team, *http.Response, error)
- type TeamfightPlayers
- type Teamfights
- type Usage
- type WinLoss
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Benchmark ¶
type Benchmark struct { HeroID int `json:"hero_id"` Result BenchmarkResult `json:"result"` }
Benchmark holds a collection of benchmarks for a hero.
type BenchmarkPercentile ¶
type BenchmarkResult ¶
type BenchmarkResult struct { GoldPerMin []BenchmarkPercentile `json:"gold_per_min"` XpPerMin []BenchmarkPercentile `json:"xp_per_min"` KillsPerMin []BenchmarkPercentile `json:"kills_per_min"` LastHitsPerMin []BenchmarkPercentile `json:"last_hits_per_min"` HeroDamagePerMin []BenchmarkPercentile `json:"hero_damage_per_min"` HeroHealingPerMin []BenchmarkPercentile `json:"hero_healing_per_min"` TowerDamage []BenchmarkPercentile `json:"tower_damage"` }
type BenchmarkService ¶
type BenchmarkService struct {
// contains filtered or unexported fields
}
BenchmarkService provides a method for benchmark statistics in OpenDota.
func (*BenchmarkService) Benchmarks ¶
Benchmarks takes a Hero ID and returns the corresponding benchmarks for that hero. https://docs.opendota.com/#tag/benchmarks%2Fpaths%2F~1benchmarks%2Fget
type Benchmarks ¶
type Benchmarks struct { GoldPerMin RawPCT `json:"gold_per_min"` XpPerMin RawPCT `json:"xp_per_min"` KillsPerMin RawPCT `json:"kills_per_min"` LastHitsPerMin RawPCT `json:"last_hits_per_min"` HeroDamagePerMin RawPCT `json:"hero_damage_per_min"` HeroHealingPerMin RawPCT `json:"hero_healing_per_min"` TowerDamage RawPCT `json:"tower_damage"` }
type BuybackLog ¶
type Client ¶
type Client struct { BenchmarkService *BenchmarkService DistributionService *DistributionService ExplorerService *ExplorerService HealthService *HealthService HeroService *HeroService HeroStatService *HeroStatService LeagueService *LeagueService LiveService *LiveService MatchService *MatchService MetadataService *MetadataService PlayerService *PlayerService ProMatchService *ProMatchService ProPlayerService *ProPlayerService PublicMatchService *PublicMatchService RankingService *RankingService RecordService *RecordService ReplayService *ReplayService ScenariosService *ScenariosService SchemaService *SchemaService SearchService *SearchService StatusService *StatusService TeamService *TeamService // contains filtered or unexported fields }
Client for making Open Dota API requests
type Cosmetics ¶
type Cosmetics struct { ItemID int `json:"item_id"` Name string `json:"name"` Prefab string `json:"prefab"` CreationDate string `json:"creation_date"` ImageInventory string `json:"image_inventory"` ImagePath string `json:"image_path"` ItemDescription string `json:"item_description"` ItemName string `json:"item_name"` ItemRarity string `json:"item_rarity"` ItemTypeName string `json:"item_type_name"` UsedByHeroes string `json:"used_by_heroes"` }
type CountryMmr ¶
type CountryMmrRow ¶
type Distribution ¶
type Distribution struct { Mmr Mmr `json:"mmr"` CountryMmr CountryMmr `json:"country_mmr"` }
Distribution holds distributions of Matchmaking Ranking (MMR) data for each region.
type DistributionService ¶
type DistributionService struct {
// contains filtered or unexported fields
}
DistributionService provides a method for accesing distribution data for Matchmaking Ranking (MMR).
func (*DistributionService) Distributions ¶
func (s *DistributionService) Distributions() (Distribution, *http.Response, error)
Distributions returns a collection of Matchmaking Ranking (MMR) distributions for each region. https://docs.opendota.com/#tag/distributions%2Fpaths%2F~1distributions%2Fget
type ExplorerService ¶
type ExplorerService struct {
// contains filtered or unexported fields
}
ExplorerService provides a method for exploring OpenDota's PostgreSQL database.
func (*ExplorerService) Explore ¶
func (s *ExplorerService) Explore(query string) (QueryResult, *http.Response, error)
Explore takes a SQL query as an argument and returns query results. https://docs.opendota.com/#tag/explorer%2Fpaths%2F~1explorer%2Fget
type Health ¶
type Health struct { PostgresUsage Usage `json:"postgresUsage"` RedisUsage RedisUsage `json:"redisUsage"` ParseDelay Usage `json:"parseDelay"` CassandraUsage Usage `json:"cassandraUsage"` SeqNumDelay Usage `json:"seqNumDelay"` SteamAPI Usage `json:"steamApi"` }
Health represents health stats for the OpenDota API.
type HealthService ¶
type HealthService struct {
// contains filtered or unexported fields
}
HealthService provides a method for accessing health stats about the OpenDota API.
func (*HealthService) Health ¶
func (s *HealthService) Health() (Health, *http.Response, error)
Health returns health stats for the OpenDota API. https://docs.opendota.com/#tag/health%2Fpaths%2F~1health%2Fget
type Hero ¶
type Hero struct { ID int `json:"id"` Name string `json:"name"` LocalizedName string `json:"localized_name"` PrimaryAttr string `json:"primary_attr"` AttackType string `json:"attack_type"` Roles []string `json:"roles"` Legs int `json:"legs"` }
Hero holds a collection of data specific to a Dota 2 hero.
type HeroDuration ¶
type HeroDuration struct { DurationBin int `json:"duration_bin"` GamesPlayed int `json:"games_played"` Wins int `json:"wins"` }
HeroDuration represents a heroes performance over a range of match durations.
type HeroMatch ¶
type HeroMatch struct { MatchID int64 `json:"match_id"` StartTime int `json:"start_time"` Duration int `json:"duration"` RadiantWin bool `json:"radiant_win"` LeagueID int `json:"leagueid"` LeagueName string `json:"league_name"` Radiant bool `json:"radiant"` AccountID int `json:"account_id"` Kills int `json:"kills"` Deaths int `json:"deaths"` Assists int `json:"assists"` }
HeroMatch represents data about a hero in a Dota 2 match.
type HeroMatchup ¶
type HeroMatchup struct { HeroID int `json:"hero_id"` GamesPlayed int `json:"games_played"` Wins int `json:"wins"` }
HeroMatchup represents data about how a hero matches up against another hero.
type HeroPlayer ¶
type HeroPlayer struct { AccountID int `json:"account_id"` GamesPlayed int `json:"games_played"` Wins int `json:"wins"` }
HeroPlayer represents data about how a player performs on a hero.
type HeroRanking ¶
HeroRanking represents the top player rankings for a hero.
type HeroService ¶
type HeroService struct {
// contains filtered or unexported fields
}
HeroService provides methods for accessing information about heroes.
func (*HeroService) Durations ¶
func (s *HeroService) Durations(heroID int) ([]HeroDuration, *http.Response, error)
Durations takes a Hero ID and returns a collection of stats about a hero for varying match lengths. https://docs.opendota.com/#tag/heroes%2Fpaths%2F~1heroes~1%7Bhero_id%7D~1durations%2Fget
func (*HeroService) Heroes ¶
func (s *HeroService) Heroes() ([]Hero, *http.Response, error)
Heroes returns a collection of all heroes. https://docs.opendota.com/#tag/heroes%2Fpaths%2F~1heroes%2Fget
func (*HeroService) Matches ¶
Matches takes a Hero ID and returns a collection of matches played by the hero. https://docs.opendota.com/#tag/heroes%2Fpaths%2F~1heroes~1%7Bhero_id%7D~1matches%2Fget
func (*HeroService) Matchups ¶
func (s *HeroService) Matchups(heroID int) ([]HeroMatchup, *http.Response, error)
Matchups takes a Hero ID and returns a collection of how a hero compares against all other heroes. https://docs.opendota.com/#tag/heroes%2Fpaths%2F~1heroes~1%7Bhero_id%7D~1matchups%2Fget
func (*HeroService) Players ¶
func (s *HeroService) Players(heroID int) ([]HeroPlayer, *http.Response, error)
Players takes a Hero ID and returns a collection about players for a hero. https://docs.opendota.com/#tag/heroes%2Fpaths%2F~1heroes~1%7Bhero_id%7D~1players%2Fget
type HeroStat ¶
type HeroStat struct { ID int `json:"id"` Name string `json:"name"` LocalizedName string `json:"localized_name"` PrimaryAttr string `json:"primary_attr"` AttackType string `json:"attack_type"` Roles []string `json:"roles"` Img string `json:"img"` Icon string `json:"icon"` BaseHealth int `json:"base_health"` BaseHealthRegen float64 `json:"base_health_regen"` BaseMana int `json:"base_mana"` BaseManaRegen float64 `json:"base_mana_regen"` BaseArmor float64 `json:"base_armor"` BaseMr int `json:"base_mr"` BaseAttackMin int `json:"base_attack_min"` BaseAttackMax int `json:"base_attack_max"` BaseStr int `json:"base_str"` BaseAgi int `json:"base_agi"` BaseInt int `json:"base_int"` StrGain float64 `json:"str_gain"` AgiGain float64 `json:"agi_gain"` IntGain float64 `json:"int_gain"` AttackRange int `json:"attack_range"` ProjectileSpeed int `json:"projectile_speed"` AttackRate float64 `json:"attack_rate"` MoveSpeed int `json:"move_speed"` TurnRate float64 `json:"turn_rate"` CmEnabled bool `json:"cm_enabled"` Legs int `json:"legs"` ProWin int `json:"pro_win,omitempty"` ProPick int `json:"pro_pick,omitempty"` HeroID int `json:"hero_id,omitempty"` ProBan int `json:"pro_ban,omitempty"` NullPick int `json:"null_pick"` NullWin int `json:"null_win"` OnePick int `json:"1_pick"` OneWin int `json:"1_win"` TwoPick int `json:"2_pick"` TwoWin int `json:"2_win"` ThreePick int `json:"3_pick"` ThreeWin int `json:"3_win"` FourPick int `json:"4_pick"` FourWin int `json:"4_win"` FivePick int `json:"5_pick"` FiveWin int `json:"5_win"` SixPick int `json:"6_pick"` SixWin int `json:"6_win"` SevenPick int `json:"7_pick"` SevenWin int `json:"7_win"` EightPick int `json:"8_pick"` EightWin int `json:"8_win"` }
HeroStat represents a collection of statistics about a hero.
type HeroStatService ¶
type HeroStatService struct {
// contains filtered or unexported fields
}
HeroStatService provides a method for accessing hero stats.
func (*HeroStatService) HeroStats ¶
func (s *HeroStatService) HeroStats() ([]HeroStat, *http.Response, error)
HeroStats returns a collection of stats about all heroes. https://docs.opendota.com/#tag/hero-stats%2Fpaths%2F~1heroStats%2Fget
type HostnameCounts ¶
type ItemTimings ¶
type ItemTimings struct { HeroID int `json:"hero_id"` Item string `json:"item"` Time int `json:"time"` Games string `json:"games"` Wins string `json:"wins"` }
ItemTimings represents item timing information.
type ItemTimingsParam ¶
type ItemTimingsParam struct { HeroID int `url:"hero_id,omitempty"` Item string `url:"item,omitempty"` }
ItemTimingsParam is used for customizing item timing queries.
type LaneRoles ¶
type LaneRoles struct { HeroID int `json:"hero_id"` LaneRole int `json:"lane_role"` Time int `json:"time"` Games string `json:"games"` Wins string `json:"wins"` }
LaneRoles represents lane role information.
type LaneRolesParam ¶
type LaneRolesParam struct { HeroID int `url:"hero_id,omitempty"` LaneRole string `url:"lane_role,omitempty"` }
LaneRolesParam is used for customizing lane role queries.
type League ¶
type League struct { LeagueID int `json:"leagueid"` Ticket string `json:"ticket"` Banner string `json:"banner"` Tier string `json:"tier"` Name string `json:"name"` }
League represents a league in Dota 2.
type LeagueService ¶
type LeagueService struct {
// contains filtered or unexported fields
}
LeagueService provides a method for accessing information about leagues.
func (*LeagueService) Leagues ¶
func (s *LeagueService) Leagues() ([]League, *http.Response, error)
Leagues returns a collection of all leagues in Dota 2. https://docs.opendota.com/#tag/leagues%2Fpaths%2F~1leagues%2Fget
type LiveGame ¶
type LiveGame struct { ActivateTime int64 `json:"activate_time"` DeactivateTime int64 `json:"deactivate_time"` ServerSteamID int64 `json:"server_steam_id"` LobbyID int64 `json:"lobby_id"` LeagueID int `json:"league_id"` LobbyType int `json:"lobby_type"` GameTime int `json:"game_time"` Delay int `json:"delay"` Spectators int `json:"spectators"` GameMode int `json:"game_mode"` AverageMmr int `json:"average_mmr"` SortScore int `json:"sort_score"` LastUpdateTime int `json:"last_update_time"` RadiantLead int `json:"radiant_lead"` RadiantScore int `json:"radiant_score"` DireScore int `json:"dire_score"` Players []LivePlayers `json:"players"` BuildingState int `json:"building_state"` MatchID int64 `json:"match_id"` RadiantTeamName string `json:"team_name_radiant"` RadiantTeamID int `json:"team_id_radiant"` DireTeamName string `json:"team_name_dire"` DireTeamID int `json:"team_id_dire"` }
LiveGame represents a live game.
type LivePlayers ¶
type LivePlayers struct { AccountID int `json:"account_id"` HeroID int `json:"hero_id"` Name string `json:"name,omitempty"` CountryCode string `json:"country_code,omitempty"` FantasyRole int `json:"fantasy_role,omitempty"` TeamID int `json:"team_id,omitempty"` TeamName string `json:"team_name,omitempty"` TeamTag string `json:"team_tag,omitempty"` IsLocked bool `json:"is_locked,omitempty"` IsPro bool `json:"is_pro,omitempty"` LockedUntil int `json:"locked_until,omitempty"` }
type LiveService ¶
type LiveService struct {
// contains filtered or unexported fields
}
LiveService provides a method for accessing live games.
func (*LiveService) Live ¶
func (s *LiveService) Live() ([]LiveGame, *http.Response, error)
Live returns a collection of the top live games. https://docs.opendota.com/#tag/live%2Fpaths%2F~1live%2Fget
type Match ¶
type Match struct { MatchID int64 `json:"match_id"` BarracksStatusDire int `json:"barracks_status_dire"` BarracksStatusRadiant int `json:"barracks_status_radiant"` Chat []Chat `json:"chat"` Cluster int `json:"cluster"` Cosmetics map[string]int `json:"cosmetics"` DireScore int `json:"dire_score"` Duration int `json:"duration"` Engine int `json:"engine"` FirstBloodTime int `json:"first_blood_time"` GameMode int `json:"game_mode"` HumanPlayers int `json:"human_players"` LeagueID int `json:"leagueid"` LobbyType int `json:"lobby_type"` MatchSeqNum int64 `json:"match_seq_num"` NegativeVotes int `json:"negative_votes"` Objectives []Objective `json:"objectives"` PicksBans []PickBans `json:"picks_bans"` PositiveVotes int `json:"positive_votes"` RadiantGoldAdv []int `json:"radiant_gold_adv"` RadiantScore int `json:"radiant_score"` RadiantWin bool `json:"radiant_win"` RadiantXpAdv []int `json:"radiant_xp_adv"` Skill int `json:"skill"` StartTime int `json:"start_time"` Teamfights []Teamfights `json:"teamfights"` TowerStatusDire int `json:"tower_status_dire"` TowerStatusRadiant int `json:"tower_status_radiant"` Version int `json:"version"` ReplaySalt int `json:"replay_salt"` SeriesID int `json:"series_id"` SeriesType int `json:"series_type"` League MatchLeague `json:"league"` RadiantTeam MatchTeam `json:"radiant_team"` DireTeam MatchTeam `json:"dire_team"` Players []MatchPlayer `json:"players"` Patch int `json:"patch"` Region int `json:"region"` AllWordCounts map[string]int `json:"all_word_counts"` MyWordCounts map[string]int `json:"my_word_counts"` Throw int `json:"throw"` Loss int `json:"loss"` ReplayURL string `json:"replay_url"` }
Match represents the data about a match.
type MatchLeague ¶
type MatchPlayer ¶
type MatchPlayer struct { MatchID int64 `json:"match_id"` PlayerSlot int `json:"player_slot"` AbilityUpgradesArr []int `json:"ability_upgrades_arr"` AbilityUses map[string]int `json:"ability_uses"` AccountID int `json:"account_id"` Actions map[string]int `json:"actions"` Assists int `json:"assists"` Backpack0 int `json:"backpack_0"` Backpack1 int `json:"backpack_1"` Backpack2 int `json:"backpack_2"` BuybackLog []BuybackLog `json:"buyback_log"` CampsStacked int `json:"camps_stacked"` CreepsStacked int `json:"creeps_stacked"` Damage map[string]int `json:"damage"` DamageInflictor map[string]int `json:"damage_inflictor"` DamageInflictorReceived map[string]int `json:"damage_inflictor_received"` DamageTaken map[string]int `json:"damage_taken"` Deaths int `json:"deaths"` Denies int `json:"denies"` DnT []int `json:"dn_t"` FirstbloodClaimed int `json:"firstblood_claimed"` Gold int `json:"gold"` GoldPerMin int `json:"gold_per_min"` GoldReasons map[string]int `json:"gold_reasons"` GoldSpent int `json:"gold_spent"` GoldT []int `json:"gold_t"` HeroDamage int `json:"hero_damage"` HeroHealing int `json:"hero_healing"` HeroHits map[string]int `json:"hero_hits"` HeroID int `json:"hero_id"` Item0 int `json:"item_0"` Item1 int `json:"item_1"` Item2 int `json:"item_2"` Item3 int `json:"item_3"` Item4 int `json:"item_4"` Item5 int `json:"item_5"` ItemUses map[string]int `json:"item_uses"` KillStreaks map[string]int `json:"kill_streaks"` Killed map[string]int `json:"killed"` KilledBy map[string]int `json:"killed_by"` Kills int `json:"kills"` KillsLog []Log `json:"kills_log"` LanePos map[string]map[string]int `json:"lane_pos"` LastHits int `json:"last_hits"` LeaverStatus int `json:"leaver_status"` Level int `json:"level"` LhT []int `json:"lh_t"` LifeState map[string]int `json:"life_state"` MaxHeroHit MaxHeroHit `json:"max_hero_hit"` MultiKills map[string]int `json:"multi_kills"` Obs map[string]map[string]int `json:"obs"` ObsLeftLog []ObsLog `json:"obs_left_log"` ObsLog []ObsLog `json:"obs_log"` ObsPlaced int `json:"obs_placed"` PartyID int `json:"party_id"` PartySize int `json:"party_size"` Pings int `json:"pings"` PredVict bool `json:"pred_vict"` Purchase map[string]int `json:"purchase"` PurchaseLog []Log `json:"purchase_log"` Randomed bool `json:"randomed"` RoshansKilled int `json:"roshans_killed"` RunePickups int `json:"rune_pickups"` Runes map[string]int `json:"runes"` RunesLog []RunesLog `json:"runes_log"` Sen map[string]map[string]int `json:"sen"` SenLeftLog []ObsLog `json:"sen_left_log"` SenLog []ObsLog `json:"sen_log"` SenPlaced int `json:"sen_placed"` Stuns float64 `json:"stuns"` TeamfightParticipation float64 `json:"teamfight_participation"` Times []int `json:"times"` TowerDamage int `json:"tower_damage"` TowersKilled int `json:"towers_killed"` XpPerMin int `json:"xp_per_min"` XpReasons map[string]int `json:"xp_reasons"` XpT []int `json:"xp_t"` Personaname string `json:"personaname"` Name string `json:"name"` LastLogin string `json:"last_login"` RadiantWin bool `json:"radiant_win"` StartTime int `json:"start_time"` Duration int `json:"duration"` Cluster int `json:"cluster"` LobbyType int `json:"lobby_type"` GameMode int `json:"game_mode"` Patch int `json:"patch"` Region int `json:"region"` IsRadiant bool `json:"isRadiant"` Win int `json:"win"` Lose int `json:"lose"` TotalGold int `json:"total_gold"` TotalXp int `json:"total_xp"` KillsPerMin float64 `json:"kills_per_min"` Kda float64 `json:"kda"` Abandons int `json:"abandons"` NeutralKills int `json:"neutral_kills"` TowerKills int `json:"tower_kills"` CourierKills int `json:"courier_kills"` LaneKills int `json:"lane_kills"` HeroKills int `json:"hero_kills"` ObserverKills int `json:"observer_kills"` SentryKills int `json:"sentry_kills"` RoshanKills int `json:"roshan_kills"` NecronomiconKills int `json:"necronomicon_kills"` AncientKills int `json:"ancient_kills"` BuybackCount int `json:"buyback_count"` ObserverUses int `json:"observer_uses"` SentryUses int `json:"sentry_uses"` LaneEfficiency float64 `json:"lane_efficiency"` LaneEfficiencyPct int `json:"lane_efficiency_pct"` Lane int `json:"lane"` LaneRole int `json:"lane_role"` IsRoaming bool `json:"is_roaming"` PurchaseTime map[string]int `json:"purchase_time"` FirstPurchaseTime map[string]int `json:"first_purchase_time"` ItemWin map[string]int `json:"item_win"` ItemUsage map[string]int `json:"item_usage"` PurchaseTpscroll int `json:"purchase_tpscroll"` ActionsPerMin int `json:"actions_per_min"` LifeStateDead int `json:"life_state_dead"` SoloCompetitiveRank int `json:"solo_competitive_rank"` Cosmetics []Cosmetics `json:"cosmetics"` Benchmarks Benchmarks `json:"benchmarks"` PurchaseWardObserver int `json:"purchase_ward_observer,omitempty"` PurchaseWardSentry int `json:"purchase_ward_sentry,omitempty"` PurchaseGem int `json:"purchase_gem,omitempty"` }
type MatchService ¶
type MatchService struct {
// contains filtered or unexported fields
}
MatchService provides a method for accessing information about matches.
func (*MatchService) Match ¶
Match takes a Match ID and returns a collection about match. https://docs.opendota.com/#tag/matches
type MatchStatus ¶
type MaxHeroHit ¶
type MetadataService ¶
type MetadataService struct {
// contains filtered or unexported fields
}
MetadataService provides a method for accesing OpenDota's metadata.
func (*MetadataService) Metadata ¶
func (s *MetadataService) Metadata() (Metadata, *http.Response, error)
Metadata returns a collection of metadata for the OpenDota site. https://docs.opendota.com/#tag/metadata%2Fpaths%2F~1metadata%2Fget
type MiscParam ¶
type MiscParam struct {
Scenario string `url:"scenario,omitempty"`
}
MiscParam is used for creating a misc scenario query.
type MiscQueryResults ¶
type MiscQueryResults struct { Scenario string `json:"scenario"` IsRadiant bool `json:"is_radiant"` Region int `json:"region"` Games string `json:"games"` Wins string `json:"wins"` }
MiscQueryResults contains results for the scenario query.
type MmrEstimate ¶
type MmrEstimate struct {
Estimate int `json:"estimate"`
}
MmrEstimate represents the estimated MMR score for a player.
type Player ¶
type Player struct { TrackedUntil string `json:"tracked_until,omitempty"` SoloCompetitiveRank int `json:"solo_competitive_rank,omitempty"` MmrEstimate MmrEstimate `json:"mmr_estimate"` Profile Profile `json:"profile"` CompetitiveRank int `json:"competitive_rank,omitempty"` RankTier int `json:"rank_tier"` }
Player represents stats about a player.
type PlayerCounts ¶
type PlayerCounts struct { LeaverStatus map[string]GameWins `json:"leaver_status"` GameMode map[string]GameWins `json:"game_mode"` LobbyType map[string]GameWins `json:"lobby_type"` LaneRole map[string]GameWins `json:"lane_role"` Region map[string]GameWins `json:"region"` Patch map[string]GameWins `json:"patch"` IsRadiant map[string]GameWins `json:"is_radiant"` }
PlayerCounts represents the counts of wins for a player for various stats.
type PlayerHero ¶
type PlayerHero struct { HeroID string `json:"hero_id"` LastPlayed int `json:"last_played"` Games int `json:"games"` Win int `json:"win"` WithGames int `json:"with_games"` WithWin int `json:"with_win"` AgainstGames int `json:"against_games"` AgainstWin int `json:"against_win"` }
PlayerHero represents the stats of a hero played by a player.
type PlayerHistogram ¶
PlayerHistogram represents a distribution of data for a player.
type PlayerMatch ¶
type PlayerMatch struct { MatchID int64 `json:"match_id"` PlayerSlot int `json:"player_slot"` RadiantWin bool `json:"radiant_win"` Duration int `json:"duration"` GameMode int `json:"game_mode"` LobbyType int `json:"lobby_type"` HeroID int `json:"hero_id"` StartTime int `json:"start_time"` Version int `json:"version"` Kills int `json:"kills"` Deaths int `json:"deaths"` Assists int `json:"assists"` Skill int `json:"skill,omitempty"` XpPerMin int `json:"xp_per_min,omitempty"` GoldPerMin int `json:"gold_per_min,omitempty"` HeroDamage int `json:"hero_damage,omitempty"` TowerDamage int `json:"tower_damage,omitempty"` HeroHealing int `json:"hero_healing,omitempty"` LastHits int `json:"last_hits,omitempty"` Lane int `json:"lane,omitempty"` LaneRole int `json:"lane_role,omitempty"` IsRoaming bool `json:"is_roaming,omitempty"` Cluster int `json:"cluster,omitempty"` LeaverStatus int `json:"leaver_status,omitempty"` PartySize int `json:"party_size"` }
PlayerMatch represents match data for a player.
type PlayerParam ¶
type PlayerParam struct { Limit int `url:"limit,omitempty"` Offset int `url:"offset,omitempty"` Win int `url:"win,omitempty"` Patch int `url:"patch,omitempty"` GameMode int `url:"game_mode,omitempty"` LobbyType int `url:"lobby_type,omitempty"` Region int `url:"region,omitempty"` Date int `url:"date,omitempty"` LaneRole int `url:"lane_role,omitempty"` HeroID int `url:"hero_id,omitempty"` IsRadiant int `url:"is_radiant,omitempty"` IncAccountID int64 `url:"included_account_id,omitempty"` ExcAccountID int64 `url:"excluded_account_id,omitempty"` WithHeroID int `url:"with_hero_id,omitempty"` AgainstHeroID int `url:"against_hero_id,omitempty"` Significant int `url:"significant,omitempty"` Sort string `url:"sort,omitempty"` Project []string `url:"project,omitempty"` }
PlayerParam is used for customizing Player queries.
type PlayerPeers ¶
type PlayerPeers struct { AccountID int `json:"account_id"` LastPlayed int `json:"last_played"` Win int `json:"win"` Games int `json:"games"` WithWin int `json:"with_win"` WithGames int `json:"with_games"` AgainstWin int `json:"against_win"` AgainstGames int `json:"against_games"` WithGpmSum int `json:"with_gpm_sum"` WithXpmSum int `json:"with_xpm_sum"` Personaname string `json:"personaname"` LastLogin string `json:"last_login"` Avatar string `json:"avatar"` AvatarFull string `json:"avatarfull"` }
PlayerPeers represents data about peers a player has played with.
type PlayerPros ¶
type PlayerPros struct { AccountID int `json:"account_id"` Name string `json:"name"` CountryCode string `json:"country_code"` FantasyRole int `json:"fantasy_role"` TeamID int `json:"team_id"` TeamName string `json:"team_name"` TeamTag string `json:"team_tag"` IsLocked bool `json:"is_locked"` IsPro bool `json:"is_pro"` LockedUntil int `json:"locked_until"` SteamID string `json:"steamid"` Avatar string `json:"avatar"` AvatarMedium string `json:"avatarmedium"` AvatarFull string `json:"avatarfull"` ProfileURL string `json:"profileurl"` Personaname string `json:"personaname"` Cheese int `json:"cheese"` LocCountryCode string `json:"loccountrycode"` LastPlayed int `json:"last_played"` FullHistoryTime string `json:"full_history_time"` LastMatchTime string `json:"last_match_time"` Win int `json:"win"` Games int `json:"games"` WithWin int `json:"with_win"` WithGames int `json:"with_games"` AgainstWin int `json:"against_win"` AgainstGames int `json:"against_games"` WithGpmSum int `json:"with_gpm_sum"` WithXpmSum int `json:"with_xpm_sum"` }
PlayerPros represents data about pro players a player has played with.
type PlayerRankings ¶
type PlayerRankings struct { HeroID int `json:"hero_id"` Score float64 `json:"score"` PercentRank int `json:"percent_rank"` Card int `json:"card"` }
PlayerRankings represents the ranking of a player.
type PlayerRatings ¶
type PlayerRatings struct { AccountID int `json:"account_id"` MatchID int64 `json:"match_id"` SoloCompetitiveRank int `json:"solo_competitive_rank"` CompetitiveRank int `json:"competitive_rank"` Time string `json:"time"` }
PlayerRatings represents the ratings of a player.
type PlayerService ¶
type PlayerService struct {
// contains filtered or unexported fields
}
PlayerService provides methods for accessing information about players.
func (*PlayerService) Counts ¶
func (s *PlayerService) Counts(accountID int64, params *PlayerParam) (PlayerCounts, *http.Response, error)
Counts takes an Account ID and optional params returns the counts of categories for a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1counts%2Fget
func (*PlayerService) Heroes ¶
func (s *PlayerService) Heroes(accountID int64, params *PlayerParam) ([]PlayerHero, *http.Response, error)
Heroes takes an Account ID and optional params and returns information about heroes played by a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1heroes%2Fget
func (*PlayerService) Histograms ¶
func (s *PlayerService) Histograms(accountID int64, field string, params *PlayerParam) ([]PlayerHistogram, *http.Response, error)
Histograms takes an Account ID, Field and optional params and returns a distribution of matches of a player for that field. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1histograms~1%7Bfield%7D%2Fget
func (*PlayerService) Matches ¶
func (s *PlayerService) Matches(accountID int64, params *PlayerParam) ([]PlayerMatch, *http.Response, error)
Matches takes an Account ID and optional params and returns recent matches for a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1matches%2Fget
func (*PlayerService) Peers ¶
func (s *PlayerService) Peers(accountID int64, params *PlayerParam) ([]PlayerPeers, *http.Response, error)
Peers takes an Account ID and optional params and returns information about games played with other players. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1peers%2Fget
func (*PlayerService) Player ¶
Player takes an account id and returns information about a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D%2Fget
func (*PlayerService) Pros ¶
func (s *PlayerService) Pros(accountID int64, params *PlayerParam) ([]PlayerPros, *http.Response, error)
Pros takes an Account ID and optional params and returns information about games played with other pro players. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1pros%2Fget
func (*PlayerService) Rankings ¶
func (s *PlayerService) Rankings(accountID int64) ([]PlayerRankings, *http.Response, error)
Rankings takes an Account ID and returns ranking history for a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1rankings%2Fget
func (*PlayerService) Ratings ¶
func (s *PlayerService) Ratings(accountID int64) ([]PlayerRatings, *http.Response, error)
Ratings takes an Account ID and returns rating history for a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1ratings%2Fget
func (*PlayerService) RecentMatches ¶
func (s *PlayerService) RecentMatches(accountID int64) ([]PlayerMatch, *http.Response, error)
RecentMatches takes an Account ID and returns recent matches for a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1recentMatches%2Fget
func (*PlayerService) Totals ¶
func (s *PlayerService) Totals(accountID int64, params *PlayerParam) ([]PlayerTotals, *http.Response, error)
Totals takes an Account ID and optional params and returns totals for a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1totals%2Fget
func (*PlayerService) WardMap ¶
func (s *PlayerService) WardMap(accountID int64, params *PlayerParam) (PlayerWardMap, *http.Response, error)
WardMap takes an Account ID and optional params and returns wards placed in matches by a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1wardmap%2Fget
func (*PlayerService) WinLoss ¶
func (s *PlayerService) WinLoss(accountID int64, params *PlayerParam) (WinLoss, *http.Response, error)
WinLoss takes an Account ID and optional params and returns the win/loss count for a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1wl%2Fget
func (*PlayerService) WordCloud ¶
func (s *PlayerService) WordCloud(accountID int64, params *PlayerParam) (PlayerWordCloud, *http.Response, error)
WordCloud takes an Account ID and optional params and returns words said in matches by a player. https://docs.opendota.com/#tag/players%2Fpaths%2F~1players~1%7Baccount_id%7D~1wordcloud%2Fget
type PlayerTotals ¶
PlayerTotals represents totals in different fields for a player.
type PlayerWardMap ¶
type PlayerWardMap struct { Obs map[string]map[string]int `json:"obs"` Sen map[string]map[string]int `json:"sen"` }
PlayerWardMap represents observer and sentry wards placed by a player.
type PlayerWordCloud ¶
type PlayerWordCloud struct { MyWordCounts map[string]int `json:"my_word_counts"` AllWordCounts map[string]int `json:"all_word_counts"` }
PlayerWordCloud represents the words said by a player in chat.
type ProMatch ¶
type ProMatch struct { MatchID int64 `json:"match_id"` Duration int `json:"duration"` StartTime int `json:"start_time"` RadiantTeamID int `json:"radiant_team_id"` RadiantName string `json:"radiant_name"` DireTeamID int `json:"dire_team_id"` DireName string `json:"dire_name"` LeagueID int `json:"leagueid"` LeagueName string `json:"league_name"` SeriesID int `json:"series_id"` SeriesType int `json:"series_type"` RadiantScore int `json:"radiant_score"` DireScore int `json:"dire_score"` RadiantWin bool `json:"radiant_win"` }
ProMatch represents a professional match in Dota 2.
type ProMatchService ¶
type ProMatchService struct {
// contains filtered or unexported fields
}
ProMatchService provides a method for accessing professional matches.
func (*ProMatchService) Matches ¶
func (s *ProMatchService) Matches() ([]ProMatch, *http.Response, error)
Matches returns a collection of professional matches. https://docs.opendota.com/#tag/pro-matches%2Fpaths%2F~1proMatches%2Fget
type ProPlayer ¶
type ProPlayer struct { AccountID int `json:"account_id"` SteamID string `json:"steamid"` Avatar string `json:"avatar"` AvatarMedium string `json:"avatarmedium"` AvatarFull string `json:"avatarfull"` ProfileURL string `json:"profileurl"` Personaname string `json:"personaname"` LastLogin string `json:"last_login"` FullHistoryTime string `json:"full_history_time"` Cheese int `json:"cheese"` LocCountryCode string `json:"loccountrycode"` LastMatchTime string `json:"last_match_time"` Name string `json:"name"` CountryCode string `json:"country_code"` FantasyRole int `json:"fantasy_role"` TeamID int `json:"team_id"` TeamName string `json:"team_name"` TeamTag string `json:"team_tag"` IsLocked bool `json:"is_locked"` IsPro bool `json:"is_pro"` LockedUntil int `json:"locked_until"` }
ProPlayer represents a professional player in Dota 2.
type ProPlayerService ¶
type ProPlayerService struct {
// contains filtered or unexported fields
}
ProPlayerService provides a method for accessing professional player information.
func (*ProPlayerService) Players ¶
func (s *ProPlayerService) Players() ([]ProPlayer, *http.Response, error)
Players returns a collection about professional players. https://docs.opendota.com/#tag/pro-players%2Fpaths%2F~1proPlayers%2Fget
type Profile ¶
type Profile struct { AccountID int `json:"account_id"` Personaname string `json:"personaname"` Name string `json:"name"` Cheese int `json:"cheese"` SteamID string `json:"steamid"` Avatar string `json:"avatar"` AvatarMedium string `json:"avatarmedium"` AvatarFull string `json:"avatarfull"` ProfileURL string `json:"profileurl"` LastLogin string `json:"last_login,omitempty"` LocCountryCode string `json:"loccountrycode"` }
Profile represents a player's profile.
type PublicMatch ¶
type PublicMatch struct { MatchID int64 `json:"match_id"` MatchSeqNum int64 `json:"match_seq_num"` RadiantWin bool `json:"radiant_win"` StartTime int `json:"start_time"` Duration int `json:"duration"` AvgMmr int `json:"avg_mmr"` NumMmr int `json:"num_mmr"` LobbyType int `json:"lobby_type"` GameMode int `json:"game_mode"` RadiantTeam string `json:"radiant_team"` DireTeam string `json:"dire_team"` }
PublicMatch represents a public match in Dota 2.
type PublicMatchParam ¶
type PublicMatchParam struct { MmrAscending int `url:"mmr_ascending,omitempty"` MmrDescending int `url:"mmr_descending,omitempty"` LessThanMatchID int64 `url:"less_than_match_id,omitempty"` }
PublicMatchParam can be used to customize a public match query.
type PublicMatchService ¶
type PublicMatchService struct {
// contains filtered or unexported fields
}
PublicMatchService provides a method for accessing public matches.
func (*PublicMatchService) Matches ¶
func (s *PublicMatchService) Matches(params *PublicMatchParam) ([]PublicMatch, *http.Response, error)
Matches takes optional params and returns public match data. https://docs.opendota.com/#tag/public-matches%2Fpaths%2F~1publicMatches%2Fget
type QueryResult ¶
type QueryResult struct { Command string `json:"command"` RowCount int `json:"rowCount"` Oid int `json:"oid"` Rows []map[string]interface{} `json:"rows"` Fields []Field `json:"fields"` RowAsArray bool `json:"rowAsArray"` Err interface{} `json:"err"` }
QueryResult represents the results returned by OpenDota's PostgreSQL database.
type RankingService ¶
type RankingService struct {
// contains filtered or unexported fields
}
RankingService provides a method for accessing ranking of heroes for a player.
func (*RankingService) Rankings ¶
func (s *RankingService) Rankings(heroID int) (HeroRanking, *http.Response, error)
Rankings takes a Hero ID and returns the top player rankings for a hero. https://docs.opendota.com/#tag/rankings%2Fpaths%2F~1rankings%2Fget
type Record ¶
type Record struct { MatchID string `json:"match_id"` StartTime string `json:"start_time"` HeroID string `json:"hero_id"` Score string `json:"score"` }
Record represents a record for a field.
type RecordService ¶
type RecordService struct {
// contains filtered or unexported fields
}
RecordService provides a method for accessing records for a field.
func (*RecordService) Records ¶
Records takes a field and returns the records for that field. https://docs.opendota.com/#tag/records%2Fpaths%2F~1records~1%7Bfield%7D%2Fget
type RedisUsage ¶
type RedisUsage struct { Metric string `json:"metric"` Threshold int64 `json:"threshold"` Timestamp int `json:"timestamp"` }
RedisUsage requires special struct due to a bug in OpenDota.
type Replay ¶
type Replay struct { MatchID int64 `json:"match_id"` Cluster int `json:"cluster"` ReplaySalt int `json:"replay_salt"` SeriesID int `json:"series_id"` SeriesType int `json:"series_type"` }
Replay represents a Dota 2 replay.
type ReplayService ¶
type ReplayService struct {
// contains filtered or unexported fields
}
ReplayService provides a method for accesing replay data.
func (*ReplayService) Replays ¶
Replays takes an array of Match IDs and returns replays for those matches. https://docs.opendota.com/#tag/replays%2Fpaths%2F~1replays%2Fget
type ScenariosService ¶
type ScenariosService struct {
// contains filtered or unexported fields
}
ScenariosService provides a method for accessing OpenDota scenario information.
func (*ScenariosService) ItemTimings ¶
func (s *ScenariosService) ItemTimings(params *ItemTimingsParam) ([]ItemTimings, *http.Response, error)
ItemTimings returns information about item timings and winrates. https://docs.opendota.com/#tag/scenarios%2Fpaths%2F~1scenarios~1itemTimings%2Fget
func (*ScenariosService) LaneRoles ¶
func (s *ScenariosService) LaneRoles(params *LaneRolesParam) ([]LaneRoles, *http.Response, error)
LaneRoles returns information about hero lanes and winrates. https://docs.opendota.com/#tag/scenarios%2Fpaths%2F~1scenarios~1laneRoless%2Fget
func (*ScenariosService) Misc ¶
func (s *ScenariosService) Misc(params *MiscParam) ([]MiscQueryResults, *http.Response, error)
Misc returns information about winrates given a query. https://docs.opendota.com/#tag/scenarios%2Fpaths%2F~1scenarios~1misc%2Fget
type Schema ¶
type Schema struct { TableName string `json:"table_name"` ColumnName string `json:"column_name"` DataType string `json:"data_type"` }
Schema represents the database schema for OpenDota.
type SchemaService ¶
type SchemaService struct {
// contains filtered or unexported fields
}
SchemaService provides a method for accessing the OpenDota database schema.
func (*SchemaService) Schema ¶
func (s *SchemaService) Schema() ([]Schema, *http.Response, error)
Schema returns the OpenDota database schema. https://docs.opendota.com/#tag/schema%2Fpaths%2F~1schema%2Fget
type Search ¶
type Search struct { AccountID int `json:"account_id"` AvatarFull string `json:"avatarfull"` Personaname string `json:"personaname"` LastMatchTime string `json:"last_match_time"` Similarity float64 `json:"similarity"` }
Search represents a player for a given personaname.
type SearchParams ¶
type SearchParams struct { Similarity float64 `url:"similarity,omitempty"` // contains filtered or unexported fields }
SearchParams represents optional query parameters for the Search method. Default similarity is 0.51.
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
SearchService provides a method for searching players by personaname.
func (*SearchService) Search ¶
func (s *SearchService) Search(query string, params *SearchParams) ([]Search, *http.Response, error)
Search takes a query string and optional params and returns an array of players who are similar to the query provided. https://docs.opendota.com/#tag/search%2Fpaths%2F~1search%2Fget
type Status ¶
type Status struct { UserPlayers int `json:"user_players"` TrackedPlayers int `json:"tracked_players"` MatchesLastDay int `json:"matches_last_day"` MatchesLastHour int `json:"matches_last_hour"` RetrieverMatchesLastDay int `json:"retriever_matches_last_day"` ParsedMatchesLastDay int `json:"parsed_matches_last_day"` RequestsLastDay int `json:"requests_last_day"` APIHitsLastDay int `json:"api_hits_last_day"` APIHitsUILastDay int `json:"api_hits_ui_last_day"` FhQueue int `json:"fhQueue"` GcQueue int `json:"gcQueue"` MmrQueue int `json:"mmrQueue"` Retriever []HostnameCounts `json:"retriever"` APIPaths []HostnameCounts `json:"api_paths"` LastAdded []MatchStatus `json:"last_added"` LastParsed []MatchStatus `json:"last_parsed"` LoadTimes map[string]int `json:"load_times"` Health Health `json:"health"` }
Status represents the stats for the OpenDota API.
type StatusService ¶
type StatusService struct {
// contains filtered or unexported fields
}
StatusService provides a method for accessing OpenDota API stats.
func (*StatusService) Status ¶
func (s *StatusService) Status() (Status, *http.Response, error)
Status returns the current status of the OpenDota API. https://docs.opendota.com/#tag/status%2Fpaths%2F~1status%2Fget
type Team ¶
type Team struct { TeamID int `json:"team_id"` Rating float64 `json:"rating"` Wins int `json:"wins"` Losses int `json:"losses"` LastMatchTime int `json:"last_match_time"` Name string `json:"name"` Tag string `json:"tag"` LogoURL string `json:"logo_url"` }
Team represents the stats for a team.
type TeamHeroes ¶
type TeamHeroes struct { HeroID int `json:"hero_id"` LocalizedName string `json:"localized_name"` GamesPlayed int `json:"games_played"` Wins int `json:"wins"` }
TeamHeroes represents the hero data for a team.
type TeamMatch ¶
type TeamMatch struct { MatchID int64 `json:"match_id"` RadiantWin bool `json:"radiant_win"` Radiant bool `json:"radiant"` Duration int `json:"duration"` StartTime int `json:"start_time"` LeagueID int `json:"leagueid"` LeagueName string `json:"league_name"` Cluster int `json:"cluster"` }
TeamMatch represents the match data for a team.
type TeamPlayers ¶
type TeamPlayers struct { AccountID int `json:"account_id"` Name string `json:"name"` GamesPlayed int `json:"games_played"` Wins int `json:"wins"` IsCurrentTeamMember bool `json:"is_current_team_member"` }
TeamPlayers represents the players who have played on a team.
type TeamService ¶
type TeamService struct {
// contains filtered or unexported fields
}
TeamService provides methods for accessing information about teams in Dota 2.
func (*TeamService) Heroes ¶
func (s *TeamService) Heroes(teamID int64) ([]TeamHeroes, *http.Response, error)
Heroes takes a Team ID and returns stats for the heroes played by a team. https://docs.opendota.com/#tag/teams%2Fpaths%2F~1teams~1%7Bteam_id%7D~1heroes%2Fget
func (*TeamService) Matches ¶
Matches takes a Team ID and returns matches played by a team. https://docs.opendota.com/#tag/teams%2Fpaths%2F~1teams~1%7Bteam_id%7D~1matches%2Fget
func (*TeamService) Players ¶
func (s *TeamService) Players(teamID int64) ([]TeamPlayers, *http.Response, error)
Players takes a Team ID and returns the players that played on a team. https://docs.opendota.com/#tag/teams%2Fpaths%2F~1teams~1%7Bteam_id%7D~1players%2Fget
func (*TeamService) Team ¶
Team takes a Team ID and returns data about that team. https://docs.opendota.com/#tag/teams%2Fpaths%2F~1teams~1%7Bteam_id%7D%2Fget
func (*TeamService) Teams ¶
func (s *TeamService) Teams() ([]Team, *http.Response, error)
Teams returns data about all teams. https://docs.opendota.com/#tag/teams%2Fpaths%2F~1teams%2Fget
type TeamfightPlayers ¶
type TeamfightPlayers struct { AbilityUses map[string]int `json:"ability_uses"` ItemUses map[string]int `json:"item_uses"` Killed map[string]int `json:"killed"` Deaths int `json:"deaths"` Buybacks int `json:"buybacks"` Damage int `json:"damage"` Healing int `json:"healing"` GoldDelta int `json:"gold_delta"` XpDelta int `json:"xp_delta"` XpStart int `json:"xp_start"` XpEnd int `json:"xp_end"` }
type Teamfights ¶
type Teamfights struct { Start int `json:"start"` End int `json:"end"` LastDeath int `json:"last_death"` Deaths int `json:"deaths"` Players []TeamfightPlayers `json:"players"` }