Documentation ¶
Index ¶
- Variables
- type BboltDBKVStore
- func (b *BboltDBKVStore) Bucket(prefix string) (KVStore, error)
- func (b *BboltDBKVStore) Close() error
- func (b *BboltDBKVStore) Delete(key []byte) error
- func (b *BboltDBKVStore) Get(key []byte) ([]byte, error)
- func (b *BboltDBKVStore) Open() error
- func (b *BboltDBKVStore) Put(key []byte, value []byte) error
- type Cache
- type EtcdKVStore
- type KVStore
- type LRUCache
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BboltDBKVStore ¶
type BboltDBKVStore struct {
// contains filtered or unexported fields
}
func NewBboltDBKVStore ¶
func NewBboltDBKVStore(dbPath string, cache Cache) *BboltDBKVStore
func (*BboltDBKVStore) Close ¶
func (b *BboltDBKVStore) Close() error
func (*BboltDBKVStore) Delete ¶
func (b *BboltDBKVStore) Delete(key []byte) error
func (*BboltDBKVStore) Open ¶
func (b *BboltDBKVStore) Open() error
type EtcdKVStore ¶
type EtcdKVStore struct {
// contains filtered or unexported fields
}
EtcdKVStore is an implementation of the KVStore interface using etcd.
func NewEtcdKVStore ¶
func NewEtcdKVStore(client *clientv3.Client, prefix string, cache Cache, timeout time.Duration) *EtcdKVStore
NewEtcdKVStore creates a new instance of EtcdKVStore.
func (*EtcdKVStore) Bucket ¶
func (e *EtcdKVStore) Bucket(prefix string) (KVStore, error)
Bucket creates a new bucket with the given prefix.
func (*EtcdKVStore) Close ¶
func (e *EtcdKVStore) Close() error
Close closes the connection to the etcd cluster.
func (*EtcdKVStore) Delete ¶
func (e *EtcdKVStore) Delete(key []byte) error
Delete removes the value associated with the given key.
func (*EtcdKVStore) Get ¶
func (e *EtcdKVStore) Get(key []byte) ([]byte, error)
Get retrieves the value associated with the given key.
func (*EtcdKVStore) Open ¶
func (e *EtcdKVStore) Open() error
Open establishes a connection to the etcd cluster.
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
LRUCache is an implementation of the Cache interface using an LRU cache.
func NewLRUCache ¶
NewLRUCache creates a new instance of LRUCache with the specified size.
Click to show internal directories.
Click to hide internal directories.