Documentation ¶
Index ¶
- func NewCache(store contracts.Store, sf *singleflight.Group) contracts.CacheInterface
- func NewDBStore(db func() *gorm.DB) contracts.Store
- func NewMetricsForCache(c contracts.CacheInterface) contracts.CacheInterface
- type Cache
- func (c *Cache) Clear(key contracts.CacheKeyInterface) error
- func (c *Cache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)
- func (c *Cache) SetWithTTL(key contracts.CacheKeyInterface, value []byte, seconds int) error
- func (c *Cache) Store() contracts.Store
- type Key
- type MetricsForCache
- func (m *MetricsForCache) Clear(key contracts.CacheKeyInterface) error
- func (m *MetricsForCache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)
- func (m *MetricsForCache) SetWithTTL(key contracts.CacheKeyInterface, value []byte, seconds int) error
- func (m *MetricsForCache) Store() contracts.Store
- type NoCache
- func (n *NoCache) Clear(key contracts.CacheKeyInterface) error
- func (n *NoCache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)
- func (n *NoCache) SetWithTTL(key contracts.CacheKeyInterface, value []byte, seconds int) error
- func (n *NoCache) Store() contracts.Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCache ¶
func NewCache(store contracts.Store, sf *singleflight.Group) contracts.CacheInterface
func NewMetricsForCache ¶
func NewMetricsForCache(c contracts.CacheInterface) contracts.CacheInterface
NewMetricsForCache impl contracts.CacheInterface
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Remember ¶
func (c *Cache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)
Remember TODO
func (*Cache) SetWithTTL ¶
SetWithTTL TODO
type MetricsForCache ¶
type MetricsForCache struct {
Cache contracts.CacheInterface
}
func (*MetricsForCache) Clear ¶
func (m *MetricsForCache) Clear(key contracts.CacheKeyInterface) error
Clear TODO.
func (*MetricsForCache) Remember ¶
func (m *MetricsForCache) Remember(key contracts.CacheKeyInterface, seconds int, fn func() ([]byte, error)) ([]byte, error)
Remember TODO.
func (*MetricsForCache) SetWithTTL ¶
func (m *MetricsForCache) SetWithTTL(key contracts.CacheKeyInterface, value []byte, seconds int) error
SetWithTTL TODO.
func (*MetricsForCache) Store ¶ added in v4.19.7
func (m *MetricsForCache) Store() contracts.Store
Store TODO.
Click to show internal directories.
Click to hide internal directories.