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) 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
- 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) 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
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
}
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) Init ¶
func (m *MemoryLayer) Init(conf *config.CacheConfig, prefix string) error
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) Init ¶
func (r *RedisLayer) Init(conf *config.CacheConfig, prefix string) error
Click to show internal directories.
Click to hide internal directories.