Struct tsnet::ServerBuilder
source · pub struct ServerBuilder { /* private fields */ }Expand description
Server factory, which can be used to configure the properties of a new server.
Methods can be chained on it in order to configure it.
Example
use tsnet::ServerBuilder;
let server = ServerBuilder::new().ephemeral().build().unwrap();Implementations§
source§impl ServerBuilder
impl ServerBuilder
sourcepub fn new() -> ServerBuilder
pub fn new() -> ServerBuilder
Generates the base configuration for a new server, from which configuration methods can be chained.
Call ServerBuilder::build to start the server.
sourcepub fn dir(self, dir: PathBuf) -> Self
pub fn dir(self, dir: PathBuf) -> Self
Specifies the name of the directory to use for state. If unset, a directory is selected automatically under the user’s configuration directory (see https://golang.org/pkg/os/#UserConfigDir), based on the name of the binary.
sourcepub fn hostname(self, hostname: &str) -> Self
pub fn hostname(self, hostname: &str) -> Self
The hostname to present to the control server. If unset, the binary name is used.
sourcepub fn authkey(self, authkey: String) -> Self
pub fn authkey(self, authkey: String) -> Self
AuthKey, if set, is the auth key to create the node
and will be preferred over the TS_AUTHKEY environment variable.
If the node is already created (from state previously stored in in Store),
then this field is not used.
sourcepub fn control_url(self, control_url: String) -> Self
pub fn control_url(self, control_url: String) -> Self
Specifies the coordination server URL. If unset, the Tailscale default is used.
sourcepub fn ephemeral(self) -> Self
pub fn ephemeral(self) -> Self
Specifies that the instance should register as an Ephemeral node (see https://tailscale.com/kb/1111/ephemeral-nodes/)
sourcepub fn redirect_log(self) -> Self
pub fn redirect_log(self) -> Self
Redirect libtailscale logging to log.
- This starts a new thread to handle logs.
- Everything from
libtailscaleis logged atINFOlevel. - Use an appropriate logger to handle log output further.
sourcepub fn disable_log(self) -> Self
pub fn disable_log(self) -> Self
Disable libtailscale logging.
See also ServerBuilder::redirect_log to rely on the Rust log facade.