TODO(oxisto): This could be an interesting use case for 1.18 Go generics
(_ string)
| 351 | |
| 352 | // TODO(oxisto): This could be an interesting use case for 1.18 Go generics |
| 353 | func getCatalogs(_ string) []string { |
| 354 | var ( |
| 355 | err error |
| 356 | session *Session |
| 357 | client orchestrator.OrchestratorClient |
| 358 | res *orchestrator.ListCatalogsResponse |
| 359 | ) |
| 360 | |
| 361 | if session, err = ContinueSession(); err != nil { |
| 362 | fmt.Printf("Error while retrieving the session. Please re-authenticate.\n") |
| 363 | return nil |
| 364 | } |
| 365 | |
| 366 | client = orchestrator.NewOrchestratorClient(session) |
| 367 | |
| 368 | if res, err = client.ListCatalogs(context.Background(), &orchestrator.ListCatalogsRequest{}); err != nil { |
| 369 | return []string{} |
| 370 | } |
| 371 | |
| 372 | var output []string |
| 373 | for _, v := range res.Catalogs { |
| 374 | output = append(output, fmt.Sprintf("%s\t%s: %s", v.Id, v.Name, v.Description)) |
| 375 | } |
| 376 | |
| 377 | return output |
| 378 | } |
| 379 | |
| 380 | func getCategories(catalogID string, _ string) []string { |
| 381 | var ( |
no test coverage detected