frostfs-node/pkg/services/control/server/helpers.go
Evgenii Stratonikov c0199dee93 [#1867] services/control: Interpret empty list of IDs as all shards
In neofs-cli the flag is still required, but `all` can be used to
process all shards.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
2022-10-12 11:20:48 +03:00

20 lines
462 B
Go

package control
import "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard"
func (s *Server) getShardIDList(raw [][]byte) []*shard.ID {
if len(raw) != 0 {
res := make([]*shard.ID, 0, len(raw))
for i := range raw {
res = append(res, shard.NewIDFromBytes(raw[i]))
}
return res
}
info := s.s.DumpInfo()
res := make([]*shard.ID, 0, len(info.Shards))
for i := range info.Shards {
res = append(res, info.Shards[i].ID)
}
return res
}