pub struct ServerConfig {Show 18 fields
pub role: ServerRole,
pub listen_addr: SocketAddr,
pub cluster_addr: SocketAddr,
pub cluster_start: ClusterStartMode,
pub cluster_advertise_addr: Option<String>,
pub node_id: Option<String>,
pub seeds: Vec<String>,
pub storage_dir: Option<PathBuf>,
pub drain_timeout_ms: u64,
pub join_timeout_ms: u64,
pub tls: TlsConfig,
pub cluster_auth: ClusterAuthConfig,
pub backup: BackupConfig,
pub client_api: ClientApiConfig,
pub hc2_client_plane: Hc2ClientPlaneConfig,
pub admin_api: AdminApiConfig,
pub redis_api: RedisApiConfig,
pub raft_compaction_enabled: bool,
}Expand description
Standalone daemon configuration.
Fields§
§role: ServerRoleServer role.
listen_addr: SocketAddrPublic actuator/data listen address.
cluster_addr: SocketAddrInternal cluster listen address.
cluster_start: ClusterStartModeFirst-boot cluster startup mode.
cluster_advertise_addr: Option<String>Routable cluster endpoint advertised to other members.
node_id: Option<String>Optional stable member node identity.
seeds: Vec<String>Seed members used by member/client roles.
storage_dir: Option<PathBuf>Durable state directory for member mode.
drain_timeout_ms: u64Graceful shutdown drain timeout.
join_timeout_ms: u64Maximum time spent waiting for explicit join admission.
tls: TlsConfigTLS policy.
cluster_auth: ClusterAuthConfigCluster route authentication policy.
backup: BackupConfigBackup policy.
client_api: ClientApiConfigExternal client API policy.
hc2_client_plane: Hc2ClientPlaneConfigOptional production HC/2 gRPC client plane.
admin_api: AdminApiConfigInternal operator/admin HTTP policy.
redis_api: RedisApiConfigOptional Redis RESP edge facade policy.
raft_compaction_enabled: boolWhether the narrow admin Raft compaction test/ops seam is enabled.
This remains false in normal production configuration and does not enable automatic compaction.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn from_file(path: impl AsRef<Path>) -> Result<Self, ServerConfigError>
pub fn from_file(path: impl AsRef<Path>) -> Result<Self, ServerConfigError>
Load config from a TOML file.
Sourcepub fn from_toml_str(text: &str) -> Result<Self, ServerConfigError>
pub fn from_toml_str(text: &str) -> Result<Self, ServerConfigError>
Load config from TOML text.
Sourcepub fn from_env() -> Result<Self, ServerConfigError>
pub fn from_env() -> Result<Self, ServerConfigError>
Load config from selected environment variables.
Sourcepub fn validate(&self) -> Result<(), ServerConfigError>
pub fn validate(&self) -> Result<(), ServerConfigError>
Validate startup invariants.
Sourcepub fn redis_listener_config(
&self,
) -> Result<RedisListenerConfig, ServerConfigError>
pub fn redis_listener_config( &self, ) -> Result<RedisListenerConfig, ServerConfigError>
Build the Redis RESP listener config used by the optional edge server.
Sourcepub fn drain_timeout(&self) -> Duration
pub fn drain_timeout(&self) -> Duration
Return the configured drain timeout.
Sourcepub fn join_timeout(&self) -> Duration
pub fn join_timeout(&self) -> Duration
Return the configured join admission timeout.
Sourcepub fn cluster_advertise_endpoint(&self) -> String
pub fn cluster_advertise_endpoint(&self) -> String
Return the endpoint this member should advertise to peers.
Sourcepub fn exposes_non_loopback(&self) -> bool
pub fn exposes_non_loopback(&self) -> bool
Return whether any listener is externally reachable.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfigwhere
ServerConfig: Default,
impl<'de> Deserialize<'de> for ServerConfigwhere
ServerConfig: Default,
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>,
impl Eq for ServerConfig
Source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
Source§impl Serialize for ServerConfig
impl Serialize for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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 moreSource§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>
T in a tonic::Request