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

Method TaskTable

coderd/database/modelmethods.go:160–174  ·  view source on GitHub ↗

TaskTable converts a Task 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

158// That would be a lot of overhead, and a more costly unit test is
159// written to make sure these match up.
160func (t Task) TaskTable() TaskTable {
161 return TaskTable{
162 ID: t.ID,
163 OrganizationID: t.OrganizationID,
164 OwnerID: t.OwnerID,
165 Name: t.Name,
166 DisplayName: t.DisplayName,
167 WorkspaceID: t.WorkspaceID,
168 TemplateVersionID: t.TemplateVersionID,
169 TemplateParameters: t.TemplateParameters,
170 Prompt: t.Prompt,
171 CreatedAt: t.CreatedAt,
172 DeletedAt: t.DeletedAt,
173 }
174}
175
176func (t Task) RBACObject() rbac.Object {
177 obj := rbac.ResourceTask.

Callers 3

TestTaskTableConvertFunction · 0.95
taskUpdateInputMethod · 0.80
TestTasksMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestTaskTableConvertFunction · 0.76
TestTasksMethod · 0.64