Skip to content

v1.2.2

Latest
Compare
Choose a tag to compare
@donnie4w donnie4w released this 18 Oct 12:21

version 1.2.2
Add BindExpireWriteClass , BindExpireWriteClassWithCacheHandle

增加写过期缓存,作用是:如果绑定结构体发生增删改操作,缓存数据将被清除
gdaoCache.BindExpireWriteClass[dao.Hstest]()
gdaoCache.BindExpireWriteClassWithCacheHandle[dao.Hstest](gdaoCache.NewCacheHandle().SetExpire(100).SetStoreMode(gdaoCache.STRONG))
gdaoCache.BindExpireWriteClass[dao.Hstest]()

//设置缓存数据
hs := dao.NewHstest()
hs.Where((hs.ID.Between(0, 2)).Or(hs.ID.Between(10, 15))).Selects()  

//获取缓存数据
hs := dao.NewHstest()
hs.Where((hs.ID.Between(0, 2)).Or(hs.ID.Between(10, 15))).Selects() 


hs = dao.NewHstest()
hs.OrderBy(hs.ID.Desc()).Limit(1)
hs, _ = hs.Select()
hs.Insert() //新增数据触发清除缓存操作