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

Method Params

expr/server.go:257–268  ·  view source on GitHub ↗

Params return the names of the parameters used in URI if any.

()

Source from the content-addressed store, hash-verified

255
256// Params return the names of the parameters used in URI if any.
257func (u URIExpr) Params() []string {
258 r := regexp.MustCompile(`\{([^\{\}]+)\}`)
259 matches := r.FindAllStringSubmatch(string(u), -1)
260 if len(matches) == 0 {
261 return nil
262 }
263 wcs := make([]string, len(matches))
264 for i, m := range matches {
265 wcs[i] = m[1]
266 }
267 return wcs
268}
269
270// Scheme returns the URI scheme. Possible values are http, https, grpc, and
271// grpcs.

Callers 1

URIStringMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected