Skip to content

Commit

Permalink
Merge pull request #4119 from kobergj/SSEServiceEvents
Browse files Browse the repository at this point in the history
SSE Event
  • Loading branch information
kobergj authored Aug 24, 2023
2 parents 6f3a1df + 4d34cb8 commit 1314c34
Show file tree
Hide file tree
Showing 2 changed files with 24 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/4119
19 changes: 19 additions & 0 deletions pkg/events/sse.go
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
}

0 comments on commit 1314c34

Please sign in to comment.