forked from TrueCloudLab/frostfs-node
[#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:
parent
9669afdfc7
commit
f88e0866fe
3 changed files with 257 additions and 0 deletions
22
pkg/util/locode/db/boltdb/opts.go
Normal file
22
pkg/util/locode/db/boltdb/opts.go
Normal 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue