Documentation
¶
Index ¶
Constants ¶
View Source
const NeverExpired = 0
Variables ¶
View Source
var ( ErrKeyAlreadyExists = errors.New("key already exists") ErrKeyNotExists = errors.New("key doesn't exists") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[T any] interface { Set(k string, v T, d time.Duration) Add(k string, v T, d time.Duration) error Replace(k string, v T, d time.Duration) error Get(k string) (T, bool) GetWithExpiration(k string) (T, time.Time, bool) Keys() []string Items() map[string]Item[T] Reset() ItemCount() int DeleteExpired() Delete(k string) }
Cache is the interface that represents common cache functionality.
Click to show internal directories.
Click to hide internal directories.