feat: funciones infra — Docker, deploy, build y health check
Funciones impuras para gestión de contenedores: docker_build_image, docker_compose_up/down, docker_volume_create/list/remove, generate_dockerfile, write_dockerfile, go_build_binary, health_check_http, deploy_app y stop_app. Todas con tests unitarios donde aplica. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: docker_volume_list
|
||||
kind: function
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func DockerVolumeList() ([]map[string]string, error)"
|
||||
description: "Lista los volumes Docker disponibles localmente. Parsea la salida JSON de docker volume ls. Retorna slice de maps con campos Driver, Name, Scope, Labels, Mountpoint."
|
||||
tags: [docker, volume, list, infra]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: [encoding/json, fmt, os/exec, strings]
|
||||
tested: true
|
||||
tests: ["lista vacia retorna nil sin error", "parsea campos Driver y Name correctamente"]
|
||||
test_file_path: "functions/infra/docker_volume_list_test.go"
|
||||
file_path: "functions/infra/docker_volume_list.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
volumes, err := DockerVolumeList()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for _, v := range volumes {
|
||||
fmt.Printf("Volume: %s (driver: %s)\n", v["Name"], v["Driver"])
|
||||
}
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Ejecuta `docker volume ls --format {{json .}}` (un JSON por linea). Usa splitLines del paquete infra para iterar lineas. Retorna nil si no hay volumes. Los campos del map dependen de la version de Docker pero siempre incluyen Driver y Name.
|
||||
Reference in New Issue
Block a user