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

Function asyncAPIsTable

cli/cmd/lib_async_apis.go:84–111  ·  view source on GitHub ↗
(asyncAPIs []schema.APIResponse, envNames []string)

Source from the content-addressed store, hash-verified

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

Callers 4

asyncAPITableFunction · 0.85
asyncDescribeAPITableFunction · 0.85
getAPIsInAllEnvironmentsFunction · 0.85
getAPIsByEnvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected