Documentation
¶
Overview ¶
Package schema generates the config JSON Schema from the Go types the engine actually parses.
The schema used to be hand-written, which made it a second, independent statement of the config format. Nothing held the two together: a field added to config.Pipeline was invisible to the schema, and a sink added to the registry was rejected by `config validate` while `run` accepted it. That happened, to `type: webhook`.
Reflecting the schema removes the second statement. The Go types are the format, and the schema is an artifact of them.
Index ¶
Constants ¶
const ID = "https://turbolytics.io/schemas/config.json"
ID is the schema's published identifier. Providers reference it, so it does not change.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate reflects config.Conf into a JSON Schema document.
configDir is the path to internal/config, which the reflector reads doc comments from. It is a parameter because the caller's working directory differs: the make target runs from the repository root, the golden test from its own package.
The output is deterministic: the same types produce the same bytes, which is what lets a golden test hold the committed file equal to this.
Types ¶
This section is empty.