Documentation ¶
Index ¶
- func EnableCache() fx.Option
- func NewMemoryStore(properties MemoryCacheProperties) (store.StoreInterface, error)
- func NewRedisStore(properties RedisCacheProperties) (store.StoreInterface, error)
- func NewStore(properties *CacheProperties) (store.StoreInterface, error)
- type Cache
- func (c *Cache) AsyncSet(key string, value interface{}, duration time.Duration)
- func (c *Cache) Clear() error
- func (c *Cache) Delete(key string) error
- func (c *Cache) Exist(key string) bool
- func (c *Cache) Get(key string) (interface{}, error)
- func (c *Cache) Remember(key string, duration time.Duration, fn func() (interface{}, error)) (interface{}, error)
- func (c *Cache) Set(key string, value interface{}, duration time.Duration) error
- type CacheProperties
- type MemoryCacheProperties
- type RedisCacheProperties
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableCache ¶
func NewMemoryStore ¶
func NewMemoryStore(properties MemoryCacheProperties) (store.StoreInterface, error)
func NewRedisStore ¶
func NewRedisStore(properties RedisCacheProperties) (store.StoreInterface, error)
func NewStore ¶
func NewStore(properties *CacheProperties) (store.StoreInterface, error)
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewCache ¶
func NewCache(properties *CacheProperties) (*Cache, error)
type CacheProperties ¶
type CacheProperties struct { Driver string Memory MemoryCacheProperties Redis RedisCacheProperties }
CacheProperties represents ...
func NewCacheProperties ¶
func NewCacheProperties(loader config.Loader) (*CacheProperties, error)
NewCacheProperties return a new CacheProperties instance
func (*CacheProperties) Prefix ¶
func (t *CacheProperties) Prefix() string
Prefix return config prefix
Source Files ¶
Click to show internal directories.
Click to hide internal directories.