Documentation ¶
Index ¶
- Constants
- Variables
- func NewTable(db database.Database, prefix string) database.Database
- func NewTableBatch(db database.Database, prefix string) database.Batch
- type AerospikeDatabase
- func (db *AerospikeDatabase) Close()
- func (db *AerospikeDatabase) CountReference(key []byte) (int, error)
- func (db *AerospikeDatabase) Delete(key []byte) error
- func (db *AerospikeDatabase) Dereference(key []byte) error
- func (db *AerospikeDatabase) Get(key []byte) ([]byte, error)
- func (db *AerospikeDatabase) Has(key []byte) (bool, error)
- func (db *AerospikeDatabase) NewBatch() database.Batch
- func (db *AerospikeDatabase) Put(key []byte, value []byte) error
- func (db *AerospikeDatabase) Reference(key []byte) error
- type BadgerDatabase
- func (db *BadgerDatabase) Close()
- func (db *BadgerDatabase) CountReference(key []byte) (int, error)
- func (db *BadgerDatabase) Delete(key []byte) error
- func (db *BadgerDatabase) Dereference(key []byte) error
- func (db *BadgerDatabase) Get(key []byte) ([]byte, error)
- func (db *BadgerDatabase) Has(key []byte) (bool, error)
- func (db *BadgerDatabase) NewBatch() database.Batch
- func (db *BadgerDatabase) Put(key []byte, value []byte) error
- func (db *BadgerDatabase) Reference(key []byte) error
- type Document
- type LDBDatabase
- func (db *LDBDatabase) Close()
- func (db *LDBDatabase) CountReference(key []byte) (int, error)
- func (db *LDBDatabase) Delete(key []byte) error
- func (db *LDBDatabase) Dereference(key []byte) error
- func (db *LDBDatabase) Get(key []byte) ([]byte, error)
- func (db *LDBDatabase) Has(key []byte) (bool, error)
- func (db *LDBDatabase) LDB() *leveldb.DB
- func (db *LDBDatabase) Meter(prefix string)
- func (db *LDBDatabase) NewBatch() database.Batch
- func (db *LDBDatabase) NewIterator() iterator.Iterator
- func (db *LDBDatabase) NewIteratorWithPrefix(prefix []byte) iterator.Iterator
- func (db *LDBDatabase) Path() string
- func (db *LDBDatabase) Put(key []byte, value []byte) error
- func (db *LDBDatabase) Reference(key []byte) error
- type MemDatabase
- func (db *MemDatabase) Close()
- func (db *MemDatabase) CountReference(key []byte) (int, error)
- func (db *MemDatabase) Delete(key []byte) error
- func (db *MemDatabase) Dereference(key []byte) error
- func (db *MemDatabase) Get(key []byte) ([]byte, error)
- func (db *MemDatabase) Has(key []byte) (bool, error)
- func (db *MemDatabase) Keys() [][]byte
- func (db *MemDatabase) Len() int
- func (db *MemDatabase) NewBatch() database.Batch
- func (db *MemDatabase) Put(key []byte, value []byte) error
- func (db *MemDatabase) Reference(key []byte) error
- type MgoDatabase
- func (db *MgoDatabase) Close()
- func (db *MgoDatabase) CountReference(key []byte) (int, error)
- func (db *MgoDatabase) Delete(key []byte) error
- func (db *MgoDatabase) Dereference(key []byte) error
- func (db *MgoDatabase) Get(key []byte) ([]byte, error)
- func (db *MgoDatabase) Has(key []byte) (bool, error)
- func (db *MgoDatabase) NewBatch() database.Batch
- func (db *MgoDatabase) Put(key []byte, value []byte) error
- func (db *MgoDatabase) Reference(key []byte) error
- type MongoDatabase
- func (db *MongoDatabase) Close()
- func (db *MongoDatabase) CountReference(key []byte) (int, error)
- func (db *MongoDatabase) Delete(key []byte) error
- func (db *MongoDatabase) Dereference(key []byte) error
- func (db *MongoDatabase) Get(key []byte) ([]byte, error)
- func (db *MongoDatabase) Has(key []byte) (bool, error)
- func (db *MongoDatabase) NewBatch() database.Batch
- func (db *MongoDatabase) Put(key []byte, value []byte) error
- func (db *MongoDatabase) Reference(key []byte) error
Constants ¶
Variables ¶
var OpenFileLimit = 64
Functions ¶
Types ¶
type AerospikeDatabase ¶
type AerospikeDatabase struct {
// contains filtered or unexported fields
}
AerospikeDatabase a MongoDB wrapped object.
func NewAerospikeDatabase ¶
func NewAerospikeDatabase() (*AerospikeDatabase, error)
NewAerospikeDatabase returns a AerospikeDatabase wrapped object.
func (*AerospikeDatabase) Close ¶
func (db *AerospikeDatabase) Close()
func (*AerospikeDatabase) CountReference ¶
func (db *AerospikeDatabase) CountReference(key []byte) (int, error)
func (*AerospikeDatabase) Delete ¶
func (db *AerospikeDatabase) Delete(key []byte) error
Delete deletes the key from the database
func (*AerospikeDatabase) Dereference ¶
func (db *AerospikeDatabase) Dereference(key []byte) error
func (*AerospikeDatabase) Get ¶
func (db *AerospikeDatabase) Get(key []byte) ([]byte, error)
Get returns the given key if it's present.
func (*AerospikeDatabase) Has ¶
func (db *AerospikeDatabase) Has(key []byte) (bool, error)
Has checks if the given key is present in the database
func (*AerospikeDatabase) NewBatch ¶
func (db *AerospikeDatabase) NewBatch() database.Batch
func (*AerospikeDatabase) Put ¶
func (db *AerospikeDatabase) Put(key []byte, value []byte) error
Put puts the given key / value to the database
func (*AerospikeDatabase) Reference ¶
func (db *AerospikeDatabase) Reference(key []byte) error
type BadgerDatabase ¶
type BadgerDatabase struct {
// contains filtered or unexported fields
}
BadgerDatabase a MongoDB (using badger driver) wrapped object.
func NewBadgerDatabase ¶
func NewBadgerDatabase(dirname string) (*BadgerDatabase, error)
NewBadgerDatabase returns a BadgerDB wrapped object.
func (*BadgerDatabase) Close ¶
func (db *BadgerDatabase) Close()
func (*BadgerDatabase) CountReference ¶
func (db *BadgerDatabase) CountReference(key []byte) (int, error)
func (*BadgerDatabase) Delete ¶
func (db *BadgerDatabase) Delete(key []byte) error
Delete deletes the key from the database
func (*BadgerDatabase) Dereference ¶
func (db *BadgerDatabase) Dereference(key []byte) error
func (*BadgerDatabase) Get ¶
func (db *BadgerDatabase) Get(key []byte) ([]byte, error)
Get returns the given key if it's present.
func (*BadgerDatabase) Has ¶
func (db *BadgerDatabase) Has(key []byte) (bool, error)
Has checks if the given key is present in the database
func (*BadgerDatabase) NewBatch ¶
func (db *BadgerDatabase) NewBatch() database.Batch
func (*BadgerDatabase) Put ¶
func (db *BadgerDatabase) Put(key []byte, value []byte) error
Put puts the given key / value to the database
func (*BadgerDatabase) Reference ¶
func (db *BadgerDatabase) Reference(key []byte) error
type LDBDatabase ¶
type LDBDatabase struct {
// contains filtered or unexported fields
}
func NewLDBDatabase ¶
NewLDBDatabase returns a LevelDB wrapped object.
func (*LDBDatabase) Close ¶
func (db *LDBDatabase) Close()
func (*LDBDatabase) CountReference ¶
func (db *LDBDatabase) CountReference(key []byte) (int, error)
func (*LDBDatabase) Delete ¶
func (db *LDBDatabase) Delete(key []byte) error
Delete deletes the key from the queue and database
func (*LDBDatabase) Dereference ¶
func (db *LDBDatabase) Dereference(key []byte) error
func (*LDBDatabase) Get ¶
func (db *LDBDatabase) Get(key []byte) ([]byte, error)
Get returns the given key if it's present.
func (*LDBDatabase) LDB ¶
func (db *LDBDatabase) LDB() *leveldb.DB
func (*LDBDatabase) Meter ¶
func (db *LDBDatabase) Meter(prefix string)
Meter configures the database metrics collectors and
func (*LDBDatabase) NewBatch ¶
func (db *LDBDatabase) NewBatch() database.Batch
func (*LDBDatabase) NewIterator ¶
func (db *LDBDatabase) NewIterator() iterator.Iterator
func (*LDBDatabase) NewIteratorWithPrefix ¶
func (db *LDBDatabase) NewIteratorWithPrefix(prefix []byte) iterator.Iterator
NewIteratorWithPrefix returns a iterator to iterate over subset of database content with a particular prefix.
func (*LDBDatabase) Path ¶
func (db *LDBDatabase) Path() string
Path returns the path to the database directory.
func (*LDBDatabase) Put ¶
func (db *LDBDatabase) Put(key []byte, value []byte) error
Put puts the given key / value to the queue
func (*LDBDatabase) Reference ¶
func (db *LDBDatabase) Reference(key []byte) error
type MemDatabase ¶
type MemDatabase struct {
// contains filtered or unexported fields
}
* This is a test memory database. Do not use for any production it does not get persisted
func NewMemDatabase ¶
func NewMemDatabase() *MemDatabase
func NewMemDatabaseWithCap ¶
func NewMemDatabaseWithCap(size int) *MemDatabase
func (*MemDatabase) Close ¶
func (db *MemDatabase) Close()
func (*MemDatabase) CountReference ¶
func (db *MemDatabase) CountReference(key []byte) (int, error)
func (*MemDatabase) Delete ¶
func (db *MemDatabase) Delete(key []byte) error
func (*MemDatabase) Dereference ¶
func (db *MemDatabase) Dereference(key []byte) error
func (*MemDatabase) Keys ¶
func (db *MemDatabase) Keys() [][]byte
func (*MemDatabase) Len ¶
func (db *MemDatabase) Len() int
func (*MemDatabase) NewBatch ¶
func (db *MemDatabase) NewBatch() database.Batch
func (*MemDatabase) Reference ¶
func (db *MemDatabase) Reference(key []byte) error
type MgoDatabase ¶
type MgoDatabase struct {
// contains filtered or unexported fields
}
MgoDatabase a MongoDB (using mgo driver) wrapped object.
func NewMgoDatabase ¶
func NewMgoDatabase() (*MgoDatabase, error)
NewMgoDatabase returns a MongoDB (using mgo driver) wrapped object.
func (*MgoDatabase) Close ¶
func (db *MgoDatabase) Close()
func (*MgoDatabase) CountReference ¶
func (db *MgoDatabase) CountReference(key []byte) (int, error)
func (*MgoDatabase) Delete ¶
func (db *MgoDatabase) Delete(key []byte) error
Delete deletes the key from the database
func (*MgoDatabase) Dereference ¶
func (db *MgoDatabase) Dereference(key []byte) error
func (*MgoDatabase) Get ¶
func (db *MgoDatabase) Get(key []byte) ([]byte, error)
Get returns the given key if it's present.
func (*MgoDatabase) Has ¶
func (db *MgoDatabase) Has(key []byte) (bool, error)
Has checks if the given key is present in the database
func (*MgoDatabase) NewBatch ¶
func (db *MgoDatabase) NewBatch() database.Batch
func (*MgoDatabase) Put ¶
func (db *MgoDatabase) Put(key []byte, value []byte) error
Put puts the given key / value to the database
func (*MgoDatabase) Reference ¶
func (db *MgoDatabase) Reference(key []byte) error
type MongoDatabase ¶
type MongoDatabase struct {
// contains filtered or unexported fields
}
MongoDatabase a MongoDB wrapped object.
func NewMongoDatabase ¶
func NewMongoDatabase() (*MongoDatabase, error)
NewMongoDatabase returns a MongoDB wrapped object.
func (*MongoDatabase) Close ¶
func (db *MongoDatabase) Close()
func (*MongoDatabase) CountReference ¶
func (db *MongoDatabase) CountReference(key []byte) (int, error)
func (*MongoDatabase) Delete ¶
func (db *MongoDatabase) Delete(key []byte) error
Delete deletes the key from the database
func (*MongoDatabase) Dereference ¶
func (db *MongoDatabase) Dereference(key []byte) error
func (*MongoDatabase) Get ¶
func (db *MongoDatabase) Get(key []byte) ([]byte, error)
Get returns the given key if it's present.
func (*MongoDatabase) Has ¶
func (db *MongoDatabase) Has(key []byte) (bool, error)
Has checks if the given key is present in the database
func (*MongoDatabase) NewBatch ¶
func (db *MongoDatabase) NewBatch() database.Batch
func (*MongoDatabase) Put ¶
func (db *MongoDatabase) Put(key []byte, value []byte) error
Put puts the given key / value to the database
func (*MongoDatabase) Reference ¶
func (db *MongoDatabase) Reference(key []byte) error