MCPcopy Create free account
hub / github.com/goadesign/goa / SSEEventType

Function SSEEventType

dsl/sse.go:265–276  ·  view source on GitHub ↗

SSEEventType defines the attribute of the StreamingResult type that provides the event field (event type) for a Server-Sent Event. The attribute must exist in the StreamingResult type and must be of type String. SSEEventType must appear in a `ServerSentEvents` expression. SSEEventType accepts a si

(name string)

Source from the content-addressed store, hash-verified

263// })
264// })
265func SSEEventType(name string) {
266 if name == "" {
267 eval.ReportError("event field name cannot be empty")
268 return
269 }
270 sse, ok := eval.Current().(*expr.HTTPSSEExpr)
271 if !ok {
272 eval.IncompatibleDSL()
273 return
274 }
275 sse.EventField = name
276}
277
278// SSEEventRetry defines the attribute of the StreamingResult type that provides
279// the retry field for a Server-Sent Event. The attribute must exist in the

Callers 1

sse_dsls.goFile · 0.85

Calls 3

ReportErrorFunction · 0.92
CurrentFunction · 0.92
IncompatibleDSLFunction · 0.92

Tested by

no test coverage detected