process

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package process composes local request decisions with protected domain operations in one tenant transaction. It owns transaction coordination, not request policy or business invariants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

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

func NewCoordinator

func NewCoordinator(requestService *requests.Service, engine *kernel.Kernel, registry *doctype.Registry, begin TenantTransaction, workflows map[string]WorkflowApproval) (*Coordinator, error)

func (*Coordinator) ApproveAndApply

func (c *Coordinator) ApproveAndApply(ctx context.Context, exec policy.Execution, requestID contract.RequestID, command contract.RespondRequest) (contract.ResponseReceipt, error)

ApproveAndApply records an authorized approval response and applies its registered workflow transition atomically when that response resolves the request as approved or rejected. The request service performs current response authorization before Begin is called. A replay returns the original receipt without opening a transaction or rerunning the effect.

type TenantTransaction

type TenantTransaction func(context.Context, contract.TenantID) (database *sql.DB, transaction *sql.Tx, release func(), err error)

TenantTransaction opens one tenant transaction and returns its release callback. Implementations acquire tenant active-work admission before opening SQL and release it only after commit or rollback.

func NewTenantTransactionOpener

func NewTenantTransactionOpener(tenant contract.TenantID, database *sql.DB, admission *dbaccess.Admission) (TenantTransaction, error)

NewTenantTransactionOpener binds the coordinator to one stable tenant DB and the same bounded active-work admission used by its HTTP/request path. An existing request admission is reused; non-HTTP callers acquire a permit here and hold it until the coordinator commits or rolls back.

type WorkflowApproval

type WorkflowApproval struct {
	SubjectKind  string
	Action       string
	RejectAction string
}

WorkflowApproval maps a server-owned governed policy to a named document workflow action. Request bodies cannot choose this mapping or command.

type WorkflowCapabilityLeaseAdmission

type WorkflowCapabilityLeaseAdmission interface {
	AdmitCapabilityAttemptInTx(context.Context, *sql.Tx, contract.CapabilityLease, time.Time) error
}

type WorkflowLocalActionExecutor

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

WorkflowLocalActionExecutor executes only registered domain operations and commits their idempotency receipt, outbox effects, and workflow progress in the same tenant transaction.

func (*WorkflowLocalActionExecutor) ExecuteLocal

type WorkflowLocalStepStore

type WorkflowLocalStepStore interface {
	ValidateClaimInTx(context.Context, *sql.Tx, workflow.Claim) error
	CommitStepInTx(context.Context, *sql.Tx, workflow.StepCommit) error
}

WorkflowLocalStepStore is implemented by the durable workflow SQL store. Both methods operate on the caller-owned transaction.

type WorkflowOperationBuilder

type WorkflowOperationBuilder func(context.Context, workflow.ActionContext, workflow.ActionInput) (kernel.Operation, error)

WorkflowOperationBuilder is trusted assembly code registered for one immutable action key. It translates validated action input into a domain command; workflow JSON cannot select a Go function or command policy.

Jump to

Keyboard shortcuts

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