simplecue

package
v0.0.0-...-894bb81 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAST

func GenerateAST(val cue.Value, c Config) (*ast.Schema, error)

Types

type Config

type Config struct {
	// Package name used to generate code into.
	Package string

	// ForceNamedEnvelope decorates the parsed cue Value with an envelope whose
	// name is given. This is useful for dataqueries for example, where the
	// schema doesn't define any suitable top-level object.
	ForceNamedEnvelope string

	SchemaMetadata ast.SchemaMeta

	Libraries []LibraryInclude

	// NameFunc allows users to specify an alternative naming strategy for
	// objects and references. It is called with the value passed to the top
	// level method or function and the path to the entity being parsed.
	NameFunc NameFunc
}

type LibraryInclude

type LibraryInclude struct {
	FSPath     string // path of the library on the filesystem
	ImportPath string // path used in CUE files to import that library
}

func ParseImports

func ParseImports(cueImports []string) ([]LibraryInclude, error)

type NameFunc

type NameFunc func(value cue.Value, path cue.Path) string

Jump to

Keyboard shortcuts

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