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

Function clientStructWSSections

http/codegen/websocket.go:383–401  ·  view source on GitHub ↗

clientStructWSSections return section templates that generate WebSocket related struct type definitions for the client.

(data *ServiceData)

Source from the content-addressed store, hash-verified

381// clientStructWSSections return section templates that generate WebSocket
382// related struct type definitions for the client.
383func clientStructWSSections(data *ServiceData) []*codegen.SectionTemplate {
384 var sections []*codegen.SectionTemplate
385 sections = append(sections, &codegen.SectionTemplate{
386 Name: "client-websocket-conn-configurer-struct",
387 Source: httpTemplates.Read(websocketConnConfigurerStructT),
388 Data: data,
389 FuncMap: map[string]any{"isWebSocketEndpoint": IsWebSocketEndpoint},
390 })
391 for _, e := range data.Endpoints {
392 if e.ClientWebSocket != nil {
393 sections = append(sections, &codegen.SectionTemplate{
394 Name: "client-websocket-struct-type",
395 Source: httpTemplates.Read(websocketStructTypeT),
396 Data: e.ClientWebSocket,
397 })
398 }
399 }
400 return sections
401}
402
403// clientWSSections returns section templates that contain client WebSocket
404// specific code for the given service.

Callers 1

WebsocketClientFileFunction · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected