TODO(oxisto): This could be an interesting use case for 1.18 Go generics
(_ string)
| 323 | |
| 324 | // TODO(oxisto): This could be an interesting use case for 1.18 Go generics |
| 325 | func getMetrics(_ string) []string { |
| 326 | var ( |
| 327 | err error |
| 328 | session *Session |
| 329 | client orchestrator.OrchestratorClient |
| 330 | res *orchestrator.ListMetricsResponse |
| 331 | ) |
| 332 | |
| 333 | if session, err = ContinueSession(); err != nil { |
| 334 | fmt.Printf("Error while retrieving the session. Please re-authenticate.\n") |
| 335 | return nil |
| 336 | } |
| 337 | |
| 338 | client = orchestrator.NewOrchestratorClient(session) |
| 339 | |
| 340 | if res, err = client.ListMetrics(context.Background(), &orchestrator.ListMetricsRequest{}); err != nil { |
| 341 | return []string{} |
| 342 | } |
| 343 | |
| 344 | var metrics []string |
| 345 | for _, v := range res.Metrics { |
| 346 | metrics = append(metrics, fmt.Sprintf("%s\t%s: %s", v.Id, v.Name, v.Description)) |
| 347 | } |
| 348 | |
| 349 | return metrics |
| 350 | } |
| 351 | |
| 352 | // TODO(oxisto): This could be an interesting use case for 1.18 Go generics |
| 353 | func getCatalogs(_ string) []string { |
no test coverage detected