SSEEventRetry defines the attribute of the StreamingResult type that provides the retry field for a Server-Sent Event. The attribute must exist in the StreamingResult type and must be of type Int or UInt. SSEEventRetry must appear in a `ServerSentEvents` expression. SSEEventRetry accepts a single
(name string)
| 296 | // }) |
| 297 | // }) |
| 298 | func SSEEventRetry(name string) { |
| 299 | if name == "" { |
| 300 | eval.ReportError("retry field name cannot be empty") |
| 301 | return |
| 302 | } |
| 303 | sse, ok := eval.Current().(*expr.HTTPSSEExpr) |
| 304 | if !ok { |
| 305 | eval.IncompatibleDSL() |
| 306 | return |
| 307 | } |
| 308 | sse.RetryField = name |
| 309 | } |
no test coverage detected