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)
| 197 | // }) |
| 198 | // }) |
| 199 | func 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 |
no test coverage detected