Skip to content

Commit

Permalink
sse event
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Aug 18, 2023
1 parent e3a2be9 commit 4a60f7b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/add-sse-event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add sse event

Adds an event to issue sse notifications

https://github.com/cs3org/reva/pull/4118
18 changes: 18 additions & 0 deletions pkg/events/sse.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package events

import (
"encoding/json"
)

// SendUserNotification instructs the sse service to send a notification to a user
type SendUserNotification struct {
UserID string
Message []byte
}

// Unmarshal to fulfill umarshaller interface
func (SendUserNotification) Unmarshal(v []byte) (interface{}, error) {
e := SendUserNotification{}
err := json.Unmarshal(v, &e)
return e, err
}

0 comments on commit 4a60f7b

Please sign in to comment.