feat: add instances handler

This commit is contained in:
rramiachraf
2024-03-06 12:01:04 +01:00
parent 53462a9412
commit 6d6ffa16ff
6 changed files with 73 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package handlers
import (
"context"
"encoding/json"
"time"
@ -9,10 +10,10 @@ import (
)
type cachable interface {
data.Album | data.Song | data.Annotation
data.Album | data.Song | data.Annotation | []byte
}
var c, _ = bigcache.NewBigCache(bigcache.DefaultConfig(time.Hour * 24))
var c, _ = bigcache.New(context.Background(), bigcache.DefaultConfig(time.Hour*24))
func setCache(key string, entry interface{}) error {
data, err := json.Marshal(&entry)