tailscale_cli/lib.rs
1//! Wrapper around the `tailscale` command-line interface.
2//!
3//! The local node is driven through its CLI rather than through the LocalAPI
4//! socket (ADR-0001), so this crate is where every one of those decisions
5//! lives: where the binary is found, what environment it inherits, how long it
6//! is given, how a secret reaches it without passing through the argument list,
7//! and which calls may overlap.
8//!
9//! Everything above this crate sees [`LocalBackend`], a one-method trait, so
10//! the server can be built over a fake in tests without spawning anything.
11
12// A panic in a test is a failed test, which is what these lints exist to
13// prevent elsewhere.
14#![cfg_attr(test, allow(clippy::expect_used, clippy::unwrap_used))]
15
16pub mod backend;
17pub mod exec;
18pub mod secret;
19
20/// A scriptable backend for tests. Not built into a release binary.
21#[cfg(feature = "testing")]
22pub mod stub;
23
24pub use backend::{BoxFuture, Concurrency, Invocation, LocalBackend, Output, Unavailable};
25pub use exec::{CliBackend, DEFAULT_TIMEOUT, ExecError, GRACE_PERIOD};
26pub use secret::{PrivateFile, SecretFile};