MCPcopy Index your code
hub / github.com/cortexlabs/cortex / realtimeAPIsTable

Function realtimeAPIsTable

cli/cmd/lib_realtime_apis.go:83–110  ·  view source on GitHub ↗
(realtimeAPIs []schema.APIResponse, envNames []string)

Source from the content-addressed store, hash-verified

81}
82
83func 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}

Callers 4

realtimeAPITableFunction · 0.85
realtimeDescribeAPITableFunction · 0.85
getAPIsInAllEnvironmentsFunction · 0.85
getAPIsByEnvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected