1
0
mirror of https://github.com/juanfont/headscale.git synced 2026-02-23 13:50:36 +01:00
juanfont.headscale/cmd/headscale
Kristoffer Dalby 45aa50ed86 cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle
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
2026-02-19 07:24:33 +00:00
..
cli cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
headscale_test.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
headscale.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00