This commit is contained in:
史悦
2025-08-13 19:03:20 +08:00
commit d62a2e9ed9
73 changed files with 7296 additions and 0 deletions

25
internal/cache/operation.go vendored Normal file
View File

@@ -0,0 +1,25 @@
package cache
var cache Cacheable
func init() {
cache = NewMemoryMap()
// 已废弃redis缓存实现
/*host := os.Getenv("REDIS_HOST")
port := os.Getenv("REDIS_PORT")
psw := os.Getenv("REDIS_PASSWORD")
cache = NewRedisInstance(host, port, psw)*/
}
func Set(key string, value interface{}, ttl int) error {
return cache.Set(key, value, ttl)
}
func Get(key string) (interface{}, error) {
return cache.Get(key)
}
func Exist(key string) (bool, error) {
return cache.Exist(key)
}
func Del(key string) error {
return cache.Del(key)
}