Skip to main content

Crate elasticrc

Crate elasticrc 

Source
Expand description

Read-only discovery, parsing, and lazy resolution of Elastic CLI contexts.

Loading a ConfigFile validates only its top-level shape and never executes resolver expressions. Call ServiceConfig::resolve on one selected service configuration to produce a runtime Service.

Runtime credentials use SecretString so common debug formatting does not reveal secret values. Callers should keep those values runtime-only.

use elasticrc::ConfigFile;

let config = ConfigFile::load_with_options(None, None)?;
let elasticsearch = config
    .current()?
    .elasticsearch
    .as_ref()
    .expect("current context has no Elasticsearch service")
    .resolve()?;
println!("Elasticsearch URL: {}", elasticsearch.url);

Structs§

AuthConfig
Raw authentication configuration.
Cloud
Marker for an Elastic Cloud service.
ConfigFile
Raw Elastic CLI configuration.
Context
Services configured for one Elastic CLI context.
Elasticsearch
Marker for an Elasticsearch service.
Kibana
Marker for a Kibana service.
Service
A runtime service with a validated URL and resolved authentication.
ServiceConfig
Raw URL and optional authentication for one context service.

Enums§

Auth
Runtime authentication for a selected service.
ContextServiceReference
Parsed .service or .context.service reference.
Error
Errors produced while discovering, parsing, validating, or resolving config.

Traits§

ServiceType
A service type supported by the Elastic CLI configuration schema.

Functions§

discover_config_path
Find the first readable Elastic CLI config in its documented discovery order.
inline_secret_permission_warning
Return a warning when inline secrets are stored with loose Unix permissions.

Type Aliases§

SecretString
A string whose Debug representation redacts its contents.