prepare

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package prepare turns the input spec into the one the generator reads: files bundled, overlays applied, then filtered, simplified and pruned.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSpec = errors.New("no spec: set spec.path or pass the spec in memory")
	ErrRead   = errors.New("read")
)

Functions

This section is empty.

Types

type Input

type Input struct {
	Spec   []byte
	Path   string
	Config *config.Config
}

Input is the spec to prepare. Spec, when set, is used instead of reading the file; Path, when set, wins over the config's spec.path and still names the spec for refs and positions.

type Output

type Output struct {
	File        string
	Bytes       []byte
	Positions   map[string]diag.Origin
	Diagnostics []diag.Diagnostic
}

Output is the prepared spec. File names the spec, empty for one in memory without a path. Positions, taken after bundling, map pointers to source files.

func Run

func Run(ctx context.Context, p provider.Provider, in Input) (*Output, error)

Run prepares the spec. Bytes are the input untouched when no step changed anything.

Jump to

Keyboard shortcuts

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