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.
()
| 456 | // That would be a lot of overhead, and a more costly unit test is |
| 457 | // written to make sure these match up. |
| 458 | func (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 | |
| 481 | func (w Workspace) RBACObject() rbac.Object { |
| 482 | return w.WorkspaceTable().RBACObject() |
no outgoing calls