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

Function SSEEventData

dsl/sse.go:199–210  ·  view source on GitHub ↗

SSEEventData defines the attribute of the StreamingResult type that provides the data field for a Server-Sent Event. The attribute must exist in the StreamingResult type. SSEEventData must appear in a `ServerSentEvents` expression. SSEEventData accepts a single argument: the name of the attribute

(name string)

Source from the content-addressed store, hash-verified

197// })
198// })
199func SSEEventData(name string) {
200 if name == "" {
201 eval.ReportError("data field name cannot be empty")
202 return
203 }
204 sse, ok := eval.Current().(*expr.HTTPSSEExpr)
205 if !ok {
206 eval.IncompatibleDSL()
207 return
208 }
209 sse.DataField = name
210}
211
212// SSEEventID defines the attribute of the StreamingResult type that provides the
213// id 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