api

package module
v0.0.0-...-815bbef Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	WorkflowHistoryStream = "WORKFLOW_HISTORY"
	WorkflowTasksStream   = "WORKFLOW_TASKS"
	ActivityTasksStream   = "ACTIVITY_TASKS"
)

NATS Stream Names

View Source
const (
	HistoryFilterSubjectPattern = "history.>"

	CommandRequestSubjectPattern = "command.request.>"

	WorkflowTasksFilterSubjectPattern = "workflow.*.tasks"
	ActivityTasksFilterSubjectPattern = "activity.*.tasks"
)

NATS Subject Patterns

View Source
const (
	ManagerCommandProcessorsConsumer = "manager-command-processors"
	WorkflowTaskProjectorConsumer    = "projector-workflow-tasks"
	ActivityTaskProjectorConsumer    = "projector-activity-tasks"
	WorkflowResultProjectorConsumer  = "projector-workflow-result"

	WorkflowTaskWorkerConsumer = "worker-workflow-tasks"
	ActivityTaskWorkerConsumer = "worker-activity-tasks"
)

Consumer Names

View Source
const (
	WorkflowResultBucket = "workflow-result"
	WorkflowInputBucket  = "workflow-input"
)

KeyValue Bucket Names

View Source
const (
	CommandRequestStart = "command.request.start"
)

Specific Command Subjects

View Source
const (
	HistoryPublishSubjectPattern = "history.%s" // workflowID
)

NATS Subject Format

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityCompleted

type ActivityCompleted struct {
	ID WorkflowID `json:"id"`

	WorkflowFnName string `json:"wf_name"`
	ActivityFnName string `json:"name"`
	Result         []any  `json:"result"`
}

-- Activity Completed Event --

func (*ActivityCompleted) EventName

func (*ActivityCompleted) EventName() string

type ActivityFailed

type ActivityFailed struct {
	ID WorkflowID `json:"id"`

	WorkflowFnName string `json:"wf_name"`
	ActivityFnName string `json:"name"`
	Error          string `json:"error"`
}

-- Activity Failed Event --

func (*ActivityFailed) EventName

func (*ActivityFailed) EventName() string

type ActivityScheduled

type ActivityScheduled struct {
	ID WorkflowID `json:"id"`

	WorkflowFnName string `json:"wf_name"`
	ActivityFnName string `json:"name"`
	Input          []any  `json:"input"`
}

-- Activity Scheduled Event --

func (*ActivityScheduled) EventName

func (*ActivityScheduled) EventName() string

type ActivityStarted

type ActivityStarted struct {
	ID WorkflowID `json:"id"`

	WorkflowFnName string `json:"wf_name"`
	ActivityFnName string `json:"name"`
}

-- Activity Started Event --

func (*ActivityStarted) EventName

func (*ActivityStarted) EventName() string

type ActivityTask

type ActivityTask struct {
	WorkflowFn string `json:"wf_name"`
	WorkflowID string `json:"wf_id"`
	ActivityFn string `json:"ac_name"`
	Input      []any  `json:"input"`
	LastSeq    int    `json:"last_seq"`
}

type Command

type Command struct {
	CommandType WorkflowCommandType `json:"type"`
	Attributes  []byte              `json:"attributes"`
}

type StartWorkflowAttributes

type StartWorkflowAttributes struct {
	WorkflowFnName string `json:"workflow_fn_name"`
	Input          []any  `json:"input"`
}

type StartWorkflowReply

type StartWorkflowReply struct {
	Error      string `json:"error,omitempty"`
	WorkflowID string `json:"workflow_id"`
}

type Task

type Task interface {
	// contains filtered or unexported methods
}

type WorkflowCommandType

type WorkflowCommandType string
const (
	StartWorkflowCommand WorkflowCommandType = "StartWorkflow"
)

type WorkflowCompleted

type WorkflowCompleted struct {
	ID WorkflowID `json:"id"`

	WorkflowFnName string `json:"name"`
	Result         []any  `json:"result"`
}

-- Workflow Completed --

func (*WorkflowCompleted) EventName

func (*WorkflowCompleted) EventName() string

type WorkflowEvent

type WorkflowEvent interface {
	event.Any
	// contains filtered or unexported methods
}

type WorkflowFailed

type WorkflowFailed struct {
	ID WorkflowID `json:"id"`

	WorkflowFnName string `json:"name"`
	Error          string `json:"error"`
}

-- Workflow Failed --

func (*WorkflowFailed) EventName

func (*WorkflowFailed) EventName() string

type WorkflowID

type WorkflowID string

func (WorkflowID) String

func (w WorkflowID) String() string

type WorkflowStarted

type WorkflowStarted struct {
	ID WorkflowID `json:"id"`

	WorkflowFnName string `json:"name"`
	Input          []any  `json:"input"`
}

-- Workflow Started Event --

func (*WorkflowStarted) EventName

func (*WorkflowStarted) EventName() string

type WorkflowTask

type WorkflowTask struct {
	WorkflowID string `json:"wf_id"`
	WorkflowFn string `json:"wf_name"`
	Input      []any  `json:"input"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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