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

Function getCategories

cli/session.go:380–405  ·  view source on GitHub ↗
(catalogID string, _ string)

Source from the content-addressed store, hash-verified

378}
379
380func 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
407func getControls(catalogID string, categoryName string, _ string) []string {
408 var (

Callers 2

ValidArgsGetCategoryFunction · 0.85
ValidArgsGetControlsFunction · 0.85

Calls 3

NewOrchestratorClientFunction · 0.92
ContinueSessionFunction · 0.85
GetCatalogMethod · 0.65

Tested by

no test coverage detected