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)
| 263 | // }) |
| 264 | // }) |
| 265 | func 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 |
no test coverage detected