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,32 @@
|
||||
---
|
||||
name: docker_container_logs
|
||||
kind: function
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func DockerContainerLogs(nameOrID string, tail int) (string, error)"
|
||||
description: "Obtiene los logs de un contenedor Docker. El parámetro tail limita a las últimas N líneas (0 devuelve todos los logs)."
|
||||
tags: [docker, container, logs, infra]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: [fmt, os/exec, strconv]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/infra/docker_container_logs.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
// Últimas 100 líneas
|
||||
logs, err := DockerContainerLogs("my-app", 100)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println(logs)
|
||||
```
|
||||
Reference in New Issue
Block a user