[#1048] control: Add ListShards implementation to ctrl svc

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-12-17 18:55:59 +03:00 committed by Alex Vanin
parent 4e989e7133
commit 0e5410603e
3 changed files with 63 additions and 0 deletions

View file

@ -3,6 +3,8 @@ package control
import (
"crypto/ecdsa"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
"github.com/nspcc-dev/neofs-node/pkg/services/control"
)
@ -49,6 +51,8 @@ type cfg struct {
nodeState NodeState
delObjHandler DeletedObjectHandler
s *engine.StorageEngine
}
func defaultCfg() *cfg {
@ -113,3 +117,11 @@ func WithDeletedObjectHandler(h DeletedObjectHandler) Option {
c.delObjHandler = h
}
}
// WithLocalStorage returns option to set local storage engine that
// contains information about shards.
func WithLocalStorage(engine *engine.StorageEngine) Option {
return func(c *cfg) {
c.s = engine
}
}