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,36 @@
|
||||
---
|
||||
name: docker_volume_remove
|
||||
kind: function
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func DockerVolumeRemove(name string, force bool) error"
|
||||
description: "Elimina un volume Docker por nombre. Si force es true fuerza la eliminación aunque esté en uso."
|
||||
tags: [docker, volume, remove, delete, infra]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: [fmt, os/exec, strings]
|
||||
tested: true
|
||||
tests: ["error si volume no existe", "force flag incluye -f en el comando"]
|
||||
test_file_path: "functions/infra/docker_volume_remove_test.go"
|
||||
file_path: "functions/infra/docker_volume_remove.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
// Eliminar volume con fuerza
|
||||
err := DockerVolumeRemove("postgres_data", true)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println("Volume eliminado")
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Ejecuta `docker volume rm [-f] name`. El flag -f solo esta disponible en versiones recientes de Docker. Sin force, falla si el volume esta siendo usado por un contenedor activo.
|
||||
Reference in New Issue
Block a user