(asyncAPIs []schema.APIResponse, envNames []string)
| 82 | } |
| 83 | |
| 84 | func asyncAPIsTable(asyncAPIs []schema.APIResponse, envNames []string) table.Table { |
| 85 | rows := make([][]interface{}, 0, len(asyncAPIs)) |
| 86 | |
| 87 | for i, asyncAPI := range asyncAPIs { |
| 88 | if asyncAPI.Metadata == nil || asyncAPI.Status == nil { |
| 89 | continue |
| 90 | } |
| 91 | lastUpdated := time.Unix(asyncAPI.Metadata.LastUpdated, 0) |
| 92 | rows = append(rows, []interface{}{ |
| 93 | envNames[i], |
| 94 | asyncAPI.Metadata.Name, |
| 95 | fmt.Sprintf("%d/%d", asyncAPI.Status.Ready, asyncAPI.Status.Requested), |
| 96 | asyncAPI.Status.UpToDate, |
| 97 | libtime.SinceStr(&lastUpdated), |
| 98 | }) |
| 99 | } |
| 100 | |
| 101 | return table.Table{ |
| 102 | Headers: []table.Header{ |
| 103 | {Title: _titleEnvironment}, |
| 104 | {Title: _titleAsyncAPI}, |
| 105 | {Title: _titleLive}, |
| 106 | {Title: _titleUpToDate}, |
| 107 | {Title: _titleLastUpdated}, |
| 108 | }, |
| 109 | Rows: rows, |
| 110 | } |
| 111 | } |
no outgoing calls
no test coverage detected