Add event for updating things
This commit is contained in:
parent
80afab3bc0
commit
b1036730c4
2 changed files with 32 additions and 11 deletions
|
@ -31,6 +31,7 @@ const (
|
|||
EventTypeTaskCompleted EventType = "task.completed"
|
||||
EventTypeTaskReassigned EventType = "task.reassigned"
|
||||
EventTypeTaskSkipped EventType = "task.skipped"
|
||||
EventTypeThingChanged EventType = "thing.changed"
|
||||
)
|
||||
|
||||
type Event struct {
|
||||
|
@ -162,3 +163,12 @@ func (p *EventsProducer) NotificationEvent(ctx context.Context, url string, even
|
|||
Data: event,
|
||||
})
|
||||
}
|
||||
|
||||
func (p *EventsProducer) ThingsUpdated(ctx context.Context, url string, data interface{}) {
|
||||
p.publishEvent(Event{
|
||||
URL: url,
|
||||
Type: EventTypeThingChanged,
|
||||
Timestamp: time.Now(),
|
||||
Data: data,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue