validatorutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package validatorutil shares the SchemaLookup construction logic the CLI's `prism validate` command and the Twirp `Validate` RPC both need. The function used to live as a private helper in `cmd/prism/cmd_validate.go`; P14's Twirp service forced the move when `rpc/` started needing the same wiring without pulling in `cmd/prism` (circular).

BuildLookup walks the spec's data + datasets bindings and registers each under both an in-memory StaticLookup (so inline values feed semantic rules) and a PulseLookup (so on-disk .pulse files feed field-existence + scale-compat rules). When any Pulse-backed dataset is present the result is a CompositeLookup (Pulse first, Static fallback); pure-inline specs get the StaticLookup alone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLookup

func BuildLookup(s *spec.Spec, fs afero.Fs) validate.SchemaLookup

BuildLookup builds a SchemaLookup for the spec. fs may be nil; the default is afero.NewOsFs(). The function never returns nil — a spec with no data still gets an empty StaticLookup so callers do not nil-check.

Types

This section is empty.

Jump to

Keyboard shortcuts

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