2022-02-17 12:42:07 +00:00
|
|
|
package notificator
|
|
|
|
|
2022-05-31 17:00:41 +00:00
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
oid "github.com/TrueCloudLab/frostfs-sdk-go/object/id"
|
2022-05-31 17:00:41 +00:00
|
|
|
)
|
2022-02-17 12:42:07 +00:00
|
|
|
|
|
|
|
// 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.
|
2022-05-31 17:00:41 +00:00
|
|
|
Iterate(epoch uint64, handler func(topic string, addr oid.Address))
|
2022-02-17 12:42:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotificationWriter notifies all the subscribers
|
|
|
|
// about new object notifications.
|
|
|
|
type NotificationWriter interface {
|
2022-02-17 12:43:09 +00:00
|
|
|
// Notify must notify about an event generated
|
|
|
|
// from an object with a specific topic.
|
2022-05-31 17:00:41 +00:00
|
|
|
Notify(topic string, address oid.Address)
|
2022-02-17 12:42:07 +00:00
|
|
|
}
|