实现缓存策略的部分功能

This commit is contained in:
GoEdgeLab
2020-10-04 14:30:42 +08:00
parent 1bea7d00be
commit 925d13466d
17 changed files with 1751 additions and 2 deletions

14
internal/caches/item.go Normal file
View File

@@ -0,0 +1,14 @@
package caches
import "time"
type Item struct {
Key string
ExpiredAt int64
ValueSize int64
Size int64
}
func (this *Item) IsExpired() bool {
return this.ExpiredAt < time.Now().Unix()
}