Documentation ¶
Overview ¶
This is about parsing Fn-specific dialect of Cue.
Index ¶
- Constants
- Variables
- func InjectedScope(env *schema.Environment) *cueInjectedScope
- func LoadResource(fsys fs.FS, loc pkggraph.Location, path string) (*schema.FileContents, error)
- func NewFrontend(pl parsing.EarlyPackageLoader, opaqueParser NewSyntaxParser, ...) parsing.Frontend
- func ParseMounts(ctx context.Context, pl parsing.EarlyPackageLoader, loc pkggraph.Location, ...) ([]*schema.Mount, []*schema.Volume, error)
- func ParseNaming(v *fncue.CueV) (*schema.Naming, error)
- func ParsePackage(ctx context.Context, env *schema.Environment, pl parsing.EarlyPackageLoader, ...) (*pkggraph.Package, error)
- func ParsePort(name string, port CuePort) (*schema.Endpoint_Port, error)
- func ParseResourceInstanceFromCue(ctx context.Context, env *schema.Environment, pl parsing.EarlyPackageLoader, ...) (*schema.ResourceInstance, error)
- func ParseVolumes(ctx context.Context, pl parsing.EarlyPackageLoader, loc pkggraph.Location, ...) ([]*schema.Volume, error)
- func ValidateNoExtraFields(loc pkggraph.Location, messagePrefix string, v *fncue.CueV, ...) error
- type CuePort
- type CueResourceInstance
- type EvalFuncs
- type Fetcher
- type FetcherFunc
- func FetchPackage(pl pkggraph.PackageLoader) FetcherFunc
- func FetchProto(pl pkggraph.PackageLoader, fsys fs.FS, loc pkggraph.Location) FetcherFunc
- func FetchResource(fsys fs.FS, loc pkggraph.Location) FetcherFunc
- func FetchServer(packages pkggraph.PackageLoader, stack pkggraph.StackEndpoints) FetcherFunc
- func FetchServerWorkspace(loc protos.Location) FetcherFunc
- type NewSyntaxParser
- type ResourceList
- type WorkspaceLoader
Constants ¶
View Source
const ( WorkspaceFile = "ns-workspace.cue" LegacyWorkspaceFile = "fn-workspace.cue" )
View Source
const (
Version_SyntaxVersionMarker = 54
)
Variables ¶
View Source
var (
ConsumeNoValue = &consumeNoValue
)
View Source
var ModuleFields = []string{
"module", "requirements", "replace", "dependency", "prebuilts", "environment",
"experimentalProtoModuleImports", "enabledFeatures",
}
Consider using https://pkg.go.dev/reflect#StructTag to infer this from cueModule
View Source
var ModuleLoader moduleLoader
Functions ¶
func InjectedScope ¶
func InjectedScope(env *schema.Environment) *cueInjectedScope
Variables that always available for the user in CUE files, without explicit importing.
func LoadResource ¶
func NewFrontend ¶
func NewFrontend(pl parsing.EarlyPackageLoader, opaqueParser NewSyntaxParser, env *schema.Environment) parsing.Frontend
func ParseMounts ¶
func ParsePackage ¶ added in v0.0.108
func ParsePackage(ctx context.Context, env *schema.Environment, pl parsing.EarlyPackageLoader, v *fncue.CueV, loc pkggraph.Location) (*pkggraph.Package, error)
Common parsing code between new and old syntaxes.
func ParsePort ¶ added in v0.0.324
func ParsePort(name string, port CuePort) (*schema.Endpoint_Port, error)
func ParseResourceInstanceFromCue ¶
func ParseResourceInstanceFromCue(ctx context.Context, env *schema.Environment, pl parsing.EarlyPackageLoader, pkg *pkggraph.Package, name string, v *fncue.CueV) (*schema.ResourceInstance, error)
func ParseVolumes ¶
Types ¶
type CueResourceInstance ¶
type EvalFuncs ¶
type EvalFuncs struct {
// contains filtered or unexported fields
}
func (*EvalFuncs) WithFetcher ¶
func (s *EvalFuncs) WithFetcher(key string, f FetcherFunc) *EvalFuncs
type 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 ResourceList ¶
func ParseResourceList ¶
func ParseResourceList(v *fncue.CueV) (*ResourceList, error)
func (*ResourceList) ToPack ¶
func (rl *ResourceList) ToPack(ctx context.Context, env *schema.Environment, pl parsing.EarlyPackageLoader, pkg *pkggraph.Package) (*schema.ResourcePack, error)
type WorkspaceLoader ¶
type WorkspaceLoader struct {
PackageLoader parsing.EarlyPackageLoader
}
func (WorkspaceLoader) SnapshotDir ¶
func (wl WorkspaceLoader) SnapshotDir(ctx context.Context, pkgname schema.PackageName, opts memfs.SnapshotOpts) (*fncue.PackageContents, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.