dcrd/database/ffldb
Dave Collins 05e66dcaca
database: Use TempDir to create temp test dirs.
This modifies several of the tests to use t.TempDir.  The directory it
creates is automatically removed when the test and all its subtests
complete.

It also changes out some of the cleanup logic for closing the database
to use t.Cleanup instead of defer to ensure the close happens during
test cleanup after the directories created by t.TempDir have been
removed.
2023-06-15 15:05:45 -05:00
..
bench_test.go database: Use TempDir to create temp test dirs. 2023-06-15 15:05:45 -05:00
blockio.go multi: Go 1.19 doc comment formatting. 2022-07-30 04:08:58 -05:00
db.go database: Prepare v3.0.1. 2023-06-08 13:33:13 -05:00
dbcache.go database: Prepare v3.0.1. 2023-06-08 13:33:13 -05:00
doc.go database: Prepare v3.0.1. 2023-06-08 13:33:13 -05:00
driver_test.go database: Use TempDir to create temp test dirs. 2023-06-15 15:05:45 -05:00
driver.go multi: Introduce database/v3 module. 2021-08-02 08:29:46 -05:00
export_test.go multi: Introduce database/v3 module. 2021-08-02 08:29:46 -05:00
interface_test.go database: Mark test helpers. 2023-06-15 15:05:45 -05:00
ldbtreapiter.go multi: Introduce database/v3 module. 2021-08-02 08:29:46 -05:00
mockfile_test.go database: Replace with new version. 2016-08-23 17:40:38 -04:00
README.md multi: replace godoc.org with pkg.go.dev 2020-02-18 19:35:19 -06:00
reconcile.go multi: Introduce database/v3 module. 2021-08-02 08:29:46 -05:00
whitebox_test.go database: Use TempDir to create temp test dirs. 2023-06-15 15:05:45 -05:00

ffldb

Build Status ISC License Doc

Package ffldb implements a driver for the database package that uses leveldb for the backing metadata and flat files for block storage.

This driver is the recommended driver for use with dcrd. It makes use leveldb for the metadata, flat files for block storage, and checksums in key areas to ensure data integrity.

Package ffldb is licensed under the copyfree ISC license.

Usage

This package is a driver to the database package and provides the database type of "ffldb". The parameters the Open and Create functions take are the database path as a string and the block network.

db, err := database.Open("ffldb", "path/to/database", wire.MainNet)
if err != nil {
	// Handle error
}
db, err := database.Create("ffldb", "path/to/database", wire.MainNet)
if err != nil {
	// Handle error
}

License

Package ffldb is licensed under the copyfree ISC License.