getCommandsMap iterates through the commands and returns a map of command
(commands []v1alpha2.Command)
| 36 | |
| 37 | // getCommandsMap iterates through the commands and returns a map of command |
| 38 | func getCommandsMap(commands []v1alpha2.Command) map[string]v1alpha2.Command { |
| 39 | commandMap := make(map[string]v1alpha2.Command, len(commands)) |
| 40 | |
| 41 | for _, command := range commands { |
| 42 | command.Id = strings.ToLower(command.Id) |
| 43 | commandMap[command.Id] = command |
| 44 | } |
| 45 | |
| 46 | return commandMap |
| 47 | } |
| 48 | |
| 49 | // ValidateURI checks if the string is with valid uri format, return error if not valid |
| 50 | func ValidateURI(uri string) error { |
no outgoing calls