embedded

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package embedded provides a small checked-runtime facade for Go applications.

The default stores are process-local. Use effectusd when executions must survive application or host restarts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Permanent

func Permanent(err error) invocation.Outcome

Permanent returns a permanent business failure.

func Retryable

func Retryable(err error) invocation.Outcome

Retryable returns a known-not-committed retryable outcome.

func Success

func Success(result any) invocation.Outcome

Success returns a successful business outcome.

func Unknown

func Unknown(err error) invocation.Outcome

Unknown returns an outcome whose commit state is not known.

Types

type Builder

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

Builder collects checked sources, fact declarations, and business verbs.

func New

func New(ruleset, version string) *Builder

New creates an embedded runtime builder.

func (*Builder) AddFact

func (builder *Builder) AddFact(path string, sample any) *Builder

AddFact declares a fact path and a representative value for type checking.

func (*Builder) AddSource

func (builder *Builder) AddSource(path string, data []byte) *Builder

AddSource adds one in-memory .eff or .effx source file.

func (*Builder) AddVerb

func (builder *Builder) AddVerb(verb Verb) *Builder

AddVerb registers one invocation-aware in-process business operation.

func (*Builder) Build

func (builder *Builder) Build(ctx context.Context) (*Runtime, error)

Build checks all declarations and publishes one immutable generation.

type HandlerFunc

HandlerFunc executes one checked verb with Effectus invocation metadata.

type Request

type Request struct {
	Namespace      string
	IdempotencyKey string
	Facts          map[string]any
	WaitMode       effectusruntime.WaitMode
}

Request is one embedded execution admission.

type Resource

type Resource struct {
	Name         string
	Capabilities []string
}

Resource declares the capability required for one business resource.

type Runtime

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

Runtime owns one checked embedded generation.

func (*Runtime) Close

func (runtime *Runtime) Close() error

Close releases resources owned by the embedded runtime.

func (*Runtime) Execute

func (runtime *Runtime) Execute(ctx context.Context, request Request) (effectusruntime.ExecuteResult, error)

Execute admits or replays one request through runtime.Engine.

type Verb

type Verb struct {
	Name         string
	Description  string
	ArgTypes     map[string]string
	RequiredArgs []string
	ReturnType   string
	InverseVerb  string
	Capabilities []string
	Resources    []Resource
	Handler      HandlerFunc
}

Verb declares one in-process business operation.

Jump to

Keyboard shortcuts

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