2021-06-01 18:22:41 +00:00
|
|
|
package metabaseconfig
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
|
2022-06-16 15:07:02 +00:00
|
|
|
boltdbconfig "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/engine/shard/boltdb"
|
2021-06-01 18:22:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Config is a wrapper over the config section
|
|
|
|
// which provides access to Metabase configurations.
|
|
|
|
type Config config.Config
|
|
|
|
|
|
|
|
// From wraps config section into Config.
|
|
|
|
func From(c *config.Config) *Config {
|
|
|
|
return (*Config)(c)
|
|
|
|
}
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
// Path returns the value of "path" config parameter.
|
2021-06-01 18:22:41 +00:00
|
|
|
//
|
2022-04-21 11:28:05 +00:00
|
|
|
// Panics if the value is not a non-empty string.
|
2021-06-01 18:22:41 +00:00
|
|
|
func (x *Config) Path() string {
|
|
|
|
p := config.String(
|
|
|
|
(*config.Config)(x),
|
|
|
|
"path",
|
|
|
|
)
|
|
|
|
|
|
|
|
if p == "" {
|
|
|
|
panic("metabase path not set")
|
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
|
2022-06-16 15:07:02 +00:00
|
|
|
// BoltDB returns config instance for querying bolt db specific parameters.
|
|
|
|
func (x *Config) BoltDB() *boltdbconfig.Config {
|
|
|
|
return (*boltdbconfig.Config)(x)
|
2021-06-01 18:22:41 +00:00
|
|
|
}
|