mydb/internal/cache/interface.go
2023-09-18 15:15:42 +08:00

14 lines
308 B
Go

package cache
// Hashable types must implement a method that returns a key. This key will be
// associated with a cached value.
type Hashable interface {
Hash() uint64
}
// HasOnEvict type is (optionally) implemented by cache objects to clean after
// themselves.
type HasOnEvict interface {
OnEvict()
}