GetCacheJSON marshals cached data into JSON, calls GetCache to get the Cache struct.
(c *redis.Client)
| 63 | // GetCacheJSON marshals cached data into JSON, |
| 64 | // calls GetCache to get the Cache struct. |
| 65 | func GetCacheJSON(c *redis.Client) (string, error) { |
| 66 | cacheData, err := GetCache(c) |
| 67 | if err != nil { |
| 68 | return "", fmt.Errorf("get cache: %s", err) |
| 69 | } |
| 70 | |
| 71 | cacheJSON, err := json.Marshal(cacheData) |
| 72 | if err != nil { |
| 73 | return "", fmt.Errorf("marshal cache: %s", err) |
| 74 | |
| 75 | } |
| 76 | |
| 77 | return string(cacheJSON), nil |
| 78 | } |
no test coverage detected