extensions

package
v0.0.0-...-fdcb3e2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry is a thread-safe registry of task extensions keyed by extension id.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new, empty Registry.

func (*Registry) Get

func (r *Registry) Get(id string) (TaskExtension, bool)

Get retrieves a registered extension by its id.

func (*Registry) Register

func (r *Registry) Register(id string, ext TaskExtension) error

Register adds a new extension for a specific id. It returns an error if an extension with the same id already exists.

type TaskExtension

type TaskExtension interface {
	// Execute runs the custom interceptor logic.
	// - record: the database record representing the task execution context.
	// - payload: read-only map containing client submitted inputs. Extensions may
	//   inspect it but must not mutate it; any mutations are discarded.
	// - properties: extension-specific parameters unmarshaled from template config.
	Execute(ctx context.Context, record *store.TaskRecord, payload map[string]any, properties json.RawMessage) error
}

TaskExtension defines the interface for task complete step interceptors. An extension does one job and is unaware of when it runs — the orchestrator owns the lifecycle (which phase to invoke it in, blocking vs async, error handling). This keeps extensions single-purpose and reusable across any phase.

Jump to

Keyboard shortcuts

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