-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f5ac2d
commit 856a97d
Showing
7 changed files
with
229 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Package getuserawards provides an example for getting a users awards | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/joshraphael/go-retroachievements" | ||
) | ||
|
||
/* | ||
Test script, add RA_API_KEY to your env and use `go run getuserawards.go` | ||
*/ | ||
func main() { | ||
secret := os.Getenv("RA_API_KEY") | ||
|
||
client := retroachievements.NewClient(secret) | ||
|
||
resp, err := client.GetUserAwards("jamiras") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
fmt.Printf("%+v\n", resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package models | ||
|
||
type UserAwards struct { | ||
TotalAwardsCount int `json:"TotalAwardsCount"` | ||
HiddenAwardsCount int `json:"HiddenAwardsCount"` | ||
MasteryAwardsCount int `json:"MasteryAwardsCount"` | ||
CompletionAwardsCount int `json:"CompletionAwardsCount"` | ||
BeatenHardcoreAwardsCount int `json:"BeatenHardcoreAwardsCount"` | ||
BeatenSoftcoreAwardsCount int `json:"BeatenSoftcoreAwardsCount"` | ||
EventAwardsCount int `json:"EventAwardsCount"` | ||
SiteAwardsCount int `json:"SiteAwardsCount"` | ||
VisibleUserAwards []Award `json:"VisibleUserAwards"` | ||
} | ||
|
||
type Award struct { | ||
AwardedAt RFC3339NumColonTZ `json:"AwardedAt"` | ||
AwardType string `json:"AwardType"` | ||
AwardData int `json:"AwardData"` | ||
AwardDataExtra int `json:"AwardDataExtra"` | ||
DisplayOrder int `json:"DisplayOrder"` | ||
Title *string `json:"Title"` | ||
ConsoleID *int `json:"ConsoleID"` | ||
ConsoleName *string `json:"ConsoleName"` | ||
Flags *int `json:"Flags"` | ||
ImageIcon *string `json:"ImageIcon"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters