pub struct GaiaClientConfig {
pub server_address: String,
pub ca_cert_path: PathBuf,
pub client_cert_path: PathBuf,
pub client_key_path: PathBuf,
pub domain_name: String,
}Expand description
Configuration for the Gaia client.
Fields§
§server_address: StringThe address of the Gaia daemon (e.g., “localhost:50051”).
ca_cert_path: PathBufPath to the CA certificate file.
client_cert_path: PathBufPath to the client certificate file.
client_key_path: PathBufPath to the client private key file.
domain_name: StringOptional domain name for TLS verification (defaults to “gaia”).
Implementations§
Source§impl GaiaClientConfig
impl GaiaClientConfig
Sourcepub fn new<S, P>(
server_address: S,
ca_cert_path: P,
client_cert_path: P,
client_key_path: P,
) -> Self
pub fn new<S, P>( server_address: S, ca_cert_path: P, client_cert_path: P, client_key_path: P, ) -> Self
Creates a new Gaia client configuration.
§Arguments
server_address- The address of the Gaia daemon (e.g., “localhost:50051”)ca_cert_path- Path to the CA certificate fileclient_cert_path- Path to the client certificate fileclient_key_path- Path to the client private key file
§Example
use gaia_client::GaiaClientConfig;
let config = GaiaClientConfig::new(
"localhost:50051",
"/etc/gaia/certs/ca.crt",
"/etc/gaia/certs/client.crt",
"/etc/gaia/certs/client.key",
);Sourcepub fn with_domain_name<S: Into<String>>(self, domain_name: S) -> Self
pub fn with_domain_name<S: Into<String>>(self, domain_name: S) -> Self
Sets a custom domain name for TLS verification.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates a configuration from environment variables.
Expects the following environment variables:
GAIA_SERVER_ADDRESS(defaults to “localhost:50051”)GAIA_CA_CERT(defaults to “/etc/gaia/certs/ca.crt”)GAIA_CLIENT_CERT(defaults to “/etc/gaia/certs/client.crt”)GAIA_CLIENT_KEY(defaults to “/etc/gaia/certs/client.key”)
§Example
use gaia_client::GaiaClientConfig;
let config = GaiaClientConfig::from_env();Trait Implementations§
Source§impl Clone for GaiaClientConfig
impl Clone for GaiaClientConfig
Source§fn clone(&self) -> GaiaClientConfig
fn clone(&self) -> GaiaClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GaiaClientConfig
impl RefUnwindSafe for GaiaClientConfig
impl Send for GaiaClientConfig
impl Sync for GaiaClientConfig
impl Unpin for GaiaClientConfig
impl UnsafeUnpin for GaiaClientConfig
impl UnwindSafe for GaiaClientConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request