Documentation ¶
Index ¶
- func NewDB(name, dir string) (tmdb.DB, error)
- func NewDBWithOpts(name string, dir string, opts *bbolt.Options) (tmdb.DB, error)
- type BoltDB
- func (bdb *BoltDB) Close() error
- func (bdb *BoltDB) Delete(key []byte) error
- func (bdb *BoltDB) DeleteSync(key []byte) error
- func (bdb *BoltDB) Get(key []byte) (value []byte, err error)
- func (bdb *BoltDB) Has(key []byte) (bool, error)
- func (bdb *BoltDB) Iterator(start, end []byte) (tmdb.Iterator, error)
- func (bdb *BoltDB) NewBatch() tmdb.Batch
- func (bdb *BoltDB) Print() error
- func (bdb *BoltDB) ReverseIterator(start, end []byte) (tmdb.Iterator, error)
- func (bdb *BoltDB) Set(key, value []byte) error
- func (bdb *BoltDB) SetSync(key, value []byte) error
- func (bdb *BoltDB) Stats() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
BoltDB is a wrapper around etcd's fork of bolt (https://github.com/etcd-io/bbolt).
NOTE: All operations (including Set, Delete) are synchronous by default. One can globally turn it off by using NoSync config option (not recommended).
A single bucket ([]byte("tm")) is used per a database instance. This could lead to performance issues when/if there will be lots of keys.
func (*BoltDB) DeleteSync ¶
DeleteSync implements DB.
func (*BoltDB) Iterator ¶
WARNING: Any concurrent writes or reads will block until the iterator is closed.
func (*BoltDB) ReverseIterator ¶
WARNING: Any concurrent writes or reads will block until the iterator is closed.
Click to show internal directories.
Click to hide internal directories.