feat: funciones NordVPN bash y Go — CLI, contenedor Docker y parser de estado
Funciones bash para instalar, conectar, desconectar, estado, IP, ciudades, países y protocolo. Funciones Go para gestionar contenedor NordVPN (run/start/stop) y parsear estado. Incluye tipo NordVPNStatus y tests para el parser. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: nordvpn_container_stop
|
||||
kind: function
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func NordVPNContainerStop(gateway string, clientNames ...string) error"
|
||||
description: "Detiene y elimina el container gateway NordVPN y opcionalmente los containers cliente que usan su red."
|
||||
tags: [vpn, nordvpn, docker, container, stop, cleanup, infra]
|
||||
uses_functions: ["docker_stop_container_go_infra", "docker_remove_container_go_infra"]
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: [fmt]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/infra/nordvpn_container_stop.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
// Parar solo el gateway
|
||||
err := NordVPNContainerStop("nordvpn")
|
||||
|
||||
// Parar gateway y clientes asociados
|
||||
err := NordVPNContainerStop("nordvpn", "chrome-vpn", "scraper-vpn")
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Detiene primero los containers cliente (si se proporcionan) y luego el gateway. Importante: si los clientes usan `--network=container:nordvpn`, deben pararse antes que el gateway para evitar errores de red. Los clientes se paran con timeout de 5s, el gateway con 10s.
|
||||
Reference in New Issue
Block a user