MCPcopy Create free account
hub / github.com/ebosas/microservices / GetCacheJSON

Function GetCacheJSON

internal/cache/cache.go:65–78  ·  view source on GitHub ↗

GetCacheJSON marshals cached data into JSON, calls GetCache to get the Cache struct.

(c *redis.Client)

Source from the content-addressed store, hash-verified

63// GetCacheJSON marshals cached data into JSON,
64// calls GetCache to get the Cache struct.
65func 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}

Callers 1

handleAPICacheFunction · 0.92

Calls 1

GetCacheFunction · 0.85

Tested by

no test coverage detected