Source File
doc.go
Belonging Package
go.etcd.io/bbolt
/*package bbolt implements a low-level key/value store in pure Go. It supportsfully serializable transactions, ACID semantics, and lock-free MVCC withmultiple readers and a single writer. Bolt can be used for projects thatwant a simple data store without the need to add large dependencies such asPostgres or MySQL.Bolt is a single-level, zero-copy, B+tree data store. This means that Bolt isoptimized for fast read access and does not require recovery in the event of asystem crash. Transactions which have not finished committing will simply berolled back in the event of a crash.The design of Bolt is based on Howard Chu's LMDB database project.Bolt currently works on Windows, Mac OS X, and Linux.BasicsThere are only a few types in Bolt: DB, Bucket, Tx, and Cursor. The DB isa collection of buckets and is represented by a single file on disk. A bucket isa collection of unique keys that are associated with values.Transactions provide either read-only or read-write access to the database.Read-only transactions can retrieve key/value pairs and can use Cursors toiterate over the dataset sequentially. Read-write transactions can create anddelete buckets and can insert and remove keys. Only one read-write transactionis allowed at a time.CaveatsThe database uses a read-only, memory-mapped data file to ensure thatapplications cannot corrupt the database, however, this means that keys andvalues returned from Bolt cannot be changed. Writing to a read-only byte slicewill cause Go to panic.Keys and values retrieved from the database are only valid for the life ofthe transaction. When used outside the transaction, these byte slices canpoint to different data or can point to invalid memory which will cause a panic.*/package bbolt
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |