velty

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package velty compiles Datly predicate metadata into Velty-backed runtime evaluators exposed through the exec.PredicateEvaluator port.

Index

Constants

View Source
const VariableName = "predicate"

Variables

This section is empty.

Functions

func Names

func Names() []string

Names returns the predicate names available to compilation. The returned slice is detached and sorted for stable authoring metadata and validation.

Types

type Builder

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

func (*Builder) And

func (b *Builder) And() *Builder

func (*Builder) Build

func (b *Builder) Build(keyword string) string

func (*Builder) Combine

func (b *Builder) Combine(fragments ...string) *Builder

func (*Builder) CombineAnd

func (b *Builder) CombineAnd(fragments ...string) *Builder

func (*Builder) CombineOr

func (b *Builder) CombineOr(fragments ...string) *Builder

func (*Builder) Or

func (b *Builder) Or() *Builder

type CompileInput

type CompileInput struct {
	Component *spec.Component
	InputType reflect.Type
	Bindings  []bindly.BindingSpec
	Lookup    LookupType
}

type Context

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

func (*Context) Builder

func (c *Context) Builder() *Builder

func (*Context) Expand

func (c *Context) Expand(group int) (string, error)

func (*Context) ExpandWith

func (c *Context) ExpandWith(group int, operator string) (string, error)

func (*Context) FilterGroup

func (c *Context) FilterGroup(group int, operator string) (string, error)

type DefinitionCompiler

type DefinitionCompiler struct {
	Context *typecatalog.ResolutionContext
}

DefinitionCompiler preserves handler type identity before metadata leaves its authored import scope. It does not require linked types during generation. Builtin predicate arguments remain strings owned by their templates.

func (DefinitionCompiler) Compile

func (c DefinitionCompiler) Compile(component *spec.Component) error

Compile updates compiler-owned component metadata. Callers must clone shared components before invoking it.

type LookupType

type LookupType func(name string) (reflect.Type, error)

type Program

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

func Compile

func Compile(input CompileInput) (*Program, error)

func (*Program) ContextType

func (*Program) ContextType() reflect.Type

func (*Program) NewContext

func (p *Program) NewContext(ctx context.Context, binder xhandler.Binder, appendArgs func(...any)) (any, error)

Jump to

Keyboard shortcuts

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