Documentation
¶
Index ¶
- func NewLevel2Cache(appCtx fiberhouse.IContext, local cache.Cache, remote cache.Cache) cache.Cache
- type Level2Cache
- func (l2c *Level2Cache) Close() error
- func (l2c *Level2Cache) Delete(ctx context.Context, keys ...string) error
- func (l2c *Level2Cache) Get(ctx context.Context, key string, co *cache.CacheOption) (string, error)
- func (l2c *Level2Cache) GetLevel() cache.Level
- func (l2c *Level2Cache) GetLocal() cache.Cache
- func (l2c *Level2Cache) GetLocalMetrics(co *cache.CacheOption) *ristretto.Metrics
- func (l2c *Level2Cache) GetLocalMetricsInfo(co *cache.CacheOption) *cachelocal.CacheMetricsInfo
- func (l2c *Level2Cache) GetPoolMetrics() map[string]interface{}
- func (l2c *Level2Cache) GetRemote() cache.Cache
- func (l2c *Level2Cache) Set(ctx context.Context, key string, value interface{}, co *cache.CacheOption) error
- func (l2c *Level2Cache) Wait() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLevel2Cache ¶
Types ¶
type Level2Cache ¶
type Level2Cache struct {
Ctx fiberhouse.IContext
// contains filtered or unexported fields
}
Level2Cache 二级缓存实现(本地+远程)
func (*Level2Cache) Close ¶
func (l2c *Level2Cache) Close() error
Close 关闭缓存实例,释放资源(应用退出时调用Close关闭资源)
func (*Level2Cache) Delete ¶
func (l2c *Level2Cache) Delete(ctx context.Context, keys ...string) error
Delete 删除缓存值
func (*Level2Cache) Get ¶
func (l2c *Level2Cache) Get(ctx context.Context, key string, co *cache.CacheOption) (string, error)
Get 获取缓存值
func (*Level2Cache) GetLocalMetrics ¶
func (l2c *Level2Cache) GetLocalMetrics(co *cache.CacheOption) *ristretto.Metrics
GetLocalMetrics 获取本地缓存指标
func (*Level2Cache) GetLocalMetricsInfo ¶
func (l2c *Level2Cache) GetLocalMetricsInfo(co *cache.CacheOption) *cachelocal.CacheMetricsInfo
GetLocalMetricsInfo 获取本地缓存指标
func (*Level2Cache) GetPoolMetrics ¶
func (l2c *Level2Cache) GetPoolMetrics() map[string]interface{}
GetPoolMetrics 获取goroutine池指标
func (*Level2Cache) Set ¶
func (l2c *Level2Cache) Set(ctx context.Context, key string, value interface{}, co *cache.CacheOption) error
Set 设置缓存值
Click to show internal directories.
Click to hide internal directories.