fork from codeberg.org

This commit is contained in:
“xHuPo” 2024-09-12 18:35:01 +08:00
commit 50a258ea59
67 changed files with 4587 additions and 0 deletions

10
server/cache/interface.go vendored Normal file
View file

@ -0,0 +1,10 @@
package cache
import "time"
// ICache is an interface that defines how the pages server interacts with the cache.
type ICache interface {
Set(key string, value interface{}, ttl time.Duration) error
Get(key string) (interface{}, bool)
Remove(key string)
}

7
server/cache/memory.go vendored Normal file
View file

@ -0,0 +1,7 @@
package cache
import "github.com/OrlovEvgeny/go-mcache"
func NewInMemoryCache() ICache {
return mcache.New()
}