Skip to content

v0.4.2 — an authenticated control-plane client

Latest

Choose a tag to compare

@kolkov kolkov released this 22 Oct 12:15

An authenticated client for the daemon's control plane, and a shutdown path that uses it.

Added

  • Daemon.ControlClient() and ControlClient — Get(ctx, path) and Post(ctx, path) against the loopback control plane with the bearer token from the PID file. The token stays inside the client (no accessor hands it out); a non-2xx status is an error carrying the status line and a bounded body snippet, so a failed call is reported instead of read as an empty answer. Requests have a 30-second ceiling of their own (a caller's shorter deadline still wins), redirects are not followed, and a body over 8 MiB is an error instead of a silently truncated one.

Changed

  • Stop sends its shutdown request through ControlClient — one implementation of the address, the bearer token and the status check.

Upgrade

go get github.com/grpmsoft/daemon@v0.4.2

Full changelog: https://github.com/grpmsoft/daemon/blob/main/CHANGELOG.md
Compare: v0.4.1...v0.4.2