Documentation
¶
Index ¶
- type DataLayerInterface
- type MemoryLayer
- func (m *MemoryLayer) BatchDeleteKeys(ctx context.Context, keys []string) error
- func (m *MemoryLayer) BatchGetValues(ctx context.Context, keys []string) ([]string, error)
- func (m *MemoryLayer) BatchKeyExist(ctx context.Context, keys []string) (bool, error)
- func (m *MemoryLayer) BatchSetKeys(ctx context.Context, kvs []util.Kv) error
- func (m *MemoryLayer) CleanCache(ctx context.Context) error
- func (m *MemoryLayer) DeleteKey(ctx context.Context, key string) error
- func (m *MemoryLayer) DeleteKeysWithPrefix(ctx context.Context, keyPrefix string) error
- func (m *MemoryLayer) GetPrimaryCacheTTLByKey(ctx context.Context, primaryKey string) float64
- func (m *MemoryLayer) GetTTL() int64
- func (m *MemoryLayer) GetValue(ctx context.Context, key string) (string, error)
- func (m *MemoryLayer) Init(conf *config.CacheConfig, prefix string) error
- func (m *MemoryLayer) KeyExists(ctx context.Context, key string) (bool, error)
- func (m *MemoryLayer) SetKey(ctx context.Context, kv util.Kv) error
- func (m *MemoryLayer) SetTTL(ttl int64)
- type RedisLayer
- func (r *RedisLayer) BatchDeleteKeys(ctx context.Context, keys []string) error
- func (r *RedisLayer) BatchGetValues(ctx context.Context, keys []string) ([]string, error)
- func (r *RedisLayer) BatchKeyExist(ctx context.Context, keys []string) (bool, error)
- func (r *RedisLayer) BatchSetKeys(ctx context.Context, kvs []util.Kv) error
- func (r *RedisLayer) CleanCache(ctx context.Context) error
- func (r *RedisLayer) DeleteKey(ctx context.Context, key string) error
- func (r *RedisLayer) DeleteKeysWithPrefix(ctx context.Context, keyPrefix string) error
- func (r *RedisLayer) GetPrimaryCacheTTLByKey(ctx context.Context, primaryKey string) float64
- func (r *RedisLayer) GetTTL() int64
- func (r *RedisLayer) GetValue(ctx context.Context, key string) (string, error)
- func (r *RedisLayer) Init(conf *config.CacheConfig, prefix string) error
- func (r *RedisLayer) KeyExists(ctx context.Context, key string) (bool, error)
- func (r *RedisLayer) SetKey(ctx context.Context, kv util.Kv) error
- func (r *RedisLayer) SetTTL(ttl int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataLayerInterface ¶
type DataLayerInterface interface { Init(config *config.CacheConfig, prefix string) error // read BatchKeyExist(ctx context.Context, keys []string) (bool, error) KeyExists(ctx context.Context, key string) (bool, error) GetValue(ctx context.Context, key string) (string, error) BatchGetValues(ctx context.Context, keys []string) ([]string, error) // write CleanCache(ctx context.Context) error DeleteKeysWithPrefix(ctx context.Context, keyPrefix string) error DeleteKey(ctx context.Context, key string) error BatchDeleteKeys(ctx context.Context, keys []string) error BatchSetKeys(ctx context.Context, kvs []util.Kv) error SetKey(ctx context.Context, kv util.Kv) error SetTTL(ttl int64) GetTTL() int64 GetPrimaryCacheTTLByKey(ctx context.Context, primaryKey string) float64 }
type MemoryLayer ¶
type MemoryLayer struct {
// contains filtered or unexported fields
}
func (*MemoryLayer) BatchDeleteKeys ¶
func (m *MemoryLayer) BatchDeleteKeys(ctx context.Context, keys []string) error
func (*MemoryLayer) BatchGetValues ¶
func (*MemoryLayer) BatchKeyExist ¶
func (*MemoryLayer) BatchSetKeys ¶
func (*MemoryLayer) CleanCache ¶
func (m *MemoryLayer) CleanCache(ctx context.Context) error
func (*MemoryLayer) DeleteKey ¶
func (m *MemoryLayer) DeleteKey(ctx context.Context, key string) error
func (*MemoryLayer) DeleteKeysWithPrefix ¶
func (m *MemoryLayer) DeleteKeysWithPrefix(ctx context.Context, keyPrefix string) error
func (*MemoryLayer) GetPrimaryCacheTTLByKey ¶ added in v1.2.5
func (m *MemoryLayer) GetPrimaryCacheTTLByKey(ctx context.Context, primaryKey string) float64
func (*MemoryLayer) GetTTL ¶ added in v1.2.3
func (m *MemoryLayer) GetTTL() int64
func (*MemoryLayer) Init ¶
func (m *MemoryLayer) Init(conf *config.CacheConfig, prefix string) error
func (*MemoryLayer) SetTTL ¶ added in v1.2.0
func (m *MemoryLayer) SetTTL(ttl int64)
type RedisLayer ¶
type RedisLayer struct {
// contains filtered or unexported fields
}
func (*RedisLayer) BatchDeleteKeys ¶
func (r *RedisLayer) BatchDeleteKeys(ctx context.Context, keys []string) error
func (*RedisLayer) BatchGetValues ¶
func (*RedisLayer) BatchKeyExist ¶
func (*RedisLayer) BatchSetKeys ¶
func (*RedisLayer) CleanCache ¶
func (r *RedisLayer) CleanCache(ctx context.Context) error
func (*RedisLayer) DeleteKey ¶
func (r *RedisLayer) DeleteKey(ctx context.Context, key string) error
func (*RedisLayer) DeleteKeysWithPrefix ¶
func (r *RedisLayer) DeleteKeysWithPrefix(ctx context.Context, keyPrefix string) error
func (*RedisLayer) GetPrimaryCacheTTLByKey ¶ added in v1.2.5
func (r *RedisLayer) GetPrimaryCacheTTLByKey(ctx context.Context, primaryKey string) float64
func (*RedisLayer) GetTTL ¶ added in v1.2.3
func (r *RedisLayer) GetTTL() int64
func (*RedisLayer) Init ¶
func (r *RedisLayer) Init(conf *config.CacheConfig, prefix string) error
func (*RedisLayer) SetTTL ¶ added in v1.2.0
func (r *RedisLayer) SetTTL(ttl int64)
Click to show internal directories.
Click to hide internal directories.