diff --git a/changelog/unreleased/add-sse-event.md b/changelog/unreleased/add-sse-event.md new file mode 100644 index 0000000000..02b7d5a409 --- /dev/null +++ b/changelog/unreleased/add-sse-event.md @@ -0,0 +1,5 @@ +Enhancement: Add sse event + +Adds an event to issue sse notifications + +https://github.com/cs3org/reva/pull/4119 diff --git a/pkg/events/sse.go b/pkg/events/sse.go new file mode 100644 index 0000000000..34841c81f3 --- /dev/null +++ b/pkg/events/sse.go @@ -0,0 +1,19 @@ +package events + +import ( + "encoding/json" +) + +// SendSEE instructs the sse service to send a notification to a user +type SendSSE struct { + UserID string + Type string + Message []byte +} + +// Unmarshal to fulfill umarshaller interface +func (SendSSE) Unmarshal(v []byte) (interface{}, error) { + e := SendSSE{} + err := json.Unmarshal(v, &e) + return e, err +}