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