feat: funciones SSH para infra — conn, check, exec, download, upload, tunnel
Conjunto completo de funciones SSH para operaciones remotas: conexión, verificación de host, ejecución de comandos, transferencia de archivos (upload/download) y gestión de túneles. Incluye tipo SSHConn y tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: ssh_download
|
||||
kind: function
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func SSHDownload(conn SSHConn, remotePath, localPath string) error"
|
||||
description: "Descarga un archivo del host remoto al filesystem local via scp."
|
||||
tags: [ssh, scp, download, file, transfer, remote]
|
||||
uses_functions: []
|
||||
uses_types: [ssh_conn_go_infra]
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: [fmt, os/exec, strings]
|
||||
tested: true
|
||||
tests: ["upload y download roundtrip"]
|
||||
test_file_path: "functions/infra/ssh_transfer_test.go"
|
||||
file_path: "functions/infra/ssh_download.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
conn := SSHConn{Host: "192.168.1.100", User: "deploy"}
|
||||
err := SSHDownload(conn, "/var/log/app.log", "./app.log")
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Descarga un archivo remoto al path local indicado. Para descargar directorios, usar SSHExec con tar/rsync como alternativa.
|
||||
Reference in New Issue
Block a user