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

Function formatEndpoints

cmd/garm-cli/cmd/github_endpoints.go:269–289  ·  view source on GitHub ↗
(endpoints params.ForgeEndpoints)

Source from the content-addressed store, hash-verified

267}
268
269func formatEndpoints(endpoints params.ForgeEndpoints) {
270 if outputFormat == common.OutputFormatJSON {
271 printAsJSON(endpoints)
272 return
273 }
274 t := table.NewWriter()
275 header := table.Row{"Name", "Base URL", "Description"}
276 if long {
277 header = append(header, "Created At", "Updated At")
278 }
279 t.AppendHeader(header)
280 for _, val := range endpoints {
281 row := table.Row{val.Name, val.BaseURL, val.Description}
282 if long {
283 row = append(row, val.CreatedAt, val.UpdatedAt)
284 }
285 t.AppendRow(row)
286 t.AppendSeparator()
287 }
288 fmt.Println(t.Render())
289}
290
291func formatOneEndpoint(endpoint params.ForgeEndpoint) {
292 if outputFormat == common.OutputFormatJSON {

Callers 2

gitea_endpoints.goFile · 0.85

Calls 1

printAsJSONFunction · 0.85

Tested by

no test coverage detected