parseResource converts resource string to ManagementResource enum
(resource string)
| 92 | |
| 93 | // parseResource converts resource string to ManagementResource enum |
| 94 | func parseResource(resource string) (cfapi.ManagementResource, error) { |
| 95 | switch resource { |
| 96 | case "logs": |
| 97 | return cfapi.Logs, nil |
| 98 | case "admin": |
| 99 | return cfapi.Admin, nil |
| 100 | case "host_details": |
| 101 | return cfapi.HostDetails, nil |
| 102 | default: |
| 103 | return 0, fmt.Errorf("must be one of: logs, admin, host_details") |
| 104 | } |
| 105 | } |