(catalogID string, _ string)
| 378 | } |
| 379 | |
| 380 | func getCategories(catalogID string, _ string) []string { |
| 381 | var ( |
| 382 | err error |
| 383 | session *Session |
| 384 | client orchestrator.OrchestratorClient |
| 385 | res *orchestrator.Catalog |
| 386 | ) |
| 387 | |
| 388 | if session, err = ContinueSession(); err != nil { |
| 389 | fmt.Printf("Error while retrieving the session. Please re-authenticate.\n") |
| 390 | return nil |
| 391 | } |
| 392 | |
| 393 | client = orchestrator.NewOrchestratorClient(session) |
| 394 | |
| 395 | if res, err = client.GetCatalog(context.Background(), &orchestrator.GetCatalogRequest{CatalogId: catalogID}); err != nil { |
| 396 | return []string{} |
| 397 | } |
| 398 | |
| 399 | var output []string |
| 400 | for _, v := range res.Categories { |
| 401 | output = append(output, fmt.Sprintf("%s\t%s", v.Name, v.Description)) |
| 402 | } |
| 403 | |
| 404 | return output |
| 405 | } |
| 406 | |
| 407 | func getControls(catalogID string, categoryName string, _ string) []string { |
| 408 | var ( |
no test coverage detected