frostfs-node/pkg/local_object_storage/metabase/db.go
Leonard Lyubich 85aacbbb10 [#128] localstorage: Implement primary object metabase
Implement bolt-based metabase that is going to be used in local object
storage. Implement Put/Get/Select methods.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-29 17:34:41 +03:00

25 lines
528 B
Go

package meta
import (
"github.com/nspcc-dev/neofs-api-go/pkg/object"
"go.etcd.io/bbolt"
)
// DB represents local metabase of storage node.
type DB struct {
boltDB *bbolt.DB
matchers map[object.SearchMatchType]func(string, string) bool
}
// NewDB creates, initializes and returns DB instance.
func NewDB(boltDB *bbolt.DB) *DB {
return &DB{
boltDB: boltDB,
matchers: map[object.SearchMatchType]func(string, string) bool{
object.MatchStringEqual: func(s string, s2 string) bool {
return s == s2
},
},
}
}