feat: tipo CmdResult y 6 funciones shell — ejecucion de comandos del sistema
Tipo cmd_result (product: Stdout, Stderr, ExitCode). Funciones: Run, RunWithTimeout, RunShell, RunShellTimeout, RunPipe (impuras) y Which (pura). Stubs que documentan devfactory/shell para el registry.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: run_cmd_timeout
|
||||
kind: function
|
||||
lang: go
|
||||
domain: shell
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func RunWithTimeout(name string, timeout time.Duration, args ...string) core.Result[CmdResult]"
|
||||
description: "Ejecuta un comando del sistema con timeout configurable."
|
||||
tags: [shell, command, process, exec, timeout]
|
||||
uses_functions: []
|
||||
uses_types: [cmd_result_go_shell, result_go_core]
|
||||
returns: [result_go_core]
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: [time]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/shell/run_cmd_timeout.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
result := RunWithTimeout("curl", 5*time.Second, "https://example.com")
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Implementacion en devfactory/shell.
|
||||
Reference in New Issue
Block a user