sse

package
v0.0.0-...-5f3b442 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleSSEConnections

func HandleSSEConnections(c *gin.Context)

Function to handle SSE connections

func SendMessageToClient

func SendMessageToClient(message SSEMessage)

Function to send a message to all clients

Types

type MessageEvent

type MessageEvent string
const (
	MessageEventDeleted  MessageEvent = "Deleted"
	MessageEventModified MessageEvent = "Modified"
	MessageEventAdded    MessageEvent = "Added"
)

type MessageType

type MessageType string
const (
	MessageTypeSuccess MessageType = "success"
	MessageTypeError   MessageType = "error"
)

type SSEMessage

type SSEMessage struct {
	Type    MessageType  `json:"type"`
	Data    string       `json:"data"`
	Event   MessageEvent `json:"event"`
	Target  string       `json:"target"`
	CRDType string       `json:"crdType"`
}

Jump to

Keyboard shortcuts

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