Skip to content

Instantly share code, notes, and snippets.

@Masum-Osman
Created July 4, 2022 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Masum-Osman/240713e4d3f03e9277d1e33370fde86a to your computer and use it in GitHub Desktop.
Save Masum-Osman/240713e4d3f03e9277d1e33370fde86a to your computer and use it in GitHub Desktop.
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