1
0
mirror of https://github.com/juanfont/headscale.git synced 2026-02-23 13:50:36 +01:00
juanfont.headscale/cmd/headscale/cli
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
..
api_key.go cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
configtest.go all: use lowercase log messages 2026-02-06 07:40:29 +01:00
debug.go cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
dump_config.go
generate.go
health.go cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
mockoidc.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
nodes.go cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
policy.go all: apply golangci-lint 2.9.0 fixes 2026-02-19 08:21:23 +01:00
preauthkeys.go cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
pterm_style.go
root_test.go cli: do not show new pre-releases on stable (#2813) 2025-10-24 13:15:53 +02:00
root.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
serve.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00
users.go cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
utils.go cmd/headscale/cli: add grpcRun wrapper for gRPC client lifecycle 2026-02-19 07:24:33 +00:00
version.go cli: use gobuild version handling (#2770) 2025-09-12 11:47:31 +02:00