Ai
1 Star 1 Fork 0

Ethan/gcache

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gcache.go 813 Bytes
一键复制 编辑 原始数据 按行查看 历史
fusikai 提交于 2019-11-01 18:22 +08:00 . save for redis client
package gcache
import (
"github.com/linthan/gcache/internal"
"github.com/linthan/gcache/option"
"github.com/jinzhu/gorm"
)
// Plugin .
type Plugin interface {
//清库
FlushDB() error
//删除模型缓存
DeleteModel(model interface{}, primarys ...interface{}) error
//删除查询缓存
DeleteSearch(model interface{}) error
//insert select update delete 都会跳过缓存处理
SkipCache() *gorm.DB
//join 和 子查询, 需要传入模型。
CreateRelative(...interface{}) *gorm.DB
SetRelative(*gorm.DB, ...interface{}) *gorm.DB
//tag
CreateTag(...interface{}) *gorm.DB
SetTag(*gorm.DB, ...interface{}) *gorm.DB
Debug()
}
// AttachDB .
func AttachDB(db *gorm.DB, opt *option.DefaultOption, redisOption *option.RedisOption) Plugin {
return internal.InjectGorm(db, opt, redisOption)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/melican/gcache.git
git@gitee.com:melican/gcache.git
melican
gcache
gcache
master

搜索帮助