Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ItemPool is a pool of Item values. ItemPool = sync.Pool{ New: func() any { return &Item{} }, } )
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
Key string // key of the item
Value any // Value of the item
Size int64 // Size of the item, in bytes
Expiration time.Duration // Expiration duration of the item
LastAccess time.Time // LastAccess time of the item
AccessCount uint // AccessCount of times the item has been accessed
}
Item is a struct that represents an item in the cache. It has a key, value, expiration duration, and a last access time field.
Click to show internal directories.
Click to hide internal directories.