schemaconcat

package
v0.2026195.22 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 4 Imported by: 0

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