sse

package
v0.0.0-...-14e2bc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func KeepAlive

func KeepAlive()

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL