MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / patchRunRowToMap

Function patchRunRowToMap

server-source-code/internal/handler/patching.go:1523–1551  ·  view source on GitHub ↗
(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)

Source from the content-addressed store, hash-verified

1521}
1522
1523func 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}

Callers 3

patchRunsToResponseFunction · 0.85
patchRunsListToResponseFunction · 0.85

Calls 2

pgTimeToISOFunction · 0.85
UnmarshalMethod · 0.80

Tested by

no test coverage detected