pub struct LagerBoxBuilder { /* private fields */ }Expand description
Builder for LagerBox, for overriding the default timeout, the
debug-service URL, and gateway auth.
Implementations§
Source§impl LagerBoxBuilder
impl LagerBoxBuilder
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Override the default HTTP timeout for quick commands (10s unless
changed). Long-running actions (watt/energy windows,
wait_for_level) still compute their own wider budgets.
Sourcepub fn debug_service_url(self, url: impl Into<String>) -> Self
pub fn debug_service_url(self, url: impl Into<String>) -> Self
Override the debug-service base URL (default: the box host on port
8765). Use this when the debug service is reached through an SSH
tunnel (e.g. http://127.0.0.1:8765). Also settable via the
LAGER_DEBUG_SERVICE_URL environment variable.
Sourcepub fn bearer_token(self, token: impl Into<String>) -> Self
pub fn bearer_token(self, token: impl Into<String>) -> Self
Attach Authorization: Bearer <token> to every request, for boxes
behind an authenticating gateway. Also settable via the
LAGER_GATEWAY_TOKEN environment variable.
Without this, the crate reuses the Lager CLI’s session
(lager login <auth_url>, stored in ~/.lager_gateway_auth)
automatically when a gateway asks for auth, including transparent
refresh of expired access tokens. Plain (ungated) boxes are
unaffected either way.