feat: 10 funciones infra Docker y 2 tipos — operaciones de contenedores e imagenes
Funciones Docker: list/start/stop/remove containers, list/pull/remove images, inspect, logs, run. Tipos: ContainerInfo e ImageInfo. Pre-existentes en el dominio infra, ahora registrados.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package infra
|
||||
|
||||
// ContainerInfo representa la información básica de un contenedor Docker.
|
||||
type ContainerInfo struct {
|
||||
ID string // ID corto del contenedor
|
||||
Name string // Nombre del contenedor
|
||||
Image string // Imagen usada
|
||||
Status string // Estado actual (running, exited, etc.)
|
||||
State string // Estado detallado
|
||||
Ports string // Mapeo de puertos
|
||||
Created string // Fecha de creación
|
||||
Labels map[string]string // Labels del contenedor
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
name: container_info
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
algebraic: product
|
||||
definition: |
|
||||
type ContainerInfo struct {
|
||||
ID string
|
||||
Name string
|
||||
Image string
|
||||
Status string
|
||||
State string
|
||||
Ports string
|
||||
Created string
|
||||
Labels map[string]string
|
||||
}
|
||||
description: "Información básica de un contenedor Docker: ID, nombre, imagen, estado, puertos, labels."
|
||||
tags: [docker, container, infra]
|
||||
uses_types: []
|
||||
file_path: "types/infra/container_info.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
c := ContainerInfo{
|
||||
ID: "abc123",
|
||||
Name: "my-app",
|
||||
Image: "nginx:latest",
|
||||
Status: "Up 2 hours",
|
||||
State: "running",
|
||||
Ports: "0.0.0.0:8080->80/tcp",
|
||||
}
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Tipo product que modela la salida de `docker ps`. Los campos mapean directamente a las columnas del formato JSON de Docker.
|
||||
@@ -0,0 +1,10 @@
|
||||
package infra
|
||||
|
||||
// ImageInfo representa la información básica de una imagen Docker local.
|
||||
type ImageInfo struct {
|
||||
ID string // ID corto de la imagen
|
||||
Repository string // Nombre del repositorio
|
||||
Tag string // Tag de la imagen
|
||||
Size string // Tamaño legible (ej: "142MB")
|
||||
Created string // Fecha de creación
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: image_info
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
algebraic: product
|
||||
definition: |
|
||||
type ImageInfo struct {
|
||||
ID string
|
||||
Repository string
|
||||
Tag string
|
||||
Size string
|
||||
Created string
|
||||
}
|
||||
description: "Información básica de una imagen Docker local: ID, repositorio, tag, tamaño, fecha."
|
||||
tags: [docker, image, infra]
|
||||
uses_types: []
|
||||
file_path: "types/infra/image_info.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
img := ImageInfo{
|
||||
ID: "sha256:abc123",
|
||||
Repository: "nginx",
|
||||
Tag: "latest",
|
||||
Size: "142MB",
|
||||
Created: "2 weeks ago",
|
||||
}
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Tipo product que modela la salida de `docker images`. Los campos mapean al formato JSON de Docker.
|
||||
Reference in New Issue
Block a user