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§
- Auth
Config - Raw authentication configuration.
- Cloud
- Marker for an Elastic Cloud service.
- Config
File - 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.
- Service
Config - Raw URL and optional authentication for one context service.
Enums§
- Auth
- Runtime authentication for a selected service.
- Context
Service Reference - Parsed
.serviceor.context.servicereference. - Error
- Errors produced while discovering, parsing, validating, or resolving config.
Traits§
- Service
Type - 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§
- Secret
String - A string whose
Debugrepresentation redacts its contents.