func putInCache(connStr string, hash string, val []byte, expire int) { rConn, err := cache.RedisConn(connStr) if err == nil { cache.SetKey(rConn, hash, val, expire) defer rConn.Close() } }
func getFromCache(connStr string, hash string) []byte { rConn, err := cache.RedisConn(connStr) if err == nil { defer rConn.Close() r, err := cache.GetKey(rConn, hash) // if this is empty, r is a empty byte len(r) == 0 if err == nil { return r } } var b []byte return b }