ExtractHTTPWildcards returns the names of the wildcards that appear in a HTTP path.
(path string)
| 42 | // ExtractHTTPWildcards returns the names of the wildcards that appear in |
| 43 | // a HTTP path. |
| 44 | func ExtractHTTPWildcards(path string) []string { |
| 45 | matches := HTTPWildcardRegex.FindAllStringSubmatch(path, -1) |
| 46 | wcs := make([]string, len(matches)) |
| 47 | for i, m := range matches { |
| 48 | wcs[i] = m[1] |
| 49 | } |
| 50 | return wcs |
| 51 | } |
| 52 | |
| 53 | // Service returns the service with the given name if any. |
| 54 | func (h *HTTPExpr) Service(name string) *HTTPServiceExpr { |
no outgoing calls
no test coverage detected