-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4119 from kobergj/SSEServiceEvents
SSE Event
- Loading branch information
Showing
2 changed files
with
24 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,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 | ||
} |