dotawebapi

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: 0BSD Imports: 6 Imported by: 0

README

steamwebapi-dota

This lightweight Go library provides an easy way accessing the Dota Steam Web API through a clean and functional interface which handles making HTTP requests and processing responses.

Documentation

Index

Constants

View Source
const DOTA2MatchIface = "IDOTA2Match_570"
View Source
const WebAPIKeyHeader = "x-webapi-key"

Variables

This section is empty.

Functions

This section is empty.

Types

type AbilityUpgrades

type AbilityUpgrades struct {
	Ability int `json:"ability"`
	Level   int `json:"level"`
	Time    int `json:"time"`
}

type GetMatchHistoryBySequenceNumConfig

type GetMatchHistoryBySequenceNumConfig struct {
	// contains filtered or unexported fields
}

func NewGetMatchHistoryBySequenceNumConfigDefault

func NewGetMatchHistoryBySequenceNumConfigDefault() *GetMatchHistoryBySequenceNumConfig

func (*GetMatchHistoryBySequenceNumConfig) SetQuantity added in v0.2.0

func (*GetMatchHistoryBySequenceNumConfig) SetStartSeqNum

type GetMatchHistoryConfig

type GetMatchHistoryConfig struct {
	// contains filtered or unexported fields
}

func NewGetMatchHistoryConfigDefault

func NewGetMatchHistoryConfigDefault() *GetMatchHistoryConfig

func (*GetMatchHistoryConfig) SetAccountID

func (c *GetMatchHistoryConfig) SetAccountID(accountID uint64) *GetMatchHistoryConfig

func (*GetMatchHistoryConfig) SetGameMode

func (c *GetMatchHistoryConfig) SetGameMode(gameMode uint32) *GetMatchHistoryConfig

func (*GetMatchHistoryConfig) SetHeroID

func (c *GetMatchHistoryConfig) SetHeroID(heroID uint32) *GetMatchHistoryConfig

func (*GetMatchHistoryConfig) SetLeagueID

func (c *GetMatchHistoryConfig) SetLeagueID(leagueID uint64) *GetMatchHistoryConfig

func (*GetMatchHistoryConfig) SetMinPlayers

func (c *GetMatchHistoryConfig) SetMinPlayers(minPlayers uint) *GetMatchHistoryConfig

func (*GetMatchHistoryConfig) SetQuantity added in v0.2.0

func (*GetMatchHistoryConfig) SetSkill

func (*GetMatchHistoryConfig) SetStartMatchID

func (c *GetMatchHistoryConfig) SetStartMatchID(start uint64) *GetMatchHistoryConfig

type MatchDetail

type MatchDetail struct {
	MatchID     uint64 `json:"match_id"`
	MatchSeqNum uint64 `json:"match_seq_num"`

	Cluster      int `json:"cluster"`
	Engine       int `json:"engine"`
	Flags        int `json:"flags"`
	GameMode     int `json:"game_mode"`
	HumanPlayers int `json:"human_players"`
	LeagueID     int `json:"leagueid"`
	LobbyType    int `json:"lobby_type"`

	RadiantWin bool `json:"radiant_win"`

	Duration        int        `json:"duration"`
	FirstBloodTime  int        `json:"first_blood_time"`
	PicksBans       []*PickBan `json:"picks_bans"`
	Players         []*Player  `json:"players"`
	PreGameDuration int        `json:"pre_game_duration"`
	StartTime       int        `json:"start_time"`

	DireScore          int `json:"dire_score"`
	TowerStatusDire    int `json:"tower_status_dire"`
	BarracksStatusDire int `json:"barracks_status_dire"`

	RadiantScore          int `json:"radiant_score"`
	TowerStatusRadiant    int `json:"tower_status_radiant"`
	BarracksStatusRadiant int `json:"barracks_status_radiant"`
}

func GetMatchDetails

func GetMatchDetails(ctx context.Context, apiKey string, matchID uint64) (*MatchDetail, error)

type MatchDetailLite

type MatchDetailLite struct {
	MatchID     uint64 `json:"match_id"`
	MatchSeqNum uint64 `json:"match_seq_num"`

	Players []*PlayerLite `json:"players"`
}

func GetMatchHistoryBySequenceNumLite added in v0.2.0

func GetMatchHistoryBySequenceNumLite(
	ctx context.Context,
	apiKey string,
	optConfig ...*GetMatchHistoryBySequenceNumConfig,
) ([]*MatchDetailLite, error)

func GetMatchHistoryLite added in v0.2.0

func GetMatchHistoryLite(
	ctx context.Context,
	apiKey string,
	optConfig ...*GetMatchHistoryConfig,
) (
	[]*MatchDetailLite,
	error,
)

type PickBan

type PickBan struct {
	HeroID int  `json:"hero_id"`
	IsPick bool `json:"is_pick"`
	Order  int  `json:"order"`
	Team   int  `json:"team"`
}

type Player

type Player struct {
	AccountID *uint64 `json:"account_id"`

	PlayerSlot int `json:"player_slot"`
	TeamNumber int `json:"team_number"`
	TeamSlot   int `json:"team_slot"`

	HeroID          int  `json:"hero_id"`
	HeroVariant     *int `json:"hero_variant,omitempty"`
	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"`
	Backpack0       int  `json:"backpack_0"`
	Backpack1       int  `json:"backpack_1"`
	Backpack2       int  `json:"backpack_2"`
	ItemNeutral     int  `json:"item_neutral"`
	AghanimsScepter int  `json:"aghanims_scepter"`
	AghanimsShard   int  `json:"aghanims_shard"`
	MoonShard       int  `json:"moonshard"`

	Denies            int `json:"denies"`
	Gold              int `json:"gold"`
	GoldPerMin        int `json:"gold_per_min"`
	GoldSpent         int `json:"gold_spent"`
	HeroDamage        int `json:"hero_damage"`
	HeroHealing       int `json:"hero_healing"`
	LastHits          int `json:"last_hits"`
	LeaverStatus      int `json:"leaver_status"`
	Level             int `json:"level"`
	NetWorth          int `json:"net_worth"`
	ScaledHeroDamage  int `json:"scaled_hero_damage"`
	ScaledHeroHealing int `json:"scaled_hero_healing"`
	ScaledTowerDamage int `json:"scaled_tower_damage"`
	TowerDamage       int `json:"tower_damage"`
	XPPerMin          int `json:"xp_per_min"`

	Kills   int `json:"kills"`
	Deaths  int `json:"deaths"`
	Assists int `json:"assists"`

	AbilityUpgrades []AbilityUpgrades `json:"ability_upgrades"`
}

type PlayerLite

type PlayerLite struct {
	AccountID *uint64 `json:"account_id"`

	PlayerSlot int `json:"player_slot"`

	TeamNumber int `json:"team_number"`
	TeamSlot   int `json:"team_slot"`

	HeroID int `json:"hero_id"`
}

Jump to

Keyboard shortcuts

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