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
|
|
|
|
|
|
|
var ErrNilValue = errors.New("value is empty")
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|