Documentation
¶
Index ¶
- func Delete(key interface{}) error
- func Get(key interface{}) (interface{}, error)
- func GetStore() store.StoreInterface
- func GetType() string
- func GetWithTTL(key interface{}) (interface{}, time.Duration, error)
- func InitCache(store store.StoreInterface)
- func Set(key interface{}, val interface{}, expiration time.Duration) error
- type Cache
- func (c *Cache) Clear() error
- func (c *Cache) Delete(key interface{}) error
- func (c *Cache) Get(key interface{}) (interface{}, error)
- func (c *Cache) GetStore() store.StoreInterface
- func (c *Cache) GetType() string
- func (c *Cache) GetWithTTL(key interface{}) (interface{}, time.Duration, error)
- func (c *Cache) Set(key interface{}, val interface{}, expiration time.Duration) error
- type CacheInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWithTTL ¶
根据key获取value和value在缓存的有限期。
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func New ¶
func New(store store.StoreInterface) *Cache
func (*Cache) GetStore ¶
func (c *Cache) GetStore() store.StoreInterface
func (*Cache) GetWithTTL ¶
type CacheInterface ¶
type CacheInterface interface {
store.StoreInterface
GetStore() store.StoreInterface
}
Directories
¶
| Path | Synopsis |
|---|---|
|
test
|
|
|
mocks/store
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
mocks/store/clients
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.