You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/api/internal/edge/cache/cache.go

27 lines
436 B

package cache
import (
"strconv"
"github.com/VictoriaMetrics/fastcache"
portainer "github.com/portainer/portainer/api"
)
var c = fastcache.New(1)
func key(k portainer.EndpointID) []byte {
return []byte(strconv.Itoa(int(k)))
}
func Set(k portainer.EndpointID, v []byte) {
c.Set(key(k), v)
}
func Get(k portainer.EndpointID) ([]byte, bool) {
return c.HasGet(nil, key(k))
}
func Del(k portainer.EndpointID) {
c.Del(key(k))
}