From 05dddfd0b7b0ccc6f0a7aa429588e7e86ad23ef9 Mon Sep 17 00:00:00 2001 From: Joshua Raphael Date: Fri, 16 Aug 2024 10:32:00 -0700 Subject: [PATCH] update readme and doc comments for each endpoint --- README.md | 17 ++++++++++++++++- game.go | 4 ++-- user.go | 8 ++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index db4d610..fa17b82 100644 --- a/README.md +++ b/README.md @@ -37,4 +37,19 @@ you can now use the client to call any of the available endpoints, for example: profile, err := client.GetUserProfile("jamiras") ``` -Check out the [examples](examples/) directory for how to call each endpoint, as well as our GoDocs (TBD) \ No newline at end of file +Check out the [examples](examples/) directory for how to call each endpoint, as well as our GoDocs (TBD) + +## API +Click the function names to open their complete docs on the docs site. + +

User

+ +* [`GetUserProfile()`](https://api-docs.retroachievements.org/v1/get-user-profile.html) - Get a user's basic profile information. +* [`GetUserRecentAchievements()`](https://api-docs.retroachievements.org/v1/get-user-recent-achievements.html) - Get a list of achievements recently earned by the user. +* [`GetAchievementsEarnedBetween()`](https://api-docs.retroachievements.org/v1/get-achievements-earned-between.html) - Get a list of achievements earned by a user between two dates. +* [`GetAchievementsEarnedOnDay()`](https://api-docs.retroachievements.org/v1/get-achievements-earned-on-day.html) - Get a list of achievements earned by a user on a given date. + +

Game

+ +* [`GetGame()`](https://api-docs.retroachievements.org/v1/get-game.html) - Get basic metadata about a game. +* [`GetGameExtended()`](https://api-docs.retroachievements.org/v1/get-game-extended.html) - Get extended metadata about a game. \ No newline at end of file diff --git a/game.go b/game.go index 8f392aa..a9c075f 100644 --- a/game.go +++ b/game.go @@ -8,7 +8,7 @@ import ( "github.com/joshraphael/go-retroachievements/models" ) -// GetGame gets info of a game +// GetGame get basic metadata about a game. func (c *Client) GetGame(id int) (*models.GameInfo, error) { resp, err := c.do( raHttp.Method(http.MethodGet), @@ -26,7 +26,7 @@ func (c *Client) GetGame(id int) (*models.GameInfo, error) { return game, nil } -// GetGameExtended gets extended info of a game +// GetGameExtended get extended metadata about a game. func (c *Client) GetGameExtended(id int) (*models.ExtentedGameInfo, error) { resp, err := c.do( raHttp.Method(http.MethodGet), diff --git a/user.go b/user.go index 93a6b6d..c0cbd54 100644 --- a/user.go +++ b/user.go @@ -9,7 +9,7 @@ import ( "github.com/joshraphael/go-retroachievements/models" ) -// GetUserProfile gets the profile of a given username +// GetUserProfile get a user's basic profile information. func (c *Client) GetUserProfile(username string) (*models.Profile, error) { resp, err := c.do( raHttp.Method(http.MethodGet), @@ -27,7 +27,7 @@ func (c *Client) GetUserProfile(username string) (*models.Profile, error) { return profile, nil } -// GetUserRecentAchievements gets all achievements within the last specified amount of minutes for a given username +// GetUserRecentAchievements get a list of achievements recently earned by the user. func (c *Client) GetUserRecentAchievements(username string, lookbackMinutes int) ([]models.UnlockedAchievement, error) { resp, err := c.do( raHttp.Method(http.MethodGet), @@ -46,7 +46,7 @@ func (c *Client) GetUserRecentAchievements(username string, lookbackMinutes int) return achievements, nil } -// GetAchievementsEarnedBetween gets all achievements earned within a time frame for a given username +// GetAchievementsEarnedBetween get a list of achievements earned by a user between two dates. func (c *Client) GetAchievementsEarnedBetween(username string, from time.Time, to time.Time) ([]models.UnlockedAchievement, error) { resp, err := c.do( raHttp.Method(http.MethodGet), @@ -66,7 +66,7 @@ func (c *Client) GetAchievementsEarnedBetween(username string, from time.Time, t return achievements, nil } -// GetAchievementsEarnedOnDay gets all achievements earned on a specific day for a given username +// GetAchievementsEarnedOnDay get a list of achievements earned by a user on a given date. func (c *Client) GetAchievementsEarnedOnDay(username string, date time.Time) ([]models.UnlockedAchievement, error) { resp, err := c.do( raHttp.Method(http.MethodGet),