forked from cs3org/reva
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: jkoberg <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/4119 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |