goploy/internal/cache/factory.go
2023-08-16 18:44:44 +08:00

38 lines
689 B
Go

package cache
import (
"github.com/zhenorzz/goploy/config"
"github.com/zhenorzz/goploy/internal/cache/memory"
)
const MemoryCache = "memory"
var cacheType = config.Toml.Cache.Type
func GetUserCache() User {
switch cacheType {
case MemoryCache:
return memory.GetUserCache()
default:
return memory.GetUserCache()
}
}
func GetCaptchaCache() Captcha {
switch cacheType {
case MemoryCache:
return memory.GetCaptchaCache()
default:
return memory.GetCaptchaCache()
}
}
func GetDingTalkAccessTokenCache() DingtalkAccessToken {
switch cacheType {
case MemoryCache:
return memory.GetDingTalkAccessTokenCache()
default:
return memory.GetDingTalkAccessTokenCache()
}
}