storage

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func (ds *BoltDBStorage) Close() error

Close closes 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) Err

func (ds *BoltDBStorage) Err() error

Err returns last operational error

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.

func (*BoltDBStorage) GetKeys

func (ds *BoltDBStorage) GetKeys(root string) ([]string, bool)

GetKeys returns all the keys for a specific id from the store.

func (*BoltDBStorage) Set

func (ds *BoltDBStorage) Set(root string, key string, val string) error

Set sets a config value in the store.

type MemStorage

type MemStorage[T int | string] struct {
	// contains filtered or unexported fields
}

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 NewNatsStorage

func NewNatsStorage() *NatsStorage

NewNatsStorage Creates a new NATS storage

func (*NatsStorage) Close

func (ds *NatsStorage) Close() error

Close closes Redis Storage

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

func (ds *NatsStorage) Err() error

Err returns last operational error

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.

func (*NatsStorage) GetKeys

func (ds *NatsStorage) GetKeys(root string) ([]string, bool)

GetKeys returns all the keys for a specific id from the store.

func (*NatsStorage) Set

func (ds *NatsStorage) Set(root string, key string, val string) error

Set sets a config value in 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) Close

func (ds *RedisStorage) Close() error

Close closes 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) Err

func (ds *RedisStorage) Err() error

Err returns last operational error

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.

func (*RedisStorage) GetKeys

func (ds *RedisStorage) GetKeys(root string) ([]string, bool)

GetKeys returns all the keys for a specific id from the store.

func (*RedisStorage) Set

func (ds *RedisStorage) Set(root string, key string, val string) error

Set sets a config value in the store.

Jump to

Keyboard shortcuts

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