cuefrontend

package
v0.0.79 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

This is about parsing Fn-specific dialect of Cue.

Index

Constants

View Source
const (
	WorkspaceFile       = "ns-workspace.cue"
	LegacyWorkspaceFile = "fn-workspace.cue"
)

Variables

View Source
var (
	ConsumeNoValue = &consumeNoValue
)
View Source
var ModuleLoader moduleLoader

Functions

func InjectedScope

func InjectedScope(env *schema.Environment) interface{}

Variables that always available for the user in CUE files, without explicit importing.

func LoadResource

func LoadResource(fsys fs.FS, loc pkggraph.Location, path string) (*schema.FileContents, error)

Types

type CueResourceInstance

type CueResourceInstance struct {
	Class     string            `json:"class"`
	Provider  string            `json:"provider"`
	RawIntent any               `json:"intent"`
	Resources map[string]string `json:"resources"`

	// Prefer the definition above.
	Kind     string `json:"kind"`
	On       string `json:"on"`
	RawInput any    `json:"input"`
}

type EvalFuncs

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

func (*EvalFuncs) Fetch

func (s *EvalFuncs) Fetch(ctx context.Context, v cue.Value, kp fncue.KeyAndPath) (interface{}, error)

func (*EvalFuncs) WithFetcher

func (s *EvalFuncs) WithFetcher(key string, f FetcherFunc) *EvalFuncs

type Fetcher

type Fetcher interface {
	Fetch(context.Context, cue.Value, fncue.KeyAndPath) (interface{}, error)
}

type FetcherFunc

type FetcherFunc func(context.Context, cue.Value) (interface{}, error)

func FetchEnv

func FetchEnv(env *schema.Environment) FetcherFunc

func FetchPackage

func FetchPackage(pl pkggraph.PackageLoader) FetcherFunc

func FetchProto

func FetchProto(pl pkggraph.PackageLoader, fsys fs.FS, loc pkggraph.Location) FetcherFunc

func FetchResource

func FetchResource(fsys fs.FS, loc pkggraph.Location) FetcherFunc

func FetchServer

func FetchServer(packages pkggraph.PackageLoader, stack pkggraph.StackEndpoints) FetcherFunc

func FetchServerWorkspace

func FetchServerWorkspace(loc protos.Location) FetcherFunc

type NewSyntaxParser

type NewSyntaxParser interface {
	ParsePackage(ctx context.Context, partial *fncue.Partial, loc pkggraph.Location) (*pkggraph.Package, error)
}

type ResourceList

type ResourceList struct {
	Refs      []string
	Instances map[string]*fncue.CueV
}

func ParseResourceList

func ParseResourceList(v *fncue.CueV) (*ResourceList, error)

func (*ResourceList) ToPack

type WorkspaceLoader

type WorkspaceLoader struct {
	PackageLoader parsing.EarlyPackageLoader
}

func (WorkspaceLoader) SnapshotDir

Directories

Path Synopsis
integration
api
web

Jump to

Keyboard shortcuts

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