bbolt

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataItem

type DataItem struct {
	ID    string `json:"id"`
	Value string `json:"value"`
}

DataItem represents a simple key-value data item

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

func (k *KVBoltService) AddToSets(ctx context.Context, key string, value string) error

AddToSets adds a value to a set.

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

func (k *KVBoltService) CheckRedisKey(ctx context.Context, keys ...string) (bool, error)

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

func (k *KVBoltService) GetFromHashMap(ctx context.Context, hash, key string) (string, error)

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

func (k *KVBoltService) GetValue(ctx context.Context, key string) (string, error)

GetValue retrieves a value using a key.

func (*KVBoltService) RemoveSets

func (k *KVBoltService) RemoveSets(ctx context.Context, key string, value string) error

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

func (k *KVBoltService) SetToHashMap(ctx context.Context, hash, key string, value string) error

SetToHashMap sets a key-value pair in a hash.

func (*KVBoltService) SetValue

func (k *KVBoltService) SetValue(ctx context.Context, key string, value string, expiration time.Duration) error

SetValue sets a value with a key with a given expiration time.

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

Jump to

Keyboard shortcuts

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