frostfs-node/modules/node/core.go
alexvanin dadfd90dcd Initial commit
Initial public review release v0.10.0
2020-07-10 17:45:00 +03:00

29 lines
579 B
Go

package node
import (
"github.com/nspcc-dev/neofs-node/lib/core"
"github.com/nspcc-dev/neofs-node/lib/storage"
"github.com/spf13/viper"
"go.uber.org/zap"
)
func listBuckets(v *viper.Viper) []core.BucketType {
var (
items = v.GetStringMap("storage")
result = make([]core.BucketType, 0, len(items))
)
for name := range items {
result = append(result, core.BucketType(name))
}
return result
}
func newStorage(l *zap.Logger, v *viper.Viper) (core.Storage, error) {
return storage.New(storage.Params{
Viper: v,
Logger: l,
Buckets: listBuckets(v),
})
}