schema

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 8 Imported by: 0

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

View Source
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

func Generate(configDir string) ([]byte, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL