18 lines
386 B
Go
18 lines
386 B
Go
package model
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var ErrCacheKeyDontExist = errors.New("cache key don't exist")
|
|
|
|
type Cache interface {
|
|
Get(key string) (any, error)
|
|
GetWithOptions(key string, opts ...CacheGetOption)
|
|
Set(key string, value any) error
|
|
SetWithOptions(key string, value any, opts ...CacheSetOption)
|
|
Delete(key string) error
|
|
}
|
|
|
|
type CacheGetOption func()
|
|
type CacheSetOption func()
|