Documentation
¶
Index ¶
- Variables
- func NewStorage() adapter.Storage
- func NewStorageWithCleanupInterval(interval time.Duration) adapter.Storage
- type Storage
- func (s *Storage) Clear() error
- func (s *Storage) Close() error
- func (s *Storage) Delete(keys ...string) error
- func (s *Storage) Exists(key string) bool
- func (s *Storage) Expire(key string, expiration time.Duration) error
- func (s *Storage) Get(key string) (any, error)
- func (s *Storage) Keys(pattern string) ([]string, error)
- func (s *Storage) Ping() error
- func (s *Storage) Set(key string, value any, expiration time.Duration) error
- func (s *Storage) TTL(key string) (time.Duration, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrKeyNotFound 键不存在错误 ErrKeyNotFound = errors.New("key not found") // ErrKeyExpired 键已过期错误 ErrKeyExpired = errors.New("key expired") )
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.