[#316] locode: Implement NeoFS location database based on BoltDB instance

Define NeoFS location database based on BoltDB. Implement methods to save
the record by key (Put) and to read the record by key (Get).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-08 21:25:17 +03:00 committed by Leonard Lyubich
parent 9669afdfc7
commit f88e0866fe
3 changed files with 257 additions and 0 deletions

View file

@ -0,0 +1,22 @@
package locodebolt
import (
"os"
"go.etcd.io/bbolt"
)
// Option sets an optional parameter of DB.
type Option func(*options)
type options struct {
mode os.FileMode
boltOpts *bbolt.Options
}
func defaultOpts() *options {
return &options{
mode: os.ModePerm, // 0777
}
}