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

Function patchRunsToResponse

server-source-code/internal/handler/patching.go:1477–1490  ·  view source on GitHub ↗
(rows []db.ListRecentPatchRunsRow)

Source from the content-addressed store, hash-verified

1475}
1476
1477func patchRunsToResponse(rows []db.ListRecentPatchRunsRow) []map[string]interface{} {
1478 out := make([]map[string]interface{}, len(rows))
1479 for i, r := range rows {
1480 m := patchRunRowToMap(r.ID, r.HostID, r.JobID, r.PatchType, r.PackageName, r.PackageNames, r.Status, r.ShellOutput, r.ErrorMessage, r.StartedAt, r.CompletedAt, r.ScheduledAt, r.CreatedAt, r.UpdatedAt, r.HostFriendlyName, r.HostHostname, r.TriggeredByUsername)
1481 m["dry_run"] = r.DryRun
1482 if len(r.PackagesAffected) > 0 {
1483 var pkgs []string
1484 _ = json.Unmarshal(r.PackagesAffected, &pkgs)
1485 m["packages_affected"] = pkgs
1486 }
1487 out[i] = m
1488 }
1489 return out
1490}
1491
1492func patchRunsActiveToResponse(rows []db.ListActivePatchRunsRow) []map[string]interface{} {
1493 out := make([]map[string]interface{}, len(rows))

Callers 1

DashboardMethod · 0.85

Calls 2

patchRunRowToMapFunction · 0.85
UnmarshalMethod · 0.80

Tested by

no test coverage detected