-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteamAPI.go
79 lines (70 loc) · 2.86 KB
/
steamAPI.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package common
// SteamAPIResponse is the response from the steam web API
// for /getPlayerSummary calls
type SteamAPIResponse struct {
Response Response `json:"response"`
}
// Response is filler that the steam web API includes
type Response struct {
Players []Player `json:"players"`
}
// Player holds all details for a given user returned by the steam web API for
// the /getPlayerSummary endpoint
type Player struct {
Steamid string `json:"steamid"`
Communityvisibilitystate int `json:"communityvisibilitystate"`
Profilestate int `json:"profilestate"`
Personaname string `json:"personaname"`
Commentpermission int `json:"commentpermission"`
Profileurl string `json:"profileurl"`
Avatar string `json:"avatar"`
Avatarmedium string `json:"avatarmedium"`
Avatarfull string `json:"avatarfull"`
Avatarhash string `json:"avatarhash"`
Personastate int `json:"personastate"`
Realname string `json:"realname"`
Primaryclanid string `json:"primaryclanid"`
Timecreated int `json:"timecreated"`
Personastateflags int `json:"personastateflags"`
Loccountrycode string `json:"loccountrycode"`
}
type UserDetails struct {
SteamID int64 `json:"steamID"`
Friends Friendslist `json:"friendsList"`
}
// FriendsList holds all friends for a given user
type Friendslist struct {
Friends []Friend `json:"friends"`
}
// Friend is profile information returned for each friend by
// the steam web API for /getFriendsList calls
type Friend struct {
Username string `json:"username"`
Steamid string `json:"steamid"`
Relationship string `json:"relationship"`
FriendSince int `json:"friend_since"`
}
// GamesOwnedSteamResponse is the response from the steam web API
// for /getOwnedGames calls
type GamesOwnedSteamResponse struct {
Response GamesOwnedResponse `json:"response"`
}
// GamesOwnedResponse is filler returned by the steam web API
type GamesOwnedResponse struct {
GameCount int `json:"game_count"`
Games []Game `json:"games"`
}
// Game is returned by the steam web API for each game
// from calls to /getOwnedGames
type Game struct {
Appid int `json:"appid"`
Name string `json:"name"`
PlaytimeForever int `json:"playtime_forever"`
ImgIconURL string `json:"img_icon_url"`
ImgLogoURL string `json:"img_logo_url"`
PlaytimeWindowsForever int `json:"playtime_windows_forever,omitempty"`
PlaytimeMacForever int `json:"playtime_mac_forever,omitempty"`
PlaytimeLinuxForever int `json:"playtime_linux_forever,omitempty"`
HasCommunityVisibleStats bool `json:"has_community_visible_stats,omitempty"`
Playtime2Weeks int `json:"playtime_2weeks,omitempty"`
}