go_dreamfactory/lego/sys/cachego/item.go
2022-06-07 20:18:22 +08:00

20 lines
286 B
Go

package cachego
import "time"
type keyAndValue struct {
key string
value interface{}
}
type Item struct {
Object interface{}
Expiration int64
}
func (item Item) Expired() bool {
if item.Expiration == 0 {
return false
}
return time.Now().UnixNano() > item.Expiration
}