Files
fn_registry/functions/infra/ssh_download.md
T
egutierrez 47fac22230 chore: auto-commit (799 archivos)
- .claude/CLAUDE.md
- .claude/commands/subagentes.md
- .claude/rules/INDEX.md
- .mcp.json
- bash/functions/cybersecurity/analyze_dns.md
- bash/functions/cybersecurity/audit_http_headers.md
- bash/functions/cybersecurity/audit_ssh_config.md
- bash/functions/cybersecurity/check_firewall.md
- bash/functions/cybersecurity/detect_suspicious_users.md
- bash/functions/cybersecurity/encrypt_file.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:28:20 +02:00

41 lines
1.2 KiB
Markdown

---
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, pendiente-usar]
uses_functions: []
uses_types: [ssh_conn_go_infra]
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [fmt, os/exec, strings]
params:
- name: conn
desc: "estructura SSHConn con Host, User, Port, IdentityFile"
- name: remotePath
desc: "ruta del archivo en el host remoto"
- name: localPath
desc: "ruta de destino en el filesystem local"
output: "nil si la descarga fue exitosa, error en caso contrario"
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.