Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationSource ¶
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 oid.Address)) }
NotificationSource is a source of object notifications.
type NotificationWriter ¶
type NotificationWriter interface { // Notify must notify about an event generated // from an object with a specific topic. Notify(topic string, address oid.Address) }
NotificationWriter notifies all the subscribers about new object notifications.
type Notificator ¶
type Notificator struct {
// contains filtered or unexported fields
}
Notificator is a notification producer that handles objects with defined notification epoch.
Working client must be created via constructor New. Using the Client that has been created with new(Client) expression (or just declaring a Client variable) is unsafe and can lead to panic.
func New ¶
func New(prm *Prm) *Notificator
New creates, initializes and returns the Notificator instance.
Panics if any field of the passed Prm structure is not set/set to nil.
func (*Notificator) ProcessEpoch ¶
func (n *Notificator) ProcessEpoch(epoch uint64)
ProcessEpoch looks for all objects with defined epoch in the storage and passes their addresses to the NotificationWriter.
type Prm ¶
type Prm struct {
// contains filtered or unexported fields
}
Prm groups Notificator constructor's parameters. All are required.
func (*Prm) SetNotificationSource ¶
func (prm *Prm) SetNotificationSource(v NotificationSource) *Prm
SetNotificationSource sets notification source.
func (*Prm) SetWriter ¶
func (prm *Prm) SetWriter(v NotificationWriter) *Prm
SetWriter sets notification writer.