Documentation ¶
Overview ¶
Package kv provides an interface and implementations for key-value stores. It includes an in-memory key-value store and a persistent key-value store using BadgerDB.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyNotFound = badger.ErrKeyNotFound ErrConflict = badger.ErrConflict )
Functions ¶
func NewInMemoryKV ¶
func NewInMemoryKV() notionstix.Store
NewInMemoryKV creates a new instance of InMemoryKV.
func NewPersistentKV ¶
func NewPersistentKV(file string) (notionstix.Store, error)
NewPersistentKV creates a new instance of PersistentKV with the specified file path.
Types ¶
type InMemoryKV ¶
type InMemoryKV struct {
// contains filtered or unexported fields
}
InMemoryKV is an in-memory key-value store implementation.
func (*InMemoryKV) Cleanup ¶
func (i *InMemoryKV) Cleanup()
Cleanup performs any necessary cleanup for the in-memory store.
type PersistentKV ¶
type PersistentKV struct {
// contains filtered or unexported fields
}
PersistentKV is a persistent key-value store implementation using BadgerDB.
func (*PersistentKV) Cleanup ¶
func (p *PersistentKV) Cleanup()
Cleanup performs any necessary cleanup for the persistent store. It runs a value log garbage collection every 15 minutes.
Click to show internal directories.
Click to hide internal directories.