gotoolkit/model/cache.go
2025-03-23 20:59:57 +01:00

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()