Documentation ¶
Index ¶
- type DB
- func (db *DB) Backup(target io.Writer) error
- func (db *DB) Buckets() ([]string, error)
- func (db *DB) Close()
- func (db *DB) Delete(bucketPath, key string) error
- func (db *DB) Find(bucketPath, filterExpression string) (chan *Pair, error)
- func (db *DB) FindPrefix(bucketPath, prefix, filterExpression string) (chan *Pair, error)
- func (db *DB) FindRange(bucketPath, start, end, filterExpression string) (chan *Pair, error)
- func (db *DB) Get(bucketPath, key string) (Object, error)
- func (db *DB) GetAll(bucketPath string) (chan *Pair, error)
- func (db *DB) GetPrefix(bucketPath, prefix string) (chan *Pair, error)
- func (db *DB) GetRange(bucketPath, start, end string) (chan *Pair, error)
- func (db *DB) Put(bucketPath, key string, val Object) error
- func (db *DB) Size() (int64, error)
- func (db *DB) Tx(writable bool) (*Transaction, error)
- type Object
- type Pair
- type Transaction
- func (tx *Transaction) Backup(target io.Writer) error
- func (tx *Transaction) Buckets() ([]string, error)
- func (tx *Transaction) Close() error
- func (tx *Transaction) Commit() error
- func (tx *Transaction) Delete(bucketPath, key string) error
- func (tx *Transaction) Find(bucketPath, filterExpression string) (chan *Pair, error)
- func (tx *Transaction) FindPrefix(bucketPath, prefix, filterExpression string) (chan *Pair, error)
- func (tx *Transaction) FindRange(bucketPath, start, end, filterExpression string) (chan *Pair, error)
- func (tx *Transaction) Get(bucketPath, key string) (map[string]interface{}, error)
- func (tx *Transaction) GetAll(bucketPath string) (chan *Pair, error)
- func (tx *Transaction) GetPrefix(bucketPath, prefix string) (chan *Pair, error)
- func (tx *Transaction) GetRange(bucketPath, start, end string) (chan *Pair, error)
- func (tx *Transaction) Put(bucketPath, key string, val map[string]interface{}) error
- func (tx *Transaction) Rollback() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps the boltdb handle
func (*DB) FindPrefix ¶
FindPrefix searches a bucket for documents
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction represents represents a bold db transaction and exposes the query and update routines usage: ``` tx, err := db.NewTransaction() defer tx.Close() tx.Get(...) ... tx.Put(...) tx.Commit() ```
func (*Transaction) Backup ¶
func (tx *Transaction) Backup(target io.Writer) error
Backup performs a hot backup of the whole database
func (*Transaction) Buckets ¶
func (tx *Transaction) Buckets() ([]string, error)
Buckets returns a list of all buckets and subbuckets
func (*Transaction) Close ¶
func (tx *Transaction) Close() error
Close closes the transaction. If neither Commit nor Rollback were called before, it rollbacks the transaction
func (*Transaction) Commit ¶
func (tx *Transaction) Commit() error
Commit commits and closes the transaction
func (*Transaction) Delete ¶
func (tx *Transaction) Delete(bucketPath, key string) error
Delete deletes a doc from a bucket
func (*Transaction) Find ¶
func (tx *Transaction) Find(bucketPath, filterExpression string) (chan *Pair, error)
Find searches a bucket for documents
func (*Transaction) FindPrefix ¶
func (tx *Transaction) FindPrefix(bucketPath, prefix, filterExpression string) (chan *Pair, error)
FindPrefix searches a bucket for documents
func (*Transaction) FindRange ¶
func (tx *Transaction) FindRange(bucketPath, start, end, filterExpression string) (chan *Pair, error)
FindRange searches a bucket for documents
func (*Transaction) Get ¶
func (tx *Transaction) Get(bucketPath, key string) (map[string]interface{}, error)
Get retrieves a doc from a bucket
func (*Transaction) GetAll ¶
func (tx *Transaction) GetAll(bucketPath string) (chan *Pair, error)
GetAll returns all docs in a bucket
func (*Transaction) GetPrefix ¶
func (tx *Transaction) GetPrefix(bucketPath, prefix string) (chan *Pair, error)
GetPrefix returns all docs in a bucket matching a prefix
func (*Transaction) GetRange ¶
func (tx *Transaction) GetRange(bucketPath, start, end string) (chan *Pair, error)
GetRange returns all docs in a bucket matching a prefix
func (*Transaction) Put ¶
func (tx *Transaction) Put(bucketPath, key string, val map[string]interface{}) error
Put inserts a doc into a bucket
func (*Transaction) Rollback ¶
func (tx *Transaction) Rollback() error
Rollback discards all changes and closes the transaction