mirror of
https://github.com/juanfont/headscale.git
synced 2026-02-23 13:50:36 +01: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 |
||
|---|---|---|
| .. | ||
| api_key.go | ||
| configtest.go | ||
| debug.go | ||
| dump_config.go | ||
| generate.go | ||
| health.go | ||
| mockoidc.go | ||
| nodes.go | ||
| policy.go | ||
| preauthkeys.go | ||
| pterm_style.go | ||
| root_test.go | ||
| root.go | ||
| serve.go | ||
| users.go | ||
| utils.go | ||
| version.go | ||