activities

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package activities implements Temporal activities for workflow execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentActivities

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

AgentActivities holds agent execution activity implementations.

func NewAgentActivities

func NewAgentActivities(executor AgentExecutor) *AgentActivities

NewAgentActivities creates a new AgentActivities instance.

func (*AgentActivities) ExecuteAgent

ExecuteAgent executes a single AI agent.

type AgentExecutor

type AgentExecutor interface {
	Execute(ctx context.Context, agentType string, config map[string]string) (json.RawMessage, error)
}

AgentExecutor defines the interface for executing AI agents.

type CompositeNotificationSender

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

CompositeNotificationSender sends to multiple senders.

func NewCompositeNotificationSender

func NewCompositeNotificationSender(senders ...NotificationSender) *CompositeNotificationSender

NewCompositeNotificationSender creates a new composite notification sender.

func (*CompositeNotificationSender) Send

func (s *CompositeNotificationSender) Send(ctx context.Context, notificationType, message string, metadata map[string]string) error

Send implements NotificationSender by sending to all configured senders.

type DatabaseStorageClient

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

DatabaseStorageClient wraps a repository for persistent storage.

func NewDatabaseStorageClient

func NewDatabaseStorageClient(repo WorkflowRepository) *DatabaseStorageClient

NewDatabaseStorageClient creates a new database storage client.

func (*DatabaseStorageClient) SavePipelineResult

func (c *DatabaseStorageClient) SavePipelineResult(ctx context.Context, workflowID string, result json.RawMessage) error

SavePipelineResult saves a pipeline result to the database.

func (*DatabaseStorageClient) SaveTestSuiteResult

func (c *DatabaseStorageClient) SaveTestSuiteResult(ctx context.Context, suiteID string, result json.RawMessage) error

SaveTestSuiteResult saves a test suite result to the database.

type DefaultAgentExecutor

type DefaultAgentExecutor struct{}

DefaultAgentExecutor is a default implementation of AgentExecutor.

func (*DefaultAgentExecutor) Execute

func (e *DefaultAgentExecutor) Execute(ctx context.Context, agentType string, config map[string]string) (json.RawMessage, error)

Execute implements AgentExecutor for the default executor.

type DefaultTestCaseExecutor

type DefaultTestCaseExecutor struct{}

DefaultTestCaseExecutor is a default implementation of TestCaseExecutor.

func (*DefaultTestCaseExecutor) Execute

Execute implements TestCaseExecutor for the default executor.

type InMemoryStorageClient

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

InMemoryStorageClient is an in-memory implementation of StorageClient for testing.

func NewInMemoryStorageClient

func NewInMemoryStorageClient() *InMemoryStorageClient

NewInMemoryStorageClient creates a new in-memory storage client.

func (*InMemoryStorageClient) GetPipelineResult

func (c *InMemoryStorageClient) GetPipelineResult(workflowID string) (json.RawMessage, bool)

GetPipelineResult retrieves a pipeline result from memory.

func (*InMemoryStorageClient) GetTestSuiteResult

func (c *InMemoryStorageClient) GetTestSuiteResult(suiteID string) (json.RawMessage, bool)

GetTestSuiteResult retrieves a test suite result from memory.

func (*InMemoryStorageClient) SavePipelineResult

func (c *InMemoryStorageClient) SavePipelineResult(ctx context.Context, workflowID string, result json.RawMessage) error

SavePipelineResult saves a pipeline result in memory.

func (*InMemoryStorageClient) SaveTestSuiteResult

func (c *InMemoryStorageClient) SaveTestSuiteResult(ctx context.Context, suiteID string, result json.RawMessage) error

SaveTestSuiteResult saves a test suite result in memory.

type LoggingNotificationSender

type LoggingNotificationSender struct{}

LoggingNotificationSender logs notifications instead of sending them.

func (*LoggingNotificationSender) Send

func (s *LoggingNotificationSender) Send(ctx context.Context, notificationType, message string, metadata map[string]string) error

Send implements NotificationSender with logging.

type LoggingStorageClient

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

LoggingStorageClient wraps another client and logs operations.

func NewLoggingStorageClient

func NewLoggingStorageClient(inner StorageClient) *LoggingStorageClient

NewLoggingStorageClient creates a new logging storage client.

func (*LoggingStorageClient) SavePipelineResult

func (c *LoggingStorageClient) SavePipelineResult(ctx context.Context, workflowID string, result json.RawMessage) error

SavePipelineResult saves a pipeline result and logs the operation.

func (*LoggingStorageClient) SaveTestSuiteResult

func (c *LoggingStorageClient) SaveTestSuiteResult(ctx context.Context, suiteID string, result json.RawMessage) error

SaveTestSuiteResult saves a test suite result and logs the operation.

type NoOpNotificationSender

type NoOpNotificationSender struct{}

NoOpNotificationSender is a no-op implementation of NotificationSender.

func (*NoOpNotificationSender) Send

func (s *NoOpNotificationSender) Send(ctx context.Context, notificationType, message string, metadata map[string]string) error

Send implements NotificationSender with a no-op.

type NotificationActivities

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

NotificationActivities holds notification activity implementations.

func NewNotificationActivities

func NewNotificationActivities(sender NotificationSender) *NotificationActivities

NewNotificationActivities creates a new NotificationActivities instance.

func (*NotificationActivities) SendNotification

SendNotification sends a notification about workflow status.

type NotificationSender

type NotificationSender interface {
	Send(ctx context.Context, notificationType, message string, metadata map[string]string) error
}

NotificationSender defines the interface for sending notifications.

type StorageActivities

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

StorageActivities holds storage activity implementations.

func NewStorageActivities

func NewStorageActivities(client StorageClient) *StorageActivities

NewStorageActivities creates a new StorageActivities instance.

func (*StorageActivities) StorePipelineResult

StorePipelineResult stores the result of a pipeline workflow.

func (*StorageActivities) StoreTestSuiteResult

StoreTestSuiteResult stores the result of a test suite workflow.

type StorageClient

type StorageClient interface {
	SavePipelineResult(ctx context.Context, workflowID string, result json.RawMessage) error
	SaveTestSuiteResult(ctx context.Context, suiteID string, result json.RawMessage) error
}

StorageClient defines the interface for storing workflow results.

type TestCaseActivities

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

TestCaseActivities holds test case execution activity implementations.

func NewTestCaseActivities

func NewTestCaseActivities(executor TestCaseExecutor) *TestCaseActivities

NewTestCaseActivities creates a new TestCaseActivities instance.

func (*TestCaseActivities) ExecuteTestCase

ExecuteTestCase executes a single test case.

type TestCaseExecutor

type TestCaseExecutor interface {
	Execute(ctx context.Context, testCase definitions.TestCase) (json.RawMessage, error)
}

TestCaseExecutor defines the interface for executing test cases.

type ValidationActivities

type ValidationActivities struct{}

ValidationActivities holds validation activity implementations.

func NewValidationActivities

func NewValidationActivities() *ValidationActivities

NewValidationActivities creates a new ValidationActivities instance.

func (*ValidationActivities) ValidateInput

ValidateInput validates pipeline input.

func (*ValidationActivities) ValidateTestSuite

ValidateTestSuite validates test suite input.

type WebhookNotificationSender

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

WebhookNotificationSender sends notifications via webhooks.

func NewWebhookNotificationSender

func NewWebhookNotificationSender(webhookURLs map[string]string) *WebhookNotificationSender

NewWebhookNotificationSender creates a new webhook notification sender.

func (*WebhookNotificationSender) Send

func (s *WebhookNotificationSender) Send(ctx context.Context, notificationType, message string, metadata map[string]string) error

Send implements NotificationSender for webhooks.

type WorkflowRepository

type WorkflowRepository interface {
	SaveExecution(ctx context.Context, workflowID string, status string, output json.RawMessage) error
}

WorkflowRepository defines the interface for workflow data persistence.

Directories

Path Synopsis
Package compensation provides compensation (rollback) activities for workflow steps.
Package compensation provides compensation (rollback) activities for workflow steps.

Jump to

Keyboard shortcuts

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