Documentation
¶
Index ¶
- type KVMemoryService
- func (m *KVMemoryService) AddToSets(ctx context.Context, key string, value string) error
- func (m *KVMemoryService) AddToSortedSets(ctx context.Context, setName string, key string, exp time.Duration) error
- func (m *KVMemoryService) CheckKeyHashMap(ctx context.Context, hash, key string) bool
- func (m *KVMemoryService) CheckRedisKey(ctx context.Context, keys ...string) (bool, error)
- func (m *KVMemoryService) Close()
- func (m *KVMemoryService) DelValue(ctx context.Context, key string) error
- func (m *KVMemoryService) GetFromHashMap(ctx context.Context, hash, key string) (string, error)
- func (m *KVMemoryService) GetFromSortedSets(ctx context.Context, setName string, key string) (float64, error)
- func (m *KVMemoryService) GetJSONObject(ctx context.Context, key string) (interface{}, error)
- func (m *KVMemoryService) GetStoreDomains(ctx context.Context, sets string, member string) (bool, error)
- func (m *KVMemoryService) GetValue(ctx context.Context, key string) (string, error)
- func (m *KVMemoryService) RemoveSets(ctx context.Context, key string, value string) error
- func (m *KVMemoryService) SetJSONObject(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- func (m *KVMemoryService) SetToHashMap(ctx context.Context, hash, key string, value string) error
- func (m *KVMemoryService) SetValue(ctx context.Context, key string, value string, expiration time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KVMemoryService ¶
type KVMemoryService struct {
// contains filtered or unexported fields
}
KVMemoryService implements KeyValueServiceInterface using in-memory storage
func GetKVMemoryDriver ¶
func GetKVMemoryDriver(cfg *models.Config) (*KVMemoryService, error)
func (*KVMemoryService) AddToSortedSets ¶
func (m *KVMemoryService) AddToSortedSets(ctx context.Context, setName string, key string, exp time.Duration) error
AddToSortedSets adds a key to a sorted set with a given TTL (Time To Live) in seconds.
func (*KVMemoryService) CheckKeyHashMap ¶
func (m *KVMemoryService) CheckKeyHashMap(ctx context.Context, hash, key string) bool
CheckKeyHashMap checks if a key exists in a hash.
func (*KVMemoryService) CheckRedisKey ¶
CheckRedisKey checks if one or more keys exist.
func (*KVMemoryService) DelValue ¶
func (m *KVMemoryService) DelValue(ctx context.Context, key string) error
DelValue deletes a value using a key.
func (*KVMemoryService) GetFromHashMap ¶
GetFromHashMap retrieves a value from a hash using a key.
func (*KVMemoryService) GetFromSortedSets ¶
func (m *KVMemoryService) GetFromSortedSets(ctx context.Context, setName string, key string) (float64, error)
GetFromSortedSets retrieves a key from a sorted set.
func (*KVMemoryService) GetJSONObject ¶
func (m *KVMemoryService) GetJSONObject(ctx context.Context, key string) (interface{}, error)
GetJSONObject retrieves a JSON object using a key.
func (*KVMemoryService) GetStoreDomains ¶
func (m *KVMemoryService) GetStoreDomains(ctx context.Context, sets string, member string) (bool, error)
GetStoreDomains checks if a member exists in a set (equivalent to Redis SISMEMBER)
func (*KVMemoryService) RemoveSets ¶
RemoveSets removes a value from a set.
func (*KVMemoryService) SetJSONObject ¶
func (m *KVMemoryService) SetJSONObject(ctx context.Context, key string, value interface{}, expiration time.Duration) error
SetJSONObject sets a JSON object with a key with a given expiration time.
func (*KVMemoryService) SetToHashMap ¶
SetToHashMap sets a key-value pair in a hash.