Expand description
Build a PipelineConfig from a snapshot of FAUCET_* environment variables.
The public surface is intentionally split between pure functions (taking a
HashMap<String, String> env snapshot — fully testable) and a thin shell
from_process_env() that captures std::env::vars().
See cli/README.md and issue #42 for the user-facing variable schema.
Functions§
- build_
named_ sinks - Same as
build_named_sourcesbut for sinks viaFAUCET_SINKS_<NAME>_*. - build_
named_ sources - Harvest named source templates from
FAUCET_SOURCES_<NAME>_TYPEselectors andFAUCET_SOURCES_<NAME>_<FIELD>config fields.<NAME>is lowercased. - build_
pipeline_ config - Construct a complete
PipelineConfigfrom an env snapshot. - build_
sink - Construct the sink
ConnectorSpecfromFAUCET_SINK+FAUCET_SINK_<KIND>_*. - build_
source - Construct the source
ConnectorSpecfromFAUCET_SOURCE+FAUCET_SOURCE_<KIND>_*. - build_
state - Construct an optional
StateStoreSpecfromFAUCET_STATE+FAUCET_STATE_<KIND>_*. ReturnsOk(None)whenFAUCET_STATEis unset or empty (the common case). - build_
transforms - Construct an ordered
Vec<TransformSpec>fromFAUCET_TRANSFORM_<N>selectors andFAUCET_TRANSFORM_<N>_<FIELD>config fields. Indices must be contiguous starting at 1; any gap is an error so a misnumbered var never silently drops a transform. - build_
vars - Harvest
FAUCET_VARS_<KEY>into the top-level vars map. ReturnsNonewhen noFAUCET_VARS_*variables are set. - extract_
scope - Walk every env var starting with
prefix, strip the prefix, lowercase the remainder into a field name, apply the_JSONprecedence rule, and assemble aValue::Object. Returns the object verbatim — no shape validation; the connector’s ownDeserializeimpl is the gate. - from_
process_ env - Snapshot
std::env::vars()and callbuild_pipeline_config.