Documentation
¶
Index ¶
- Variables
- func RegisterEngineExecutionServiceWithOptions(registrar grpc.ServiceRegistrar, engine *Engine, ...) error
- type Admission
- type ArtifactResolver
- type ArtifactResolverFunc
- type BearerTokenAuthenticator
- type Engine
- func (engine *Engine) ActiveGenerationDigest() string
- func (engine *Engine) Close() error
- func (engine *Engine) ConfigureLedger(durable ledger.ExecutionLedger, resolver ArtifactResolver) error
- func (engine *Engine) ConfigureWorkflow(store workflow.OutboxStore, provider fencing.Provider, ...) error
- func (engine *Engine) DryRun(ctx context.Context, facts map[string]any) ([]PlanEvaluation, error)
- func (engine *Engine) Execute(ctx context.Context, request ExecuteRequest) (result ExecuteResult, resultErr error)
- func (engine *Engine) Generation() *Generation
- func (engine *Engine) GenerationView() *GenerationView
- func (engine *Engine) SetObserver(observer Observer)
- type EngineExecutionService
- type EngineExecutionServiceOptions
- type ExecuteRequest
- type ExecuteResult
- type GRPCAuthenticator
- type GRPCAuthenticatorFunc
- type Generation
- func (generation *Generation) Checked() *ir.Checked
- func (generation *Generation) Close() error
- func (generation *Generation) Closed() bool
- func (generation *Generation) Digest() string
- func (generation *Generation) Environment() ir.Environment
- func (generation *Generation) Executor(verb string) (invocation.Executor, bool)
- func (generation *Generation) ExecutorDescriptors() map[string]invocation.Descriptor
- func (generation *Generation) FunctionIDs() map[string]string
- func (generation *Generation) Ruleset() string
- func (generation *Generation) SourceDigest() string
- func (generation *Generation) Version() string
- type GenerationBuildConfig
- type GenerationConfig
- type GenerationView
- type ManifestArtifactResolver
- type Observer
- type PlanEvaluation
- type PlanView
- type RecoveryObservation
- type RecoveryWorker
- type RulesetExecutionServer
- func NewRulesetExecutionServer(engine *Engine, addr string) (*RulesetExecutionServer, error)
- func NewRulesetExecutionServerOnListener(engine *Engine, listener net.Listener, options RulesetExecutionServerOptions) (*RulesetExecutionServer, error)
- func NewRulesetExecutionServerWithOptions(engine *Engine, addr string, options RulesetExecutionServerOptions) (*RulesetExecutionServer, error)
- type RulesetExecutionServerOptions
- type WaitMode
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidExecuteRequest = errors.New("invalid engine execute request") ErrExecutionNotFound = errors.New("engine execution not found") // ErrIdentityConflict is the canonical identity-conflict sentinel. Durable // stores use the same sentinel so transports classify direct and raced // persistence conflicts consistently. ErrIdentityConflict = schema.ErrIdentityConflict ErrGenerationMismatch = errors.New("engine generation mismatch") ErrBlockedDependency = errors.New("execution blocked by missing dependency") ErrDurableDisposition = errors.New("durable execution disposition failed") )
var ( ErrGRPCInvalidInput = errors.New("invalid gRPC execution input") ErrGRPCResourceExhausted = errors.New("gRPC execution resource exhausted") )
Functions ¶
func RegisterEngineExecutionServiceWithOptions ¶
func RegisterEngineExecutionServiceWithOptions(registrar grpc.ServiceRegistrar, engine *Engine, options EngineExecutionServiceOptions) error
Types ¶
type Admission ¶
type Admission struct {
ExecutionID string `json:"execution_id"`
AdmissionID string `json:"admission_id,omitempty"`
TenantNamespace string `json:"tenant_namespace"`
Ruleset string `json:"ruleset"`
Version string `json:"version"`
Facts map[string]any `json:"facts"`
MergePolicy string `json:"merge_policy,omitempty"`
ExpectedGenerationDigest string `json:"expected_generation_digest,omitempty"`
}
type ArtifactResolver ¶
type ArtifactResolver interface {
ResolveGeneration(context.Context, ledger.ExecutionArtifact) (*Generation, error)
}
ArtifactResolver reconstructs a callback-free Generation from one immutable durable artifact. It intentionally has no compiler or loader surface.
type ArtifactResolverFunc ¶
type ArtifactResolverFunc func(context.Context, ledger.ExecutionArtifact) (*Generation, error)
func (ArtifactResolverFunc) ResolveGeneration ¶ added in v0.4.0
func (f ArtifactResolverFunc) ResolveGeneration(ctx context.Context, artifact ledger.ExecutionArtifact) (*Generation, error)
type BearerTokenAuthenticator ¶
type BearerTokenAuthenticator struct {
// contains filtered or unexported fields
}
func NewBearerTokenAuthenticator ¶
func NewBearerTokenAuthenticator(token string) (*BearerTokenAuthenticator, error)
func NewBearerTokenAuthenticatorSet ¶
func NewBearerTokenAuthenticatorSet(tokens []string) (*BearerTokenAuthenticator, error)
func (*BearerTokenAuthenticator) Authenticate ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine owns exactly one immutable Generation. A process must be replaced to execute a changed bundle; durable recovery resolves the generation pinned in the execution artifact rather than consulting mutable process state.
func NewEngine ¶
func NewEngine(generation *Generation) (*Engine, error)
func (*Engine) ActiveGenerationDigest ¶
func (*Engine) ConfigureLedger ¶
func (engine *Engine) ConfigureLedger(durable ledger.ExecutionLedger, resolver ArtifactResolver) error
func (*Engine) ConfigureWorkflow ¶ added in v0.4.0
func (engine *Engine) ConfigureWorkflow(store workflow.OutboxStore, provider fencing.Provider, options schema.DispatcherOptions) error
func (*Engine) Execute ¶
func (engine *Engine) Execute(ctx context.Context, request ExecuteRequest) (result ExecuteResult, resultErr error)
func (*Engine) Generation ¶ added in v0.4.0
func (engine *Engine) Generation() *Generation
func (*Engine) GenerationView ¶ added in v0.4.0
func (engine *Engine) GenerationView() *GenerationView
func (*Engine) SetObserver ¶
type EngineExecutionService ¶
type EngineExecutionService struct {
effectusv1.UnimplementedRulesetExecutionServiceServer
Engine *Engine
// contains filtered or unexported fields
}
EngineExecutionService is the sole generated inbound gRPC facade. It has no mutable method registry and admits work only through Engine.Execute.
func (*EngineExecutionService) ExecuteRuleset ¶
func (service *EngineExecutionService) ExecuteRuleset(ctx context.Context, request *effectusv1.ExecutionRequest) (*effectusv1.ExecutionResponse, error)
type ExecuteRequest ¶
type ExecuteRequest struct {
Admission *Admission
ResumeExecutionID string
WaitMode WaitMode
RecoveryLease *schema.ExecutionLease
}
type ExecuteResult ¶
type GRPCAuthenticator ¶
type GRPCAuthenticatorFunc ¶
func (GRPCAuthenticatorFunc) Authenticate ¶
type Generation ¶
type Generation struct {
// contains filtered or unexported fields
}
Generation is immutable after construction. Manager ownership and acquired handles are the only references counted for retirement.
func CompileGeneration ¶ added in v0.4.0
func CompileGeneration(ctx context.Context, config GenerationBuildConfig) (*Generation, error)
CompileGeneration compiles one source bundle exactly once, resolves every declared invocation descriptor, and freezes the resulting Generation.
func NewGeneration ¶
func NewGeneration(config GenerationConfig) (*Generation, error)
func (*Generation) Checked ¶
func (generation *Generation) Checked() *ir.Checked
func (*Generation) Close ¶ added in v0.4.0
func (generation *Generation) Close() error
Close retires all generation-owned resources exactly once in reverse acquisition order. A changed generation requires replacing the process.
func (*Generation) Closed ¶
func (generation *Generation) Closed() bool
Closed reports whether generation-owned executor resources are retired.
func (*Generation) Digest ¶
func (generation *Generation) Digest() string
func (*Generation) Environment ¶
func (generation *Generation) Environment() ir.Environment
func (*Generation) Executor ¶
func (generation *Generation) Executor(verb string) (invocation.Executor, bool)
func (*Generation) ExecutorDescriptors ¶ added in v0.4.0
func (generation *Generation) ExecutorDescriptors() map[string]invocation.Descriptor
ExecutorDescriptors returns the immutable resolver manifest.
func (*Generation) FunctionIDs ¶ added in v0.4.0
func (generation *Generation) FunctionIDs() map[string]string
FunctionIDs returns the immutable function resolver identities.
func (*Generation) Ruleset ¶
func (generation *Generation) Ruleset() string
func (*Generation) SourceDigest ¶
func (generation *Generation) SourceDigest() string
func (*Generation) Version ¶
func (generation *Generation) Version() string
type GenerationBuildConfig ¶ added in v0.4.0
type GenerationBuildConfig struct {
Bundle *bundle.SourceBundle
CompileOptions compiler.CompileOptions
Resolvers *invocation.Registry
FunctionIDs map[string]string
Production bool
}
GenerationBuildConfig is the single source-bundle to generation startup input.
type GenerationConfig ¶
type GenerationConfig struct {
Checked *ir.Checked
Environment ir.Environment
Ruleset string
Version string
ExecutorDescriptors map[string]invocation.Descriptor
FunctionIDs map[string]string
SourceDigest string
Executors map[string]invocation.Executor
Closers []io.Closer
Production bool
}
GenerationConfig contains every value covered by a generation digest.
type GenerationView ¶ added in v0.4.0
type ManifestArtifactResolver ¶
type ManifestArtifactResolver struct {
// contains filtered or unexported fields
}
ManifestArtifactResolver rebuilds a generation only from the descriptor manifest durably pinned with an execution. No extension loader or callback implementation participates in recovery.
func NewManifestArtifactResolver ¶
func NewManifestArtifactResolver(registries ...*invocation.Registry) *ManifestArtifactResolver
func (*ManifestArtifactResolver) ResolveGeneration ¶ added in v0.4.0
func (resolver *ManifestArtifactResolver) ResolveGeneration(ctx context.Context, artifact ledger.ExecutionArtifact) (*Generation, error)
type Observer ¶
type Observer interface {
ObserveExecution(ExecuteResult, error)
ObserveRecovery(RecoveryObservation)
}
type PlanEvaluation ¶ added in v0.4.0
type PlanView ¶ added in v0.4.0
type PlanView struct {
ID string
Dialect effectusv1.SourceDialect
Priority int32
Predicate string
Verbs []string
}
type RecoveryObservation ¶
type RecoveryWorker ¶
type RecoveryWorker struct {
Engine *Engine
Store ledger.ExecutionLedger
Owner string
BatchSize int
LeaseDuration time.Duration
PollInterval time.Duration
Observer Observer
}
type RulesetExecutionServer ¶
type RulesetExecutionServer struct {
// contains filtered or unexported fields
}
func NewRulesetExecutionServer ¶
func NewRulesetExecutionServer(engine *Engine, addr string) (*RulesetExecutionServer, error)
func NewRulesetExecutionServerOnListener ¶
func NewRulesetExecutionServerOnListener(engine *Engine, listener net.Listener, options RulesetExecutionServerOptions) (*RulesetExecutionServer, error)
func NewRulesetExecutionServerWithOptions ¶
func NewRulesetExecutionServerWithOptions(engine *Engine, addr string, options RulesetExecutionServerOptions) (*RulesetExecutionServer, error)
func (*RulesetExecutionServer) Address ¶
func (server *RulesetExecutionServer) Address() net.Addr
func (*RulesetExecutionServer) Ready ¶
func (server *RulesetExecutionServer) Ready() error
func (*RulesetExecutionServer) Start ¶
func (server *RulesetExecutionServer) Start() error
func (*RulesetExecutionServer) Stop ¶
func (server *RulesetExecutionServer) Stop()
type RulesetExecutionServerOptions ¶
type RulesetExecutionServerOptions struct {
MaxReceiveBytes int
MaxSendBytes int
MaxExecutionDuration time.Duration
MaxConcurrentRPCs int
Authenticator GRPCAuthenticator
AllowUnauthenticated bool
TLSConfig *tls.Config
AllowInsecureTransport bool
RulesetName string
Version string
}
RulesetExecutionServerOptions defines the immutable service registration and transport policy. The generated service is registered in the constructor, before Serve can be called.