mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-09 06:27:48 +09:00
Add a grpcRun helper that wraps cobra RunFuncs, injecting a ready gRPC client and context. The connection lifecycle (cancel, close) is managed by the wrapper, eliminating the duplicated 3-line boilerplate (newHeadscaleCLIWithConfig + defer cancel + defer conn.Close) from 22 command handlers across 7 files. Three call sites are intentionally left unconverted: - backfillNodeIPsCmd: creates the client only after user confirmation - getPolicy/setPolicy: conditionally use gRPC vs direct DB access