Documentation ¶
Index ¶
- func Clear(cache Cache) error
- func Delete(cache Cache, key string) error
- func Get[T any](cache Cache, key string) (T, error)
- func GetAll(cache Cache) (map[string]string, error)
- func GetMulti(cache Cache, keys []string) (map[string]string, error)
- func Set(cache Cache, key string, value any, expireSec int64) error
- type Cache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { // Set 设置缓存值 Set(key string, value string, expireSec int64) error // Get 获取缓存值 Get(key string) (string, error) // GetMulti 获取多个缓存值 GetMulti(keys []string) (map[string]string, error) // GetAll 获取所有缓存值 GetAll() (map[string]string, error) // Delete 删除缓存值 Delete(key string) error // Clear 清除缓存 Clear() error }
Cache 缓存基础设施接口
Click to show internal directories.
Click to hide internal directories.