pub struct ClientBuilder { /* private fields */ }Expand description
ClientBuilder provides configures and builds a iroh-services client, typically
created with Client::builder
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
pub fn new(endpoint: &Endpoint) -> Self
Sourcepub fn register_metrics_group(
self,
metrics_group: Arc<dyn MetricsGroup>,
) -> Self
pub fn register_metrics_group( self, metrics_group: Arc<dyn MetricsGroup>, ) -> Self
Register a metrics group to forward to iroh-services
The default registered metrics uses only the endpoint
Sourcepub fn metrics_interval(self, interval: Duration) -> Self
pub fn metrics_interval(self, interval: Duration) -> Self
Set the metrics collection interval
Defaults to enabled, every 60 seconds.
Sourcepub fn disable_metrics_interval(self) -> Self
pub fn disable_metrics_interval(self) -> Self
Disable metrics collection.
Sourcepub fn api_secret_from_env(self) -> Result<Self>
pub fn api_secret_from_env(self) -> Result<Self>
Check IROH_SERVICES_API_SECRET environment variable for a valid API secret
Sourcepub fn api_secret_from_str(self, secret_key: &str) -> Result<Self>
pub fn api_secret_from_str(self, secret_key: &str) -> Result<Self>
set client API secret from an encoded string
Sourcepub fn api_secret(self, ticket: ApiSecret) -> Result<Self>
pub fn api_secret(self, ticket: ApiSecret) -> Result<Self>
Use a shared secret & remote iroh-services endpoint ID contained within a ticket to construct a iroh-services client. The resulting client will have “Client” capabilities.
API secrets include remote details within them, and will set both the remote and rcan values on the builder
Sourcepub async fn ssh_key_from_file<P: AsRef<Path>>(self, path: P) -> Result<Self>
pub async fn ssh_key_from_file<P: AsRef<Path>>(self, path: P) -> Result<Self>
Loads the private ssh key from the given path, and creates the needed capability.
Sourcepub fn ssh_key(self, key: &PrivateKey) -> Result<Self>
pub fn ssh_key(self, key: &PrivateKey) -> Result<Self>
Creates the capability from the provided private ssh key.