pub struct ServerConfig {
pub grpc_addr: SocketAddr,
pub http_addr: SocketAddr,
pub metrics_addr: Option<SocketAddr>,
pub tls: Option<TlsConfig>,
pub insecure_no_auth: bool,
pub shutdown_grace_s: f64,
pub grpc_web: Option<GrpcWebConfig>,
pub shard: Option<String>,
pub peer_tls: Option<PeerTlsConfig>,
pub insecure_peer_http: bool,
}Expand description
Listeners, TLS and shutdown behaviour.
Fields§
§grpc_addr: SocketAddrgRPC listener (default 127.0.0.1:7070).
http_addr: SocketAddrHTTP/JSON listener (default 127.0.0.1:7071).
metrics_addr: Option<SocketAddr>Optional unauthenticated listener serving only /metrics (bind it to an internal
network). Without it, /metrics on http_addr requires a metrics or admin token.
tls: Option<TlsConfig>TLS for both the gRPC and the HTTP listener (and mTLS with client_ca).
insecure_no_auth: boolAllow running without any auth token on non-loopback addresses.
shutdown_grace_s: f64Grace period for running attempts on shutdown.
grpc_web: Option<GrpcWebConfig>Serve gRPC-Web for browsers on the gRPC listener (off unless set).
shard: Option<String>The shard this server serves, one of [[shards]] (also --shard).
peer_tls: Option<PeerTlsConfig>TLS for calls to other shards’ https:// endpoints.
insecure_peer_http: boolForward callers’ tokens to other shards over plain http:// endpoints on other hosts.
Off by default: such calls are refused with the shard’s endpoint instead, so tokens do
not cross the network unencrypted. Trusted networks only.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
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>,
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
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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