data_layer

package
v0.0.0-...-bd9b198 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 (m *MemoryLayer) BatchGetValues(ctx context.Context, keys []string) ([]string, error)

func (*MemoryLayer) BatchKeyExist

func (m *MemoryLayer) BatchKeyExist(ctx context.Context, keys []string) (bool, error)

func (*MemoryLayer) BatchSetKeys

func (m *MemoryLayer) BatchSetKeys(ctx context.Context, kvs []util.Kv) error

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) GetValue

func (m *MemoryLayer) GetValue(ctx context.Context, key string) (string, error)

func (*MemoryLayer) Init

func (m *MemoryLayer) Init(conf *config.CacheConfig, prefix string) error

func (*MemoryLayer) KeyExists

func (m *MemoryLayer) KeyExists(ctx context.Context, key string) (bool, error)

func (*MemoryLayer) SetKey

func (m *MemoryLayer) SetKey(ctx context.Context, kv util.Kv) 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 (r *RedisLayer) BatchGetValues(ctx context.Context, keys []string) ([]string, error)

func (*RedisLayer) BatchKeyExist

func (r *RedisLayer) BatchKeyExist(ctx context.Context, keys []string) (bool, error)

func (*RedisLayer) BatchSetKeys

func (r *RedisLayer) BatchSetKeys(ctx context.Context, kvs []util.Kv) error

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) GetValue

func (r *RedisLayer) GetValue(ctx context.Context, key string) (string, error)

func (*RedisLayer) Init

func (r *RedisLayer) Init(conf *config.CacheConfig, prefix string) error

func (*RedisLayer) KeyExists

func (r *RedisLayer) KeyExists(ctx context.Context, key string) (bool, error)

func (*RedisLayer) SetKey

func (r *RedisLayer) SetKey(ctx context.Context, kv util.Kv) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL