mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-06-10 08:11:23 +00:00
6895e369f6
- Remove standalone mode code: file-based stores, standalone gateway, heartbeat service, SQLite memory, standalone docker-compose - Rename docker-compose.managed.yml → docker-compose.postgres.yml - Clean up ~130 Go comments referencing "managed mode" qualifier - Simplify docker-compose.yml env vars (providers/channels via web UI) - Update .env.example to essential vars only (token + encryption key) - Add setup wizard UI (provider → agent → channel bootstrap flow) - Add logs.tail WebSocket handler for live log streaming - Add cursor-pointer to interactive UI components - Clean up config page (remove standalone-only sections) - Update README and docs for managed-only architecture
24 lines
587 B
Go
24 lines
587 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// requireGateway exits with a helpful error if the gateway is not reachable.
|
|
func requireGateway() {
|
|
if !isGatewayReachable() {
|
|
fmt.Fprintln(os.Stderr, "Error: the gateway must be running for this command.")
|
|
fmt.Fprintln(os.Stderr, "Start it first: goclaw")
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
// isGatewayReachable tries a quick RPC ping to check if the gateway is up.
|
|
func isGatewayReachable() bool {
|
|
_, err := gatewayRPC("ping", nil)
|
|
// Any response (even error) means the gateway is up.
|
|
// Only connection failure means it's down.
|
|
return err == nil
|
|
}
|