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 modules, 0 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

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