MCPcopy Create free account
hub / github.com/clouditor/clouditor / getCatalogs

Function getCatalogs

cli/session.go:353–378  ·  view source on GitHub ↗

TODO(oxisto): This could be an interesting use case for 1.18 Go generics

(_ string)

Source from the content-addressed store, hash-verified

351
352// TODO(oxisto): This could be an interesting use case for 1.18 Go generics
353func 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
380func getCategories(catalogID string, _ string) []string {
381 var (

Callers 3

ValidArgsGetCatalogsFunction · 0.85
ValidArgsGetCategoryFunction · 0.85
ValidArgsGetControlsFunction · 0.85

Calls 3

NewOrchestratorClientFunction · 0.92
ContinueSessionFunction · 0.85
ListCatalogsMethod · 0.65

Tested by

no test coverage detected