(id, hostID, jobID, patchType string, pkgName *string, pkgNames []byte, status, shellOutput string, errMsg *string, startedAt, completedAt, scheduledAt pgtype.Timestamp, createdAt, updatedAt pgtype.Timestamp, hostFriendly, hostHostname, triggeredByUsername *string)
| 1521 | } |
| 1522 | |
| 1523 | func patchRunRowToMap(id, hostID, jobID, patchType string, pkgName *string, pkgNames []byte, status, shellOutput string, errMsg *string, startedAt, completedAt, scheduledAt pgtype.Timestamp, createdAt, updatedAt pgtype.Timestamp, hostFriendly, hostHostname, triggeredByUsername *string) map[string]interface{} { |
| 1524 | m := map[string]interface{}{ |
| 1525 | "id": id, |
| 1526 | "host_id": hostID, |
| 1527 | "job_id": jobID, |
| 1528 | "patch_type": patchType, |
| 1529 | "package_name": pkgName, |
| 1530 | "status": status, |
| 1531 | "shell_output": shellOutput, |
| 1532 | "error_message": errMsg, |
| 1533 | "started_at": pgTimeToISO(startedAt), |
| 1534 | "completed_at": pgTimeToISO(completedAt), |
| 1535 | "scheduled_at": pgTimeToISO(scheduledAt), |
| 1536 | "created_at": pgTimeToISO(createdAt), |
| 1537 | "updated_at": pgTimeToISO(updatedAt), |
| 1538 | "triggered_by_username": triggeredByUsername, |
| 1539 | "hosts": map[string]interface{}{ |
| 1540 | "id": hostID, |
| 1541 | "friendly_name": hostFriendly, |
| 1542 | "hostname": hostHostname, |
| 1543 | }, |
| 1544 | } |
| 1545 | if len(pkgNames) > 0 { |
| 1546 | var names []string |
| 1547 | _ = json.Unmarshal(pkgNames, &names) |
| 1548 | m["package_names"] = names |
| 1549 | } |
| 1550 | return m |
| 1551 | } |
no test coverage detected