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

Function getTools

cli/session.go:297–322  ·  view source on GitHub ↗
(_ string)

Source from the content-addressed store, hash-verified

295}
296
297func getTools(_ string) []string {
298 var (
299 err error
300 session *Session
301 client orchestrator.OrchestratorClient
302 res *orchestrator.ListAssessmentToolsResponse
303 )
304
305 if session, err = ContinueSession(); err != nil {
306 fmt.Printf("Error while retrieving the session. Please re-authenticate.\n")
307 return nil
308 }
309
310 client = orchestrator.NewOrchestratorClient(session)
311
312 if res, err = client.ListAssessmentTools(context.Background(), &orchestrator.ListAssessmentToolsRequest{}); err != nil {
313 return []string{}
314 }
315
316 var tools []string
317 for _, v := range res.Tools {
318 tools = append(tools, fmt.Sprintf("%s\t%s: %s", v.Id, v.Name, v.Description))
319 }
320
321 return tools
322}
323
324// TODO(oxisto): This could be an interesting use case for 1.18 Go generics
325func getMetrics(_ string) []string {

Callers 1

ValidArgsGetToolsFunction · 0.85

Calls 3

NewOrchestratorClientFunction · 0.92
ContinueSessionFunction · 0.85
ListAssessmentToolsMethod · 0.65

Tested by

no test coverage detected