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

Method walkHTTPServices

expr/root.go:344–364  ·  view source on GitHub ↗

walkHTTPServices walks the HTTP services and endpoints.

(svcs []*HTTPServiceExpr, walk eval.SetWalker)

Source from the content-addressed store, hash-verified

342
343// walkHTTPServices walks the HTTP services and endpoints.
344func (r *RootExpr) walkHTTPServices(svcs []*HTTPServiceExpr, walk eval.SetWalker) {
345 sort.SliceStable(svcs, func(i, j int) bool {
346 return svcs[j].ParentName == svcs[i].Name()
347 })
348 var httpepts eval.ExpressionSet
349 var httpsvrs eval.ExpressionSet
350 httpsvcs := make(eval.ExpressionSet, len(svcs))
351 for i, svc := range svcs {
352 httpsvcs[i] = svc
353 for _, e := range svc.HTTPEndpoints {
354 httpepts = append(httpepts, e)
355 }
356 for _, s := range svc.FileServers {
357 httpsvrs = append(httpsvrs, s)
358 }
359 }
360 walk(eval.ExpressionSet{r.API.HTTP})
361 walk(httpsvcs)
362 walk(httpepts)
363 walk(httpsvrs)
364}
365
366// Dup creates a new map from the given expression.
367func (m MetaExpr) Dup() MetaExpr {

Callers 1

WalkSetsMethod · 0.95

Calls 2

walkFunction · 0.70
NameMethod · 0.65

Tested by

no test coverage detected