MCPcopy Create free account
hub / github.com/cloudbase/garm / formatGithubCredentials

Function formatGithubCredentials

cmd/garm-cli/cmd/github_credentials.go:347–367  ·  view source on GitHub ↗
(creds []params.ForgeCredentials)

Source from the content-addressed store, hash-verified

345}
346
347func formatGithubCredentials(creds []params.ForgeCredentials) {
348 if outputFormat == common.OutputFormatJSON {
349 printAsJSON(creds)
350 return
351 }
352 t := table.NewWriter()
353 header := table.Row{"ID", "Name", "Description", "Base URL", "API URL", "Upload URL", "Type"}
354 if long {
355 header = append(header, "Created At", "Updated At")
356 }
357 t.AppendHeader(header)
358 for _, val := range creds {
359 row := table.Row{val.ID, val.Name, val.Description, val.BaseURL, val.APIBaseURL, val.UploadBaseURL, val.AuthType}
360 if long {
361 row = append(row, val.CreatedAt, val.UpdatedAt)
362 }
363 t.AppendRow(row)
364 t.AppendSeparator()
365 }
366 fmt.Println(t.Render())
367}
368
369func formatOneGithubCredential(cred params.ForgeCredentials) {
370 if outputFormat == common.OutputFormatJSON {

Callers 1

Calls 1

printAsJSONFunction · 0.85

Tested by

no test coverage detected