Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKVDriver ¶
AddKVDriver registers a KeyValue storage driver to the list of avalible drivers. Driver list the RocksDB are only included with some build tags and aren't always avalible
Types ¶
type KVBuilder ¶
type KVBuilder func(path string, opts Options) (KVInterface, error)
KVBuilder is function implemented by the various key/value storage drivers that returns an initialized KVInterface given a file/path argument
type KVBulkWrite ¶
type KVInterface ¶
type KVInterface interface { HasKey(key []byte) bool Set(key, value []byte) error Get(key []byte) ([]byte, error) DeletePrefix(prefix []byte) error Delete(key []byte) error View(func(it KVIterator) error) error Update(func(tx KVTransaction) error) error BulkWrite(func(bl KVBulkWrite) error) error Close() error }
KVInterface is the base interface for key/value based graph driver
func NewKVInterface ¶
func NewKVInterface(name string, dbPath string, opts *Options) (KVInterface, error)
NewKVInterface intitalize a new key value interface given the name of the driver and path to create the database
type KVIterator ¶
type KVIterator interface { Seek(k []byte) error SeekReverse(k []byte) error Valid() bool Key() []byte Value() ([]byte, error) Next() error Get(key []byte) ([]byte, error) }
KVIterator is a genetic interface used by KVInterface.View to allow the KVGraph to scan the values stored in the key value driver
type KVTransaction ¶
type KVTransaction interface { Get(key []byte) ([]byte, error) HasKey(key []byte) bool Set(key, value []byte) error Delete(key []byte) error View(func(it KVIterator) error) error }
KVTransaction is a generic interface used by KVInterface.Update to allow the KVGraph to alter the values stored in the key value driver