schemaconcat

package
v0.2026294.550 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 4 Imported by: 4 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

THE single schema-concatenation contract (R3).

Both the runtime (charly core (cue_schema.go) `sharedCueSchema`) and the dev-time code generator (internal/schemagen) need to concatenate every package-less schema/*.cue file into ONE compilation unit. They used to carry two byte-identical-by-comment copies of the same loop; this is the ONE copy they both call, so the compiled schema (what the runtime validates against) and the generated Go types (`cue exp gengotypes`) can never drift.

Leaf package (no deps beyond stdlib `io/fs`) so the dev-time generator can call it WITHOUT importing the spec package it regenerates.

STANDALONE: depends only on the stdlib `io/fs` abstraction, so the runtime passes its `//go:embed` FS and the generator passes `os.DirFS(schemaDir)`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcatSchema

func ConcatSchema(fsys fs.FS, dir string, exclude func(name string) bool) (string, []string, error)

ConcatSchema reads every `*.cue` file in fsys under dir (skipping any for which exclude reports true — pass nil to include all), sorts the names for a deterministic result, and joins the file bodies with a trailing newline. It returns the joined body (WITHOUT any package clause) and the sorted list of files included.

Types

This section is empty.

Jump to

Keyboard shortcuts

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