schema

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDefinitions

func FormatDefinitions(val cue.Value) (string, error)

FormatDefinitions returns the formatted CUE definitions from a built schema value.

Types

type CUERegistryFetcher

type CUERegistryFetcher struct {
	// contains filtered or unexported fields
}

CUERegistryFetcher loads a CUE module from the registry and returns a built cue.Value.

func NewCUERegistryFetcher

func NewCUERegistryFetcher(modulePath string) *CUERegistryFetcher

NewCUERegistryFetcher creates a fetcher for the given CUE module path.

func (*CUERegistryFetcher) Fetch

Fetch loads and builds the CUE module from the registry. The context parameter is unused because the CUE load API does not support context-based cancellation or timeouts.

type CUEVersionResolver

type CUEVersionResolver struct {
	// contains filtered or unexported fields
}

CUEVersionResolver queries the CUE registry for all versions of a module and returns the highest semver tag.

func NewCUEVersionResolver

func NewCUEVersionResolver(modulePath string) *CUEVersionResolver

NewCUEVersionResolver creates a CUEVersionResolver for the given module path.

func (*CUEVersionResolver) Fetch

type ValidateResult

type ValidateResult struct {
	Valid   bool
	Errors  []string
	Message string
}

ValidateResult holds the outcome of validating YAML against a CUE definition.

func Validate

func Validate(schema cue.Value, definition, yamlContent string) (ValidateResult, error)

Validate checks YAML content against a named CUE definition within the schema.

Jump to

Keyboard shortcuts

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