Documentation ¶
Index ¶
- func Init()
- func KeepAlive()
- func SendWelcomeMessage(client apicontracts.SSEClient)
- type SSE
- func (sse *SSE) BroadcastMessage(payload ssemodels.SseMessage)
- func (sse *SSE) HandleSSE() gin.HandlerFunc
- func (sse *SSE) Send() gin.HandlerFunc
- func (sse *SSE) SendToUsersWithGroup(payload ssemodels.SseMessage, group string)
- func (sse *SSE) SendToUsersWithGroups(payload ssemodels.SseMessage, groups []string)
- type SSEInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendWelcomeMessage ¶
func SendWelcomeMessage(client apicontracts.SSEClient)
Types ¶
type SSE ¶
type SSE struct { Clients []apicontracts.SSEClient // contains filtered or unexported fields }
var (
Server *SSE
)
func (*SSE) BroadcastMessage ¶
func (sse *SSE) BroadcastMessage(payload ssemodels.SseMessage)
func (*SSE) HandleSSE ¶
func (sse *SSE) HandleSSE() gin.HandlerFunc
@Summary Server sent events @Schemes @Description Listen to server sent events @Tags events @Accept text/event-stream @Produce text/event-stream @Success 200 {string} string "ok" @Failure 403 {object} rorerror.RorError @Failure 401 {object} rorerror.RorError @Failure 500 {object} rorerror.RorError @Router /v1/events/listen [get] @Security ApiKey || AccessToken
func (*SSE) Send ¶
func (sse *SSE) Send() gin.HandlerFunc
func (*SSE) SendToUsersWithGroup ¶
func (sse *SSE) SendToUsersWithGroup(payload ssemodels.SseMessage, group string)
func (*SSE) SendToUsersWithGroups ¶
func (sse *SSE) SendToUsersWithGroups(payload ssemodels.SseMessage, groups []string)
type SSEInterface ¶
type SSEInterface interface { HandleSSE() gin.HandlerFunc SendMessage(topic string, payload string) }
Click to show internal directories.
Click to hide internal directories.