OrderedParamsFromUri returns the argument names, in order, in a given URI string, so for path/{param1}/{.param2*}/{?param3}, it would return param1, param2, param3
(uri string)
| 656 | // OrderedParamsFromUri returns the argument names, in order, in a given URI string, so for |
| 657 | // /path/{param1}/{.param2*}/{?param3}, it would return param1, param2, param3 |
| 658 | func OrderedParamsFromUri(uri string) []string { |
| 659 | matches := pathParamRE.FindAllStringSubmatch(uri, -1) |
| 660 | result := make([]string, len(matches)) |
| 661 | for i, m := range matches { |
| 662 | result[i] = m[1] |
| 663 | } |
| 664 | return result |
| 665 | } |
| 666 | |
| 667 | // ReplacePathParamsWithStr replaces path parameters of the form {param} with %s |
| 668 | func ReplacePathParamsWithStr(uri string) string { |
no outgoing calls