pub struct Client { /* private fields */ }Expand description
The Client is used for all interaction with Control Tower or Edge Enforcer instances.
Use one of the login functions to create an instance.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Create a Client builder
Sourcepub async fn bearer_token(&self) -> String
pub async fn bearer_token(&self) -> String
Returns the login bearer token
Sourcepub async fn get_json<T: DeserializeOwned>(
&self,
path: &str,
query_params: Option<&[(&str, &str)]>,
) -> Result<T>
pub async fn get_json<T: DeserializeOwned>( &self, path: &str, query_params: Option<&[(&str, &str)]>, ) -> Result<T>
GET a json payload from the REST API.
Sourcepub async fn get_bytes(
&self,
path: &str,
query_params: Option<&[(&str, &str)]>,
) -> Result<Bytes>
pub async fn get_bytes( &self, path: &str, query_params: Option<&[(&str, &str)]>, ) -> Result<Bytes>
GET a bytes payload from the REST API.
Sourcepub async fn put<T: Into<Body> + Debug>(
&self,
path: &str,
content_type: &str,
data: T,
) -> Result<()>
pub async fn put<T: Into<Body> + Debug>( &self, path: &str, content_type: &str, data: T, ) -> Result<()>
PUT arbitrary data to a path
Sourcepub async fn put_json(&self, path: &str, data: &Value) -> Result<Value>
pub async fn put_json(&self, path: &str, data: &Value) -> Result<Value>
PUT arbitrary JSON to a path
Sourcepub async fn volga_open_producer(
&self,
producer_name: &str,
topic: &str,
on_no_exists: OnNoExists,
) -> Result<Producer>
pub async fn volga_open_producer( &self, producer_name: &str, topic: &str, on_no_exists: OnNoExists, ) -> Result<Producer>
Open a volga producer on a topic
Sourcepub async fn volga_open_child_site_producer(
&self,
producer_name: &str,
topic: &str,
site: &str,
on_no_exists: OnNoExists,
) -> Result<Producer>
pub async fn volga_open_child_site_producer( &self, producer_name: &str, topic: &str, site: &str, on_no_exists: OnNoExists, ) -> Result<Producer>
Open a volga NAT producer on a topic in a site
Sourcepub async fn volga_open_consumer(
&self,
consumer_name: &str,
topic: &str,
options: Options<'_>,
) -> Result<Consumer>
pub async fn volga_open_consumer( &self, consumer_name: &str, topic: &str, options: Options<'_>, ) -> Result<Consumer>
Creates and opens a Volga consumer
Sourcepub async fn volga_open_child_site_consumer(
&self,
consumer_name: &str,
topic: &str,
site: &str,
options: Options<'_>,
) -> Result<Consumer>
pub async fn volga_open_child_site_consumer( &self, consumer_name: &str, topic: &str, site: &str, options: Options<'_>, ) -> Result<Consumer>
Creates and opens a Volga consumer on a child site
Sourcepub async fn volga_query_topic(&self, query: Query) -> Result<QueryStream>
pub async fn volga_query_topic(&self, query: Query) -> Result<QueryStream>
Opens a query stream
Sourcepub async fn open_strongbox_vault(&self, vault: &str) -> Result<Vault>
pub async fn open_strongbox_vault(&self, vault: &str) -> Result<Vault>
Try to open a Strongbox Vault
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more