capability

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package capability lets an embedder narrow what DTL code may do as execution crosses into a user-defined function.

DTL itself has no notion of who owns a function or what it is allowed to touch — that is the embedder's model. So this package carries no policy: it provides the hook the executor calls, and the embedder supplies the meaning.

Absence means unrestricted, deliberately. An embedder that installs no interceptor gets a plain interpreter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enter

func Enter(ctx context.Context, functionName string) context.Context

Enter is called by the executor immediately before running a user function. With no interceptor installed the gate is inert.

func WithInterceptor

func WithInterceptor(ctx context.Context, fn Interceptor) context.Context

WithInterceptor attaches an Interceptor to ctx. A nil Interceptor attaches nothing, so callers need not branch.

Types

type Interceptor

type Interceptor func(ctx context.Context, functionName string) context.Context

Interceptor re-scopes ctx as execution enters functionName. Returning ctx unchanged leaves the caller's authority in place.

func From

func From(ctx context.Context) Interceptor

From returns the Interceptor in ctx, or nil.

Jump to

Keyboard shortcuts

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