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

Method FullPaths

expr/http_endpoint.go:1083–1102  ·  view source on GitHub ↗

FullPaths returns the endpoint full paths computed by concatenating the service base paths with the route specific path.

()

Source from the content-addressed store, hash-verified

1081// FullPaths returns the endpoint full paths computed by concatenating the
1082// service base paths with the route specific path.
1083func (r *RouteExpr) FullPaths() []string {
1084 if r.IsAbsolute() {
1085 return []string{httppath.Clean(r.Path[1:])}
1086 }
1087 bases := r.Endpoint.Service.FullPaths()
1088 res := make([]string, len(bases))
1089 for i, b := range bases {
1090 res[i] = httppath.Clean(path.Join(b, r.Path))
1091 if res[i] == "/" {
1092 continue
1093 }
1094 // path has trailing slash
1095 if r.Path == "/" && strings.HasSuffix(b, "/") {
1096 res[i] += "/"
1097 } else if r.Path != "/" && strings.HasSuffix(r.Path, "/") {
1098 res[i] += "/"
1099 }
1100 }
1101 return res
1102}
1103
1104// IsAbsolute returns true if the endpoint path should not be concatenated to
1105// the service and API base paths.

Callers 6

ValidateMethod · 0.95
ParamsMethod · 0.95
analyzeMethod · 0.45
toSchemaHrefsFunction · 0.45
buildPathFromExprFunction · 0.45
buildPathsFunction · 0.45

Calls 1

IsAbsoluteMethod · 0.95

Tested by

no test coverage detected