MCPcopy
hub / github.com/gin-gonic/gin / SSEvent

Method SSEvent

context.go:1313–1318  ·  view source on GitHub ↗

SSEvent writes a Server-Sent Event into the body stream.

(name string, message any)

Source from the content-addressed store, hash-verified

1311
1312// SSEvent writes a Server-Sent Event into the body stream.
1313func (c *Context) SSEvent(name string, message any) {
1314 c.Render(-1, sse.Event{
1315 Event: name,
1316 Data: message,
1317 })
1318}
1319
1320// Stream sends a streaming response and returns a boolean
1321// indicates "Is client disconnected in middle of stream"

Callers 1

TestContextRenderSSEFunction · 0.80

Calls 1

RenderMethod · 0.95

Tested by 1

TestContextRenderSSEFunction · 0.64