pub struct ProxyConfig {
pub listen_address: String,
pub admin_address: String,
pub tr_enabled: bool,
pub tr_mode: TrMode,
pub pool: PoolConfig,
pub pool_mode: PoolModeConfig,
pub load_balancer: LoadBalancerConfig,
pub health: HealthConfig,
pub nodes: Vec<NodeConfig>,
pub tls: Option<TlsConfig>,
pub write_timeout_secs: u64,
pub plugins: PluginToml,
}Expand description
Proxy configuration
Fields§
§listen_address: StringListen address for client connections
admin_address: StringAdmin API address
tr_enabled: boolEnable TR (Transaction Replay)
tr_mode: TrModeTR mode
pool: PoolConfigConnection pool configuration
pool_mode: PoolModeConfigPool mode configuration (Session/Transaction/Statement)
load_balancer: LoadBalancerConfigLoad balancer configuration
health: HealthConfigHealth check configuration
nodes: Vec<NodeConfig>Backend nodes
tls: Option<TlsConfig>TLS configuration
write_timeout_secs: u64Write timeout during failover (seconds) When primary is unavailable, wait this long for a new primary before returning error
plugins: PluginTomlPlugin system configuration. Only consumed when the wasm-plugins
feature is enabled; on a feature-off build, values are parsed and
ignored so existing configs don’t break.
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn write_timeout(&self) -> Duration
pub fn write_timeout(&self) -> Duration
Get write timeout as Duration
Sourcepub fn add_node(&mut self, host_port: &str, role: &str) -> Result<()>
pub fn add_node(&mut self, host_port: &str, role: &str) -> Result<()>
Add a node from host:port string
Sourcepub fn primary_node(&self) -> Option<&NodeConfig>
pub fn primary_node(&self) -> Option<&NodeConfig>
Get primary node
Sourcepub fn standby_nodes(&self) -> Vec<&NodeConfig>
pub fn standby_nodes(&self) -> Vec<&NodeConfig>
Get standby nodes
Sourcepub fn enabled_nodes(&self) -> Vec<&NodeConfig>
pub fn enabled_nodes(&self) -> Vec<&NodeConfig>
Get all enabled nodes
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
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 moreSource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Source§impl Default for ProxyConfig
impl Default for ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfig
impl<'de> Deserialize<'de> for ProxyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnsafeUnpin for ProxyConfig
impl UnwindSafe for ProxyConfig
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more