parseGroupName parses the group name from the provided set of params, in this api these params are derived from the url path
(params map[string]string)
| 456 | // parseGroupName parses the group name from the provided set of params, in this |
| 457 | // api these params are derived from the url path |
| 458 | func parseGroupName(params map[string]string) (string, error) { |
| 459 | groupName, exists := params["groupName"] |
| 460 | if !exists { |
| 461 | return "", ErrNoGroupName |
| 462 | } |
| 463 | |
| 464 | groupName, err := url.PathUnescape(groupName) |
| 465 | if err != nil { |
| 466 | return "", err |
| 467 | } |
| 468 | |
| 469 | return groupName, nil |
| 470 | } |
| 471 | |
| 472 | // parseRequest parses the incoming request to parse out the userID, rules namespace, and rule group name |
| 473 | // and returns them in that order. It also allows users to require a namespace or group name and return |