storj/private/kvstore/testsuite/utils.go
Egon Elbre c1f1aacffe private/kvstore: move storage package
There's no reason it should be at the top-level.

Change-Id: I35b06e7baa0e425c6ff9a82964d0a1570d4eb6d0
2023-04-06 17:26:29 +03:00

26 lines
535 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package testsuite
import (
"testing"
"storj.io/common/testcontext"
"storj.io/storj/private/kvstore"
)
func newItem(key, value string, isPrefix bool) kvstore.Item {
return kvstore.Item{
Key: kvstore.Key(key),
Value: kvstore.Value(value),
IsPrefix: isPrefix,
}
}
func cleanupItems(t testing.TB, ctx *testcontext.Context, store kvstore.Store, items kvstore.Items) {
for _, item := range items {
_ = store.Delete(ctx, item.Key)
}
}