Documentation
¶
Index ¶
- type BoltDBStorage
- func (ds *BoltDBStorage) Close() error
- func (ds *BoltDBStorage) Delete(root string, key string)
- func (ds *BoltDBStorage) DeleteAll(root string)
- func (ds *BoltDBStorage) Err() error
- func (ds *BoltDBStorage) Exists(root string) bool
- func (ds *BoltDBStorage) Get(root string, key string) (string, bool)
- func (ds *BoltDBStorage) GetKeys(root string) ([]string, bool)
- func (ds *BoltDBStorage) Set(root string, key string, val string) error
- type MemStorage
- func (s *MemStorage[T]) Close() error
- func (s *MemStorage[T]) Delete(key T, subkey string)
- func (s *MemStorage[T]) DeleteAll(key T)
- func (s *MemStorage[T]) Err() error
- func (s *MemStorage[T]) Exists(key T) bool
- func (s *MemStorage[T]) Get(key T, subkey string) (string, bool)
- func (s *MemStorage[T]) GetKeys(key T) ([]string, bool)
- func (s *MemStorage[T]) Set(key T, subkey, val string) error
- type NatsStorage
- func (ds *NatsStorage) Close() error
- func (ds *NatsStorage) Delete(root string, key string)
- func (ds *NatsStorage) DeleteAll(root string)
- func (ds *NatsStorage) Err() error
- func (ds *NatsStorage) Exists(root string) bool
- func (ds *NatsStorage) Get(root string, key string) (string, bool)
- func (ds *NatsStorage) GetKeys(root string) ([]string, bool)
- func (ds *NatsStorage) Set(root string, key string, val string) error
- type RedisStorage
- func (ds *RedisStorage) Close() error
- func (ds *RedisStorage) Delete(root string, key string)
- func (ds *RedisStorage) DeleteAll(root string)
- func (ds *RedisStorage) Err() error
- func (ds *RedisStorage) Exists(root string) bool
- func (ds *RedisStorage) Get(root string, key string) (string, bool)
- func (ds *RedisStorage) GetKeys(root string) ([]string, bool)
- func (ds *RedisStorage) Set(root string, key string, val string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltDBStorage ¶
type BoltDBStorage struct {
// contains filtered or unexported fields
}
func NewBoltDBStorage ¶
func NewBoltDBStorage() *BoltDBStorage
NewBoltDBStorage Creates a new BoltDB storage
func (*BoltDBStorage) Delete ¶
func (ds *BoltDBStorage) Delete(root string, key string)
Delete deletes data from the store.
func (*BoltDBStorage) DeleteAll ¶
func (ds *BoltDBStorage) DeleteAll(root string)
DeleteAll deletes all data for a specific id from the store.
func (*BoltDBStorage) Exists ¶
func (ds *BoltDBStorage) Exists(root string) bool
Exists returns true if there is any data for a specific id in the store.
func (*BoltDBStorage) Get ¶
func (ds *BoltDBStorage) Get(root string, key string) (string, bool)
Get returns a data value from the store.
type MemStorage ¶
MemStorage is an in-memory data storage implementation of the DataStorage interface. It uses a map to store data, where the key is a string and the value is another map of string keys and values.
func NewMemStorage ¶
func NewMemStorage[T int | string]() *MemStorage[T]
NewMemStorage creates a new MemStorage data store.
func (*MemStorage[T]) Close ¶
func (s *MemStorage[T]) Close() error
Close closes the underlying storage.
func (*MemStorage[T]) Delete ¶
func (s *MemStorage[T]) Delete(key T, subkey string)
Delete deletes data for a specific key from the store.
func (*MemStorage[T]) DeleteAll ¶
func (s *MemStorage[T]) DeleteAll(key T)
DeleteAll deletes all data for a specific key from the store.
func (*MemStorage[T]) Err ¶
func (s *MemStorage[T]) Err() error
Err returns last operational error if any. nil otherwise.
func (*MemStorage[T]) Exists ¶
func (s *MemStorage[T]) Exists(key T) bool
Exists checks if a specific key exists in the store.
func (*MemStorage[T]) Get ¶
func (s *MemStorage[T]) Get(key T, subkey string) (string, bool)
Get returns a data value for a specific key from the store.
func (*MemStorage[T]) GetKeys ¶
func (s *MemStorage[T]) GetKeys(key T) ([]string, bool)
GetKeys returns all the keys for a specific key from the store.
func (*MemStorage[T]) Set ¶
func (s *MemStorage[T]) Set(key T, subkey, val string) error
Set sets a key/value for a specific key in the store.
type NatsStorage ¶
type NatsStorage struct {
// contains filtered or unexported fields
}
func (*NatsStorage) Delete ¶
func (ds *NatsStorage) Delete(root string, key string)
Delete deletes data from the store.
func (*NatsStorage) DeleteAll ¶
func (ds *NatsStorage) DeleteAll(root string)
DeleteAll deletes all data for a specific id from the store.
func (*NatsStorage) Exists ¶
func (ds *NatsStorage) Exists(root string) bool
Exists returns true if there is any data for a specific id in the store.
func (*NatsStorage) Get ¶
func (ds *NatsStorage) Get(root string, key string) (string, bool)
Get returns a data value from the store.
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func NewRedisStorage ¶
func NewRedisStorage() *RedisStorage
NewRedisStorage Creates a new Redis storage
func (*RedisStorage) Delete ¶
func (ds *RedisStorage) Delete(root string, key string)
Delete deletes data from the store.
func (*RedisStorage) DeleteAll ¶
func (ds *RedisStorage) DeleteAll(root string)
DeleteAll deletes all data for a specific id from the store.
func (*RedisStorage) Exists ¶
func (ds *RedisStorage) Exists(root string) bool
Exists returns true if there is any data for a specific id in the store.
func (*RedisStorage) Get ¶
func (ds *RedisStorage) Get(root string, key string) (string, bool)
Get returns a data value from the store.