Documentation
¶
Index ¶
- type DataItem
- type ExpirationItem
- type HashMapItem
- type KVBoltService
- func (k *KVBoltService) AddToSets(ctx context.Context, key string, value string) error
- func (k *KVBoltService) AddToSortedSets(ctx context.Context, setName string, key string, exp time.Duration) error
- func (k *KVBoltService) CheckKeyHashMap(ctx context.Context, hash, key string) bool
- func (k *KVBoltService) CheckRedisKey(ctx context.Context, keys ...string) (bool, error)
- func (k *KVBoltService) Close() error
- func (k *KVBoltService) DelValue(ctx context.Context, key string) error
- func (k *KVBoltService) GetFromHashMap(ctx context.Context, hash, key string) (string, error)
- func (k *KVBoltService) GetFromSortedSets(ctx context.Context, setName string, key string) (float64, error)
- func (k *KVBoltService) GetJSONObject(ctx context.Context, key string) (interface{}, error)
- func (k *KVBoltService) GetValue(ctx context.Context, key string) (string, error)
- func (k *KVBoltService) RemoveSets(ctx context.Context, key string, value string) error
- func (k *KVBoltService) SetJSONObject(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- func (k *KVBoltService) SetToHashMap(ctx context.Context, hash, key string, value string) error
- func (k *KVBoltService) SetValue(ctx context.Context, key string, value string, expiration time.Duration) error
- type SetItem
- type SortedSetItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpirationItem ¶
type ExpirationItem struct {
ID string `json:"id"`
Key string `json:"key"`
ExpireTime int64 `json:"expire_time"`
}
ExpirationItem represents an expiration entry
type HashMapItem ¶
type HashMapItem struct {
ID string `json:"id"`
Hash string `json:"hash"`
Key string `json:"key"`
Value string `json:"value"`
}
HashMapItem represents an item in a hash map
type KVBoltService ¶
type KVBoltService struct {
// contains filtered or unexported fields
}
KVBoltService implements KeyValueServiceInterface using ApitoBolt
func GetKVBoltDriver ¶
func GetKVBoltDriver(cfg *models.Config) (*KVBoltService, error)
func (*KVBoltService) AddToSortedSets ¶
func (k *KVBoltService) 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 (*KVBoltService) CheckKeyHashMap ¶
func (k *KVBoltService) CheckKeyHashMap(ctx context.Context, hash, key string) bool
CheckKeyHashMap checks if a key exists in a hash.
func (*KVBoltService) CheckRedisKey ¶
CheckRedisKey checks if one or more keys exist.
func (*KVBoltService) Close ¶
func (k *KVBoltService) Close() error
Close closes the BoltDB connection
func (*KVBoltService) DelValue ¶
func (k *KVBoltService) DelValue(ctx context.Context, key string) error
DelValue deletes a value using a key.
func (*KVBoltService) GetFromHashMap ¶
GetFromHashMap retrieves a value from a hash using a key.
func (*KVBoltService) GetFromSortedSets ¶
func (k *KVBoltService) GetFromSortedSets(ctx context.Context, setName string, key string) (float64, error)
GetFromSortedSets retrieves a key from a sorted set.
func (*KVBoltService) GetJSONObject ¶
func (k *KVBoltService) GetJSONObject(ctx context.Context, key string) (interface{}, error)
GetJSONObject retrieves a JSON object using a key.
func (*KVBoltService) RemoveSets ¶
RemoveSets removes a value from a set.
func (*KVBoltService) SetJSONObject ¶
func (k *KVBoltService) 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 (*KVBoltService) SetToHashMap ¶
SetToHashMap sets a key-value pair in a hash.
type SetItem ¶
type SetItem struct {
ID string `json:"id"`
SetKey string `json:"set_key"`
Value string `json:"value"`
}
SetItem represents an item in a set
type SortedSetItem ¶
type SortedSetItem struct {
ID string `json:"id"`
SetKey string `json:"set_key"`
Score float64 `json:"score"`
}
SortedSetItem represents an item in a sorted set