30 lines
616 B
Go
30 lines
616 B
Go
|
// Package cache ...
|
||
|
//
|
||
|
// Description : cache ...
|
||
|
//
|
||
|
// Author : go_developer@163.com<白茶清欢>
|
||
|
//
|
||
|
// Date : 2024-06-21 14:55
|
||
|
package cache
|
||
|
|
||
|
import (
|
||
|
cacheAbstract "git.zhangdeman.cn/zhangdeman/cache/abstract"
|
||
|
"git.zhangdeman.cn/zhangdeman/consts"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// GetCacheInstance 获取缓存实例
|
||
|
//
|
||
|
// Author : go_developer@163.com<白茶清欢>
|
||
|
//
|
||
|
// Date : 14:56 2024/6/21
|
||
|
func GetCacheInstance(cacheDriver string) cacheAbstract.ICache {
|
||
|
switch strings.ToLower(cacheDriver) {
|
||
|
case consts.CacheDriverRedis:
|
||
|
return RedisClient
|
||
|
case consts.CacheDriverGocache:
|
||
|
return GocacheClient
|
||
|
}
|
||
|
return nil
|
||
|
}
|