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

Function comprehensiveWebSocketDSL

http/codegen/websocket_golden_test.go:470–527  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

468}
469
470func comprehensiveWebSocketDSL() {
471 var UserType = ResultType("User", func() {
472 Attributes(func() {
473 Attribute("id", String)
474 Attribute("name", String)
475 Attribute("email", String, func() {
476 Format("email")
477 })
478 })
479 Required("id", "name")
480 View("default", func() {
481 Attribute("id")
482 Attribute("name")
483 Attribute("email")
484 })
485 View("tiny", func() {
486 Attribute("id")
487 })
488 })
489
490 Service("TestService", func() {
491 Method("ServerStreaming", func() {
492 StreamingResult(UserType)
493 HTTP(func() {
494 GET("/server-stream")
495 })
496 })
497
498 Method("ClientStreaming", func() {
499 StreamingPayload(func() {
500 Attribute("data", String, func() {
501 MinLength(1)
502 })
503 Required("data")
504 })
505 Result(String)
506 HTTP(func() {
507 GET("/client-stream")
508 })
509 })
510
511 Method("BidirectionalStreaming", func() {
512 StreamingPayload(UserType)
513 StreamingResult(UserType)
514 HTTP(func() {
515 GET("/bidirectional")
516 })
517 })
518
519 Method("RegularMethod", func() {
520 Payload(String)
521 Result(String)
522 HTTP(func() {
523 POST("/regular")
524 })
525 })
526 })
527}

Callers

nothing calls this directly

Calls 15

ResultTypeFunction · 0.85
AttributesFunction · 0.85
AttributeFunction · 0.85
RequiredFunction · 0.85
ViewFunction · 0.85
MethodFunction · 0.85
StreamingResultFunction · 0.85
GETFunction · 0.85
StreamingPayloadFunction · 0.85
MinLengthFunction · 0.85
ResultFunction · 0.85
PayloadFunction · 0.85

Tested by

no test coverage detected