---
name: ssh_upload
kind: function
lang: go
domain: infra
version: "1.0.0"
purity: impure
signature: "func SSHUpload(conn SSHConn, localPath, remotePath string) error"
description: "Sube un archivo local al host remoto via scp."
tags: [ssh, scp, upload, 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]
params:
  - name: conn
    desc: "estructura SSHConn con Host, User, Port, IdentityFile"
  - name: localPath
    desc: "ruta del archivo local a subir"
  - name: remotePath
    desc: "ruta de destino en el host remoto"
output: "nil si la subida 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_upload.go"
---

## Ejemplo

```go
conn := SSHConn{Host: "192.168.1.100", User: "deploy", KeyPath: "~/.ssh/id_ed25519"}
err := SSHUpload(conn, "./config.yaml", "/home/deploy/app/config.yaml")
```

## Notas

Usa scp con -P para el puerto (distinto a ssh que usa -p). Para subir directorios, usar SSHExec con tar/rsync como alternativa.
