github.com/decred/dcrlnd@v0.7.6/kvdb/backend_js.go (about) 1 package kvdb 2 3 import ( 4 "fmt" 5 "time" 6 ) 7 8 // BoltBackendConfig is a struct that holds settings specific to the bolt 9 // database backend. 10 type BoltBackendConfig struct { 11 // DBPath is the directory path in which the database file should be 12 // stored. 13 DBPath string 14 15 // DBFileName is the name of the database file. 16 DBFileName string 17 18 // NoFreelistSync, if true, prevents the database from syncing its 19 // freelist to disk, resulting in improved performance at the expense of 20 // increased startup time. 21 NoFreelistSync bool 22 23 // AutoCompact specifies if a Bolt based database backend should be 24 // automatically compacted on startup (if the minimum age of the 25 // database file is reached). This will require additional disk space 26 // for the compacted copy of the database but will result in an overall 27 // lower database size after the compaction. 28 AutoCompact bool 29 30 // AutoCompactMinAge specifies the minimum time that must have passed 31 // since a bolt database file was last compacted for the compaction to 32 // be considered again. 33 AutoCompactMinAge time.Duration 34 35 // DBTimeout specifies the timeout value to use when opening the wallet 36 // database. 37 DBTimeout time.Duration 38 } 39 40 // GetBoltBackend opens (or creates if doesn't exits) a bbolt backed database 41 // and returns a kvdb.Backend wrapping it. 42 func GetBoltBackend(cfg *BoltBackendConfig) (Backend, error) { 43 return nil, fmt.Errorf("bolt backend not supported in WebAssembly") 44 } 45 46 func GetTestBackend(path, name string) (Backend, func(), error) { 47 return nil, nil, fmt.Errorf("bolt backend not supported in WebAssembly") 48 }