pub struct BetterStackConfigBuilder { /* private fields */ }Expand description
Builder for BetterStackConfig. Values set here win over the environment.
Implementations§
Source§impl BetterStackConfigBuilder
impl BetterStackConfigBuilder
Sourcepub fn url(self, url: impl Into<String>) -> Self
pub fn url(self, url: impl Into<String>) -> Self
Ingest base URL: the source’s ingesting host (s1234.eu-nbg-2.betterstackdata.com); a
value without :// gets https://.
Sourcepub fn source_token(self, token: impl Into<Secret>) -> Self
pub fn source_token(self, token: impl Into<Secret>) -> Self
Source token sent as Authorization: Bearer <token> to the ingesting host only.
Sourcepub fn query_url(self, url: impl Into<String>) -> Self
pub fn query_url(self, url: impl Into<String>) -> Self
SQL query base URL (e.g. eu-nbg-2-connect.betterstackdata.com).
Sourcepub fn query_username(self, username: impl Into<String>) -> Self
pub fn query_username(self, username: impl Into<String>) -> Self
Username of the SQL connection.
Sourcepub fn query_password(self, password: impl Into<Secret>) -> Self
pub fn query_password(self, password: impl Into<Secret>) -> Self
Password of the SQL connection (HTTP Basic).
Sourcepub fn source_table(self, table: impl Into<String>) -> Self
pub fn source_table(self, table: impl Into<String>) -> Self
Default collection (t1234_myapp) for queries.
Sourcepub fn encoding(self, encoding: Encoding) -> Self
pub fn encoding(self, encoding: Encoding) -> Self
Ingest wire encoding (default Encoding::Json).
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Connect timeout (default 10 s).
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Per-attempt timeout (default 30 s).
Sourcepub fn total_timeout(self, timeout: Duration) -> Self
pub fn total_timeout(self, timeout: Duration) -> Self
Whole-call timeout including retries (default 120 s).
Sourcepub fn retry(self, retry: RetryPolicy) -> Self
pub fn retry(self, retry: RetryPolicy) -> Self
Retry policy.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Maximum retries (default 3).
Sourcepub fn ca_cert_path(self, path: impl Into<PathBuf>) -> Self
pub fn ca_cert_path(self, path: impl Into<PathBuf>) -> Self
Extra trusted CA certificates (PEM file).
Sourcepub fn insecure_skip_verify(self, skip: bool) -> Self
pub fn insecure_skip_verify(self, skip: bool) -> Self
Disables TLS verification (tests only).
Sourcepub fn proxy(self, proxy: impl Into<String>) -> Self
pub fn proxy(self, proxy: impl Into<String>) -> Self
Proxy URL (environment proxies are ignored).
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Extra request header (sent to both hosts).
Sourcepub fn user_agent_suffix(self, suffix: impl Into<String>) -> Self
pub fn user_agent_suffix(self, suffix: impl Into<String>) -> Self
Text appended to the User-Agent.
Sourcepub fn common(
self,
f: impl FnOnce(CommonConfigBuilder) -> CommonConfigBuilder,
) -> Self
pub fn common( self, f: impl FnOnce(CommonConfigBuilder) -> CommonConfigBuilder, ) -> Self
Sourcepub fn build(self) -> Result<BetterStackConfig>
pub fn build(self) -> Result<BetterStackConfig>
Builds without reading the environment.
Sourcepub fn build_from_env(self) -> Result<BetterStackConfig>
pub fn build_from_env(self) -> Result<BetterStackConfig>
Fills unset values from the process environment, then builds.
Sourcepub fn build_with_env(self, env: &EnvReader) -> Result<BetterStackConfig>
pub fn build_with_env(self, env: &EnvReader) -> Result<BetterStackConfig>
Fills unset values from env, then builds.