()
| 357 | } |
| 358 | |
| 359 | func bidirectionalStreamingWithViewsDSL() { |
| 360 | var Request = Type("Request", func() { |
| 361 | Attribute("id", String) |
| 362 | Attribute("data", String) |
| 363 | Required("id", "data") |
| 364 | }) |
| 365 | |
| 366 | var Response = ResultType("Response", func() { |
| 367 | Attributes(func() { |
| 368 | Attribute("id", String) |
| 369 | Attribute("result", String) |
| 370 | Attribute("metadata", func() { |
| 371 | Attribute("timestamp", Int64) |
| 372 | Attribute("source", String) |
| 373 | }) |
| 374 | }) |
| 375 | Required("id", "result") |
| 376 | View("default", func() { |
| 377 | Attribute("id") |
| 378 | Attribute("result") |
| 379 | Attribute("metadata") |
| 380 | }) |
| 381 | View("minimal", func() { |
| 382 | Attribute("id") |
| 383 | Attribute("result") |
| 384 | }) |
| 385 | }) |
| 386 | |
| 387 | Service("TestService", func() { |
| 388 | Method("BidirectionalWithViews", func() { |
| 389 | StreamingPayload(Request) |
| 390 | StreamingResult(Response) |
| 391 | HTTP(func() { |
| 392 | GET("/bidirectional/views") |
| 393 | }) |
| 394 | }) |
| 395 | }) |
| 396 | } |
| 397 | |
| 398 | func noPayloadStreamingDSL() { |
| 399 | Service("TestService", func() { |
nothing calls this directly
no test coverage detected