--- name: ssh_check kind: function lang: go domain: infra version: "1.0.0" purity: impure signature: "func SSHCheck(conn SSHConn) error" description: "Verifica conectividad SSH ejecutando un comando noop en el host remoto. Timeout de 5 segundos." tags: [ssh, connection, check, 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" output: "nil si la conectividad SSH es exitosa, error en caso contrario" tested: true tests: ["conecta a organic-machine", "falla con host inexistente"] test_file_path: "functions/infra/ssh_check_test.go" file_path: "functions/infra/ssh_check.go" --- ## Ejemplo ```go conn := SSHConn{Host: "192.168.1.100", User: "deploy"} if err := SSHCheck(conn); err != nil { log.Fatal("no se puede conectar:", err) } ``` ## Notas Usa BatchMode=yes para fallar inmediatamente si requiere input interactivo (password prompt). ConnectTimeout=5 para no bloquear si el host no responde. StrictHostKeyChecking=accept-new acepta hosts nuevos automaticamente.