engine

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package engine owns the common invocation path shared by runtime handler flavors: one Bindly scope, one input plan, and one lifecycle.

Index

Constants

This section is empty.

Variables

View Source
var ErrSequenceStrategyConflict = errors.New("component sequence strategy conflicts with the root database unit")
View Source
var ErrTransactionConflict = errors.New("component transaction conflicts with the root database unit")
View Source
var ErrUnknownDatabaseIdentity = errors.New("nested component database identity is unknown")

Functions

func ComposeScope

func ComposeScope(parent dexec.ProviderScope, child ...locator.Provider) (dexec.ProviderScope, error)

ComposeScope makes explicit child providers the per-name authority over an inherited protocol scope. The result can be inherited by deeper invocations.

func IsImperativeComponent added in v1.1.0

func IsImperativeComponent(ctx context.Context) bool

IsImperativeComponent reports whether this handler was invoked as an explicit child call. A child writer may flush its own buffered prefix so later sibling readers observe it inside the root-owned transaction.

func PrepareComponent

func PrepareComponent(ctx context.Context, relation ComponentRelation, order string) context.Context

PrepareComponent marks the relationship consumed by the next nested engine invocation. The marker remains internal to Datly's dispatcher flow.

Types

type ComponentRelation

type ComponentRelation string
const (
	ComponentBinding    ComponentRelation = "binding"
	ComponentImperative ComponentRelation = "imperative"
)

type Engine

type Engine struct{}

func New

func New() *Engine

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context, request Request) (actual any, failure error)

type FinalizationError

type FinalizationError struct {
	Route   string
	Outcome xhandler.Outcome
	Err     error
}

FinalizationError distinguishes post-completion work from a failed database transaction. Outcome retains the actual commit/rollback evidence.

func (*FinalizationError) Error

func (e *FinalizationError) Error() string

func (*FinalizationError) Unwrap

func (e *FinalizationError) Unwrap() error

type Request

type Request struct {
	// SequenceStrategy is canonical component metadata, not a client-bound value.
	SequenceStrategy string
	OutputType       reflect.Type
	Injector         *bindly.Injector
	Input            *registry.RouteInputContract
	BoundInput       any
	Replay           *bindly.ReplayBinding
	BindingOutput    any
	Injectors        func(context.Context, any, xhandler.Route) (xhandler.Binder, error)
	Scope            dexec.ProviderScope
	Capabilities     rhandler.InvocationCapabilities
	Providers        []locator.Provider
	// Constants is runtime-derived canonical constant authority. It remains
	// separate from caller-controlled providers so authority cannot be forged.
	Constants locator.Provider
	// Components is runtime-owned route authority and cannot be shadowed by
	// component-registered or protocol-scoped providers.
	Components locator.Provider
	// ComponentInvoker is runtime-owned exact component invocation authority.
	ComponentInvoker locator.Provider
	DataSource       dexec.DataSource
	Handler          rhandler.Handler
	Completion       func(xhandler.Outcome)
}

Jump to

Keyboard shortcuts

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