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

Method WorkspaceTable

coderd/database/modelmethods.go:458–479  ·  view source on GitHub ↗

WorkspaceTable converts a Workspace to it's reduced version. A more generalized solution is to use json marshaling to consistently keep these two structs in sync. That would be a lot of overhead, and a more costly unit test is written to make sure these match up.

()

Source from the content-addressed store, hash-verified

456// That would be a lot of overhead, and a more costly unit test is
457// written to make sure these match up.
458func (w Workspace) WorkspaceTable() WorkspaceTable {
459 return WorkspaceTable{
460 ID: w.ID,
461 CreatedAt: w.CreatedAt,
462 UpdatedAt: w.UpdatedAt,
463 OwnerID: w.OwnerID,
464 OrganizationID: w.OrganizationID,
465 TemplateID: w.TemplateID,
466 Deleted: w.Deleted,
467 Name: w.Name,
468 AutostartSchedule: w.AutostartSchedule,
469 Ttl: w.Ttl,
470 LastUsedAt: w.LastUsedAt,
471 DormantAt: w.DormantAt,
472 DeletingAt: w.DeletingAt,
473 AutomaticUpdates: w.AutomaticUpdates,
474 Favorite: w.Favorite,
475 NextStartAt: w.NextStartAt,
476 GroupACL: w.GroupACL,
477 UserACL: w.UserACL,
478 }
479}
480
481func (w Workspace) RBACObject() rbac.Object {
482 return w.WorkspaceTable().RBACObject()

Callers 15

RBACObjectMethod · 0.95
createWorkspaceFunction · 0.80
patchWorkspaceMethod · 0.80
putWorkspaceAutostartMethod · 0.80
putWorkspaceTTLMethod · 0.80
putWorkspaceDormantMethod · 0.80
putFavoriteWorkspaceMethod · 0.80
patchWorkspaceACLMethod · 0.80

Calls

no outgoing calls

Tested by 1