Documentation
¶
Overview ¶
Package gen is the engine: schema.Schema + rng → records. It knows nothing about Go structs — it produces map[string]any keyed by field name, which the public API scatters back into T.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// Chaos is the probability [0,1] that a string/numeric field carries an
// edge-case value instead of a normal one (see WithChaos).
Chaos float64
// contains filtered or unexported fields
}
Engine holds a compiled, validated schema ready to generate records.
func Compile ¶
Compile validates the schema (unknown kinds, from= cycles) and computes the field generation order once. Returns an error for configuration problems.
func (*Engine) Err ¶ added in v1.5.0
Err reports the first error hit while generating records, if any. Record cannot return one, so callers that can surface an error check this after their generation loop.
func (*Engine) HasUnique ¶
HasUnique reports whether any field requires unique values. Unique tracking is stateful, so callers must use serial generation when this is true.