type Cache interface {
// Get KVS of this cache. Note: Kvs may not actually store data.// It's depends on the cache policy. Caller must avoid rely on this Kvs as// a regular storage.
Kvs() kv_kvs.Kvs
}
type Controller interface {
// Startup cache controller. Broken or expired caches will be evicted on startup. Startup() error// Shutdown caches Shutdown()
// Get or create new cache Cache(namespace, name string) (cache Cache)
}
type Info struct {
Version int `json:"version"`
Namespace string `json:"namespace"`
Name string `json:"name"`
Expire time.Time `json:"expire"`
Last time.Time `json:"last"`
}
type Lifecycle interface {
Cache// Open cache Open() error// Evict this cache if required (e.g. timeout) EvictIfRequired()
// Flush and close this cache Close()
}