note about encryption and why it must be test datastore now using same settings as seed badger options extracted from storage for test and other uses one place it was missing all using badger/v3 now peer database entry count implemented fixed stray incorrect refactorings added expiry to interface, now propagates correctly eliminated type switch with extending of interface Access to badger View and Update now in Engine Datastore now available via Listener
22 lines
364 B
Go
22 lines
364 B
Go
package storage
|
|
|
|
import (
|
|
"github.com/dgraph-io/badger/v3"
|
|
"github.com/indra-labs/indra/pkg/util/options"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
func attempt_unlock() (isUnlocked bool, err error) {
|
|
|
|
opts = options.Default(viper.GetString(storeFilePathFlag), key[:])
|
|
|
|
if db, err = badger.Open(*opts); err != nil {
|
|
|
|
db = nil
|
|
|
|
return false, err
|
|
}
|
|
|
|
return true, nil
|
|
}
|