(apiVersions []schema.APIVersion)
| 501 | } |
| 502 | |
| 503 | func 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 | |
| 520 | func titleStr(title string) string { |
| 521 | return "\n" + console.Bold(title) + "\n" |
no test coverage detected