mirror of
https://github.com/safing/portbase
synced 2026-05-01 21:21:23 +00:00
Fix test, add test helper script
This commit is contained in:
parent
1cf51f683b
commit
a2d6bc974c
9 changed files with 90 additions and 175 deletions
|
|
@ -26,9 +26,7 @@ func init() {
|
|||
|
||||
// NewBadger opens/creates a badger database.
|
||||
func NewBadger(name, location string) (storage.Interface, error) {
|
||||
opts := badger.DefaultOptions
|
||||
opts.Dir = location
|
||||
opts.ValueDir = location
|
||||
opts := badger.DefaultOptions(location)
|
||||
|
||||
db, err := badger.Open(opts)
|
||||
if err == badger.ErrTruncateNeeded {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func (s *Sinkhole) Delete(key string) error {
|
|||
}
|
||||
|
||||
// Query returns a an iterator for the supplied query.
|
||||
func (s *Sinkhole) Query(q *query.Query) (*iterator.Iterator, error) {
|
||||
func (s *Sinkhole) Query(q *query.Query, local, internal bool) (*iterator.Iterator, error) {
|
||||
return nil, errors.New("query not implemented by sinkhole")
|
||||
}
|
||||
|
||||
|
|
@ -55,6 +55,11 @@ func (s *Sinkhole) ReadOnly() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// Injected returns whether the database is injected.
|
||||
func (s *Sinkhole) Injected() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Maintain runs a light maintenance operation on the database.
|
||||
func (s *Sinkhole) Maintain() error {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue