actionruntime

package
v0.3.0-alpha.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine is the internal governed execution boundary for registered Actions. It applies validation, authorization, Preview binding, idempotency, transactions, and audit semantics independently of the calling channel.

func New

func New(registry *Registry, options Options) (*Engine, error)

New validates its dependencies and constructs a Runtime for trusted framework assembly without executing an Action.

func (*Engine) CleanupExpiredPlans

func (r *Engine) CleanupExpiredPlans(ctx context.Context) (deletedCount int64, returnErr error)

CleanupExpiredPlans removes expired Preview plans while holding a Runtime lease.

func (*Engine) Execute

func (r *Engine) Execute(ctx context.Context, request action.Request) (_ action.Result, returnErr error)

Execute runs one governed Action request and returns its validated result.

func (*Engine) Preview

func (r *Engine) Preview(ctx context.Context, request action.Request) (preview action.Preview, returnErr error)

Preview validates, authorizes, plans, and durably audits a caller-visible plan.

type Options

type Options struct {
	Authorizer   authz.Authorizer
	Audit        audit.Hook
	Plans        actionpersistence.PlanStore
	Idempotency  actionpersistence.IdempotencyStore
	Transactions runtimecontrol.TransactionManager
	Clock        func() time.Time
	PlanTTL      time.Duration
	AuditTimeout time.Duration
	AuditFailure func(context.Context, error, audit.Event)
}

Options supplies the required governance services and optional timing policy used by a Runtime. Zero durations select conservative defaults.

type Registry

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

Registry owns mutable Handler bindings exclusively inside framework assembly. Callers outside this internal package cannot construct or mutate it.

func NewRegistry

func NewRegistry() *Registry

NewRegistry constructs an empty internal Action registry.

func (*Registry) BindPrepared

func (registry *Registry) BindPrepared(moduleID string, prepared action.PreparedDescriptor, handler action.Handler) error

BindPrepared attaches runtime behavior to an already compiled contract.

func (*Registry) List

func (registry *Registry) List() []action.CatalogEntry

List returns deterministic defensive read-only catalog entries.

func (*Registry) Register

func (registry *Registry) Register(moduleID string, descriptor action.Descriptor, handler action.Handler) error

Register validates and binds one Action descriptor and Handler.

func (*Registry) Reset

func (registry *Registry) Reset(ctx context.Context) error

Reset revokes execution and waits for every active lease to drain.

func (*Registry) Resolve

func (registry *Registry) Resolve(id string) (action.CatalogEntry, bool)

Resolve returns one defensive read-only catalog entry without its Handler.

func (*Registry) Revoke

func (registry *Registry) Revoke() error

Revoke atomically rejects new execution, clears bindings, and cancels leases.

Jump to

Keyboard shortcuts

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