forked from TrueCloudLab/frostfs-node
[#211] blobstor: Define Iterate operation
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3c0ef270f4
commit
1ba556f5e7
1 changed files with 33 additions and 0 deletions
33
pkg/local_object_storage/blobstor/iterate.go
Normal file
33
pkg/local_object_storage/blobstor/iterate.go
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
package blobstor
|
||||||
|
|
||||||
|
import (
|
||||||
|
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||||
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza"
|
||||||
|
)
|
||||||
|
|
||||||
|
// IterationHandler represents the action to be performed on each iteration.
|
||||||
|
type IterationHandler func(*objectSDK.Address, *blobovnicza.ID) error
|
||||||
|
|
||||||
|
// IteratePrm groups the parameters of Iterate operation.
|
||||||
|
type IteratePrm struct {
|
||||||
|
handler IterationHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
// IterateRes groups resulting values of Iterate operation.
|
||||||
|
type IterateRes struct{}
|
||||||
|
|
||||||
|
// SetIterationHandler sets the action to be performed on each iteration.
|
||||||
|
func (i *IteratePrm) SetIterationHandler(h IterationHandler) {
|
||||||
|
i.handler = h
|
||||||
|
}
|
||||||
|
|
||||||
|
// Iterate traverses the storage over the stored objects and calls the handler
|
||||||
|
// on each element.
|
||||||
|
//
|
||||||
|
// Returns any error encountered that
|
||||||
|
// did not allow to completely iterate over the storage.
|
||||||
|
//
|
||||||
|
// If handler returns an error, method returns it immediately.
|
||||||
|
func (b *BlobStor) Iterate(prm *IteratePrm) (*IterateRes, error) {
|
||||||
|
panic("implement me")
|
||||||
|
}
|
Loading…
Reference in a new issue