forked from TrueCloudLab/frostfs-node
[#1183] node/notificator: Implement notificator
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
7d0e3648a2
commit
90ff066940
2 changed files with 103 additions and 0 deletions
18
pkg/services/notificator/deps.go
Normal file
18
pkg/services/notificator/deps.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package notificator
|
||||
|
||||
import objectSDKAddress "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
|
||||
// NotificationSource is a source of object notifications.
|
||||
type NotificationSource interface {
|
||||
// Iterate must iterate over all notifications for the
|
||||
// provided epoch and call handler for all of them.
|
||||
Iterate(epoch uint64, handler func(topic string, addr *objectSDKAddress.Address))
|
||||
}
|
||||
|
||||
// NotificationWriter notifies all the subscribers
|
||||
// about new object notifications.
|
||||
type NotificationWriter interface {
|
||||
// Notify must send string representation of the object
|
||||
// address into the specified topic.
|
||||
Notify(topic string, address *objectSDKAddress.Address)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue