Documentation
¶
Index ¶
- 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) FlushAll(ctx context.Context) error
- func (m *MockZCache) Get(ctx context.Context, key string, data interface{}) error
- 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) 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{}, expiration time.Duration) error
- type MockZMutex
- type RemoteCache
- type RemoteConfig
- type ZCache
- type ZMutex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 {
EvictionInSeconds int
}
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
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 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) FlushAll(ctx context.Context) error Exists(ctx context.Context, keys ...string) (int64, 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 }
func (*RemoteConfig) ToRedisConfig ¶ added in v0.10.1
func (c *RemoteConfig) ToRedisConfig() *redis.Options
Click to show internal directories.
Click to hide internal directories.