MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / dbDockerContainerToModel

Function dbDockerContainerToModel

server-source-code/internal/store/convert.go:291–309  ·  view source on GitHub ↗
(d db.DockerContainer)

Source from the content-addressed store, hash-verified

289}
290
291func dbDockerContainerToModel(d db.DockerContainer) models.DockerContainer {
292 return models.DockerContainer{
293 ID: d.ID,
294 HostID: d.HostID,
295 ContainerID: d.ContainerID,
296 Name: d.Name,
297 ImageID: d.ImageID,
298 ImageName: d.ImageName,
299 ImageTag: d.ImageTag,
300 Status: d.Status,
301 State: d.State,
302 Ports: models.JSON(d.Ports),
303 Labels: models.JSON(d.Labels),
304 CreatedAt: pgTime(d.CreatedAt),
305 StartedAt: pgTimePtr(d.StartedAt),
306 UpdatedAt: pgTime(d.UpdatedAt),
307 LastChecked: pgTime(d.LastChecked),
308 }
309}
310
311func dbDockerImageToModel(d db.DockerImage) models.DockerImage {
312 return models.DockerImage{

Callers 3

ListContainersMethod · 0.85
GetContainerMethod · 0.85
convertContainersFunction · 0.85

Calls 2

pgTimePtrFunction · 0.85
pgTimeFunction · 0.70

Tested by

no test coverage detected