MCPcopy Index your code
hub / github.com/coder/coder / convertRows

Function convertRows

coderd/workspaceupdates.go:278–295  ·  view source on GitHub ↗
(rows []database.GetWorkspacesAndAgentsByOwnerIDRow)

Source from the content-addressed store, hash-verified

276}
277
278func convertRows(rows []database.GetWorkspacesAndAgentsByOwnerIDRow) workspacesByID {
279 out := workspacesByID{}
280 for _, row := range rows {
281 agents := []database.AgentIDNamePair{}
282 for _, agent := range row.Agents {
283 agents = append(agents, database.AgentIDNamePair{
284 ID: agent.ID,
285 Name: agent.Name,
286 })
287 }
288 out[row.ID] = ownedWorkspace{
289 WorkspaceName: row.Name,
290 Status: tailnet.WorkspaceStatusToProto(codersdk.ConvertWorkspaceStatus(codersdk.ProvisionerJobStatus(row.JobStatus), codersdk.WorkspaceTransition(row.Transition))),
291 Agents: agents,
292 }
293 }
294 return out
295}
296
297type rbacAuthorizer struct {
298 sshPrep rbac.PreparedAuthorized

Callers 2

handleEventMethod · 0.85
startMethod · 0.85

Calls 4

WorkspaceStatusToProtoFunction · 0.92
ConvertWorkspaceStatusFunction · 0.92
ProvisionerJobStatusTypeAlias · 0.92
WorkspaceTransitionTypeAlias · 0.92

Tested by

no test coverage detected