pub struct BetterStackConfig { /* private fields */ }Expand description
Immutable client configuration; build it with BetterStackConfig::builder or
BetterStackConfig::from_env. Debug output redacts every credential.
Implementations§
Source§impl BetterStackConfig
impl BetterStackConfig
Sourcepub fn builder() -> BetterStackConfigBuilder
pub fn builder() -> BetterStackConfigBuilder
A builder with nothing set.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Configuration from the process environment
(explicit > GROW_BETTER_STACK_LOGS_* > vendor variables > defaults).
Sourcepub fn common(&self) -> &CommonConfig
pub fn common(&self) -> &CommonConfig
Settings shared by every Grow Codes SDK; the URL is the ingest URL, or the query URL for a query-only client.
Sourcepub fn ingest_common(&self) -> Option<&CommonConfig>
pub fn ingest_common(&self) -> Option<&CommonConfig>
Common settings of the ingest transport (None without ingest credentials).
Sourcepub fn query_common(&self) -> Option<&CommonConfig>
pub fn query_common(&self) -> Option<&CommonConfig>
Common settings of the SQL query transport (None without query credentials).
Sourcepub fn url(&self) -> Option<&Url>
pub fn url(&self) -> Option<&Url>
Ingest base URL (the source’s ingesting host), or None for a query-only client.
Sourcepub fn source_token(&self) -> Option<&Secret>
pub fn source_token(&self) -> Option<&Secret>
Source token for the ingesting host.
Sourcepub fn query_username(&self) -> Option<&str>
pub fn query_username(&self) -> Option<&str>
SQL connection username.
Sourcepub fn query_password(&self) -> Option<&Secret>
pub fn query_password(&self) -> Option<&Secret>
SQL connection password.
Sourcepub fn source_table(&self) -> Option<&str>
pub fn source_table(&self) -> Option<&str>
Default collection (t1234_myapp) used by search, search_logs, tail and ping.
Sourcepub fn encoding(&self) -> Encoding
pub fn encoding(&self) -> Encoding
Ingest wire encoding (default Encoding::Json).
Sourcepub fn has_ingest(&self) -> bool
pub fn has_ingest(&self) -> bool
Whether the ingest side (url + source token) is configured.
Sourcepub fn has_query(&self) -> bool
pub fn has_query(&self) -> bool
Whether the SQL query side (query url + username + password) is configured.
Sourcepub fn basic_credentials(&self) -> Option<Secret>
pub fn basic_credentials(&self) -> Option<Secret>
base64(username:password) for HTTP Basic, or None without query credentials.
Sourcepub fn known_secrets(&self) -> Vec<Secret>
pub fn known_secrets(&self) -> Vec<Secret>
Credential values to redact from error messages and logs.