mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-07-17 16:48:24 +00:00
cache user comments
This commit is contained in:
parent
52dbf0195d
commit
8bb1ab0810
@ -103,6 +103,11 @@ func (client *Client) FetchSubmissions(username string, sort string, page string
|
||||
}
|
||||
|
||||
func (client *Client) FetchUserComments(username string, page string) ([]Comment, error) {
|
||||
cacheData, found := client.Cache.Get(username + "-usercomments-" + page)
|
||||
if found {
|
||||
return cacheData.([]Comment), nil
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("GET", "https://api.imgur.com/comment/v1/comments", nil)
|
||||
if err != nil {
|
||||
return []Comment{}, err
|
||||
|
Loading…
Reference in New Issue
Block a user