Created
July 4, 2022 10:11
-
-
Save Masum-Osman/240713e4d3f03e9277d1e33370fde86a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
redisKey := bucketName + `/` + path | |
fromCache, err := redisService.GetValue(redisKey) | |
if err != nil { | |
errResponse.Status = "failed" | |
errResponse.ErrorMessage = err.Error() | |
c.Data["json"] = errResponse | |
c.ServeJSON() | |
return | |
} | |
if len(fromCache) != 0 { | |
c.Data["json"] = fromCache | |
c.ServeJSON() | |
} else { | |
/* | |
This key doesn't exits. So we have to make V4 URL from google. | |
And then we must save them in Redis too. | |
SetValue(key, value) | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment