MCPcopy
hub / github.com/cortexlabs/cortex / apiHistoryTable

Function apiHistoryTable

cli/cmd/get.go:503–518  ·  view source on GitHub ↗
(apiVersions []schema.APIVersion)

Source from the content-addressed store, hash-verified

501}
502
503func apiHistoryTable(apiVersions []schema.APIVersion) string {
504 t := table.Table{
505 Headers: []table.Header{
506 {Title: "api id"},
507 {Title: "last deployed"},
508 },
509 }
510
511 t.Rows = make([][]interface{}, len(apiVersions))
512 for i, apiVersion := range apiVersions {
513 lastUpdated := time.Unix(apiVersion.LastUpdated, 0)
514 t.Rows[i] = []interface{}{apiVersion.APIID, libtime.SinceStr(&lastUpdated)}
515 }
516
517 return t.MustFormat(&table.Opts{Sort: pointer.Bool(false)})
518}
519
520func titleStr(title string) string {
521 return "\n" + console.Bold(title) + "\n"

Callers 5

taskAPITableFunction · 0.85
realtimeAPITableFunction · 0.85
asyncAPITableFunction · 0.85
trafficSplitterTableFunction · 0.85
batchAPITableFunction · 0.85

Calls 2

MustFormatMethod · 0.95
BoolFunction · 0.92

Tested by

no test coverage detected