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

Function hasJSONRPCSSE

jsonrpc/codegen/server.go:172–186  ·  view source on GitHub ↗

hasJSONRPCSSE returns true if the service uses SSE for JSON-RPC streaming.

(svc *expr.HTTPServiceExpr, data *httpcodegen.ServicesData)

Source from the content-addressed store, hash-verified

170
171// hasJSONRPCSSE returns true if the service uses SSE for JSON-RPC streaming.
172func hasJSONRPCSSE(svc *expr.HTTPServiceExpr, data *httpcodegen.ServicesData) bool {
173 svcData := data.Get(svc.Name())
174 if svcData == nil {
175 return false
176 }
177
178 // Check if any JSON-RPC streaming endpoint uses SSE
179 for _, e := range svc.HTTPEndpoints {
180 if e.MethodExpr.IsStreaming() && e.IsJSONRPC() && e.SSE != nil {
181 return true
182 }
183 }
184
185 return false
186}
187
188// hasJSONRPCHTTP returns true if the service has non-streaming JSON-RPC endpoints.
189func hasJSONRPCHTTP(svc *expr.HTTPServiceExpr) bool {

Callers 3

ServerFilesFunction · 0.85
serverFileFunction · 0.85

Calls 4

IsJSONRPCMethod · 0.80
NameMethod · 0.65
GetMethod · 0.45
IsStreamingMethod · 0.45

Tested by

no test coverage detected