Documentation ¶
Index ¶
- Constants
- type CacheItem
- type CleanupProcess
- type CombinedCache
- type CombinedConfig
- type CustomZ
- type LocalCache
- type LocalConfig
- type MockZCache
- func (m *MockZCache) Decr(ctx context.Context, key string) (int64, error)
- func (m *MockZCache) Delete(ctx context.Context, key string) error
- func (m *MockZCache) Exists(ctx context.Context, keys ...string) (int64, error)
- func (m *MockZCache) Expire(ctx context.Context, key string, ttl time.Duration) (bool, error)
- func (m *MockZCache) FlushAll(ctx context.Context) error
- func (m *MockZCache) Get(ctx context.Context, key string, data interface{}) error
- func (m *MockZCache) GetStats() ZCacheStats
- func (m *MockZCache) HGet(ctx context.Context, key, field string) (string, error)
- func (m *MockZCache) HSet(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (m *MockZCache) Incr(ctx context.Context, key string) (int64, error)
- func (m *MockZCache) IsNotFoundError(err error) bool
- func (m *MockZCache) LPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (m *MockZCache) RPush(ctx context.Context, key string, values ...interface{}) (int64, error)
- func (m *MockZCache) SAdd(ctx context.Context, key string, members ...interface{}) (int64, error)
- func (m *MockZCache) SMembers(ctx context.Context, key string) ([]string, error)
- func (m *MockZCache) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
- func (m *MockZCache) SetupAndMonitorMetrics(appName string, metricsServer metrics.TaskMetrics, ...) []error
- func (m *MockZCache) TTL(ctx context.Context, key string) (time.Duration, error)
- func (m *MockZCache) ZIncrBy(ctx context.Context, key string, member string, increment float64) (float64, error)
- func (m *MockZCache) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]CustomZ, error)
- type MockZMutex
- type RedisStats
- type RemoteCache
- type RemoteConfig
- type StatsMetrics
- type ZCache
- type ZCacheStats
- type ZMutex
Constants ¶
View Source
const KeySplitter = "/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupProcess ¶ added in v0.17.1
type CombinedCache ¶ added in v0.11.0
type CombinedCache interface { ZCache }
func NewCombinedCache ¶ added in v0.11.0
func NewCombinedCache(combinedConfig *CombinedConfig) (CombinedCache, error)
type CombinedConfig ¶ added in v0.11.0
type CombinedConfig struct { Local *LocalConfig Remote *RemoteConfig GlobalLogger *logger.Logger GlobalPrefix string GlobalMetricServer metrics.TaskMetrics GlobalStatsMetrics StatsMetrics IsRemoteBestEffort bool }
type LocalCache ¶ added in v0.10.1
type LocalCache interface { ZCache }
func NewLocalCache ¶ added in v0.10.1
func NewLocalCache(config *LocalConfig) (LocalCache, error)
type LocalConfig ¶ added in v0.10.1
type LocalConfig struct { Prefix string Logger *logger.Logger MetricServer metrics.TaskMetrics StatsMetrics StatsMetrics CleanupProcess CleanupProcess }
func (*LocalConfig) ToBigCacheConfig ¶ added in v0.10.1
func (c *LocalConfig) ToBigCacheConfig() bigcache.Config
type MockZCache ¶
func (*MockZCache) Get ¶
func (m *MockZCache) Get(ctx context.Context, key string, data interface{}) error
func (*MockZCache) GetStats ¶ added in v0.14.2
func (m *MockZCache) GetStats() ZCacheStats
func (*MockZCache) IsNotFoundError ¶ added in v0.14.2
func (m *MockZCache) IsNotFoundError(err error) bool
func (*MockZCache) SetupAndMonitorMetrics ¶ added in v0.14.2
func (m *MockZCache) SetupAndMonitorMetrics(appName string, metricsServer metrics.TaskMetrics, updateInterval time.Duration) []error
func (*MockZCache) ZRevRangeWithScores ¶ added in v0.17.0
type MockZMutex ¶
func (*MockZMutex) Lock ¶
func (m *MockZMutex) Lock() error
func (*MockZMutex) Name ¶
func (m *MockZMutex) Name() string
func (*MockZMutex) Unlock ¶
func (m *MockZMutex) Unlock() (bool, error)
type RedisStats ¶ added in v0.11.0
type RedisStats struct {
Pool *redis.PoolStats
}
type RemoteCache ¶ added in v0.10.1
type RemoteCache interface { ZCache Incr(ctx context.Context, key string) (int64, error) Decr(ctx context.Context, key string) (int64, error) LPush(ctx context.Context, key string, values ...interface{}) (int64, error) RPush(ctx context.Context, key string, values ...interface{}) (int64, error) SMembers(ctx context.Context, key string) ([]string, error) SAdd(ctx context.Context, key string, members ...interface{}) (int64, error) HSet(ctx context.Context, key string, values ...interface{}) (int64, error) HGet(ctx context.Context, key, field string) (string, error) ZIncrBy(ctx context.Context, key string, member string, increment float64) (float64, error) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]CustomZ, error) FlushAll(ctx context.Context) error Exists(ctx context.Context, keys ...string) (int64, error) Expire(ctx context.Context, key string, ttl time.Duration) (bool, error) TTL(ctx context.Context, key string) (time.Duration, error) }
func NewRemoteCache ¶ added in v0.10.1
func NewRemoteCache(config *RemoteConfig) (RemoteCache, error)
type RemoteConfig ¶ added in v0.10.1
type RemoteConfig struct { Network string Addr string Password string DB int DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration PoolSize int MinIdleConns int MaxConnAge time.Duration PoolTimeout time.Duration IdleTimeout time.Duration IdleCheckFrequency time.Duration Prefix string Logger *logger.Logger MetricServer metrics.TaskMetrics StatsMetrics StatsMetrics }
func (*RemoteConfig) ToRedisConfig ¶ added in v0.10.1
func (c *RemoteConfig) ToRedisConfig() *redis.Options
type StatsMetrics ¶ added in v0.17.1
type ZCacheStats ¶ added in v0.11.0
type ZCacheStats struct { Local *bigcache.Stats Remote *RedisStats }
Click to show internal directories.
Click to hide internal directories.