2021-05-13 11:49:38 +00:00
|
|
|
package cache
|
|
|
|
|
2021-05-14 18:21:13 +00:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"time"
|
|
|
|
)
|
2021-05-13 11:49:38 +00:00
|
|
|
|
2021-05-27 19:30:52 +00:00
|
|
|
var ErrNotFound = errors.New("key doesn't exist in cache")
|
2021-05-13 11:49:38 +00:00
|
|
|
|
|
|
|
type Cache interface {
|
|
|
|
Store(key string, value interface{}) error
|
2021-05-14 18:21:13 +00:00
|
|
|
StoreWithTTL(key string, value interface{}, ttl time.Duration) error
|
2021-05-13 11:49:38 +00:00
|
|
|
Get(key string, value interface{}) error
|
|
|
|
Delete(key string)
|
2021-05-31 19:24:07 +00:00
|
|
|
Items() map[string]interface{}
|
2021-05-13 11:49:38 +00:00
|
|
|
}
|