Documentation ¶
Overview ¶
Package wfsclient establishes the communication between client program and the FSE workflow API server wfs via http.
Index ¶
- type Client
- func (c Client) Create(ctx context.Context, workflowID, taskQueue string, cm ContextualMap) (wfID, runID string, err error)
- func (c Client) History(ctx context.Context, workflowID string, rolenames []string) ([]HistoryEvent, error)
- func (c Client) Inspect(ctx context.Context, workflowID string, rolenames []string) (exec.WFState, error)
- func (c Client) InspectSchema(ctx context.Context, workflowID string, rolenames []string) (exec.WFStateWithSchema, error)
- func (c Client) List(ctx context.Context, BOID string, option string, rolenames []string) ([]exec.WFState, error)
- func (c Client) Schema(ctx context.Context, option string, rolenames []string) ([]exec.WFWithStates, error)
- func (c Client) Signal(ctx context.Context, workflowID, signal string, rolenames []string, ...) (exec.WFState, error)
- func (c Client) Terminate(ctx context.Context, workflowID, reason string) error
- type ContextualMap
- type EventType
- type HistoryEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL string // BaseURL must not end with a slash
}
Client decribes an http request/response connection to the FSE wf API server located at BaseURL. The API succeeds with empty lists and values using the zero Client without doing any actual communication.
func (Client) Create ¶
func (c Client) Create(ctx context.Context, workflowID, taskQueue string, cm ContextualMap) (wfID, runID string, err error)
Create creates a new FSE workflow instance, via a workflow id and a task queue name obtained via List. It is not an error to Create an ID twice, however at most only one instance is beeing executed. It returns the workflowID and the temporal runID identifying the particular, currently executing instance. The ContextualMap cm is passed to the interpreter and finally to all function calls (i.e. workflow actions) called from it.
func (Client) History ¶ added in v0.8.14
func (c Client) History(ctx context.Context, workflowID string, rolenames []string) ([]HistoryEvent, error)
History returns the replayable temporal history of an FSE workflow instance
func (Client) Inspect ¶
func (c Client) Inspect(ctx context.Context, workflowID string, rolenames []string) (exec.WFState, error)
Inspect returns the state description of an FSE workflow instance
func (Client) InspectSchema ¶ added in v0.7.13
func (c Client) InspectSchema(ctx context.Context, workflowID string, rolenames []string) (exec.WFStateWithSchema, error)
InspectSchema returns the state description of an FSE workflow instance and the WF Type's schema
func (Client) List ¶
func (c Client) List(ctx context.Context, BOID string, option string, rolenames []string) ([]exec.WFState, error)
List lists all registered workflows
func (Client) Schema ¶ added in v0.5.6
func (c Client) Schema(ctx context.Context, option string, rolenames []string) ([]exec.WFWithStates, error)
Schema lists all registered workflows
func (Client) Signal ¶
func (c Client) Signal(ctx context.Context, workflowID, signal string, rolenames []string, cm ContextualMap) (exec.WFState, error)
Signal sends a signal to an FSE workflow instance to trigger an active event. The ContextualMap cm is passed to the interpreter and finally to all function calls (i.e. workflow actions) called from it.
type ContextualMap ¶ added in v0.6.7
ContextualMap must be provided for create and signal operations, it contains context information to be passed through to all function calls in the workflow interpreter
type EventType ¶ added in v0.8.14
type EventType int32
EventType is the type of event happened. It determines the Attribute Schema of a HistoryEvent
const ( EVENT_TYPE_UNSPECIFIED EventType = 0 EVENT_TYPE_WORKFLOW_EXECUTION_STARTED EventType = 1 EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED EventType = 2 EVENT_TYPE_WORKFLOW_EXECUTION_FAILED EventType = 3 EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT EventType = 4 EVENT_TYPE_WORKFLOW_TASK_SCHEDULED EventType = 5 EVENT_TYPE_WORKFLOW_TASK_STARTED EventType = 6 EVENT_TYPE_WORKFLOW_TASK_COMPLETED EventType = 7 EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT EventType = 8 EVENT_TYPE_WORKFLOW_TASK_FAILED EventType = 9 EVENT_TYPE_ACTIVITY_TASK_SCHEDULED EventType = 10 EVENT_TYPE_ACTIVITY_TASK_STARTED EventType = 11 EVENT_TYPE_ACTIVITY_TASK_COMPLETED EventType = 12 EVENT_TYPE_ACTIVITY_TASK_FAILED EventType = 13 EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT EventType = 14 EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED EventType = 15 EVENT_TYPE_ACTIVITY_TASK_CANCELED EventType = 16 EVENT_TYPE_TIMER_STARTED EventType = 17 EVENT_TYPE_TIMER_FIRED EventType = 18 EVENT_TYPE_TIMER_CANCELED EventType = 19 EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED EventType = 20 EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED EventType = 21 EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED EventType = 22 EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED EventType = 23 EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED EventType = 24 EVENT_TYPE_MARKER_RECORDED EventType = 25 EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED EventType = 26 EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED EventType = 27 EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW EventType = 28 EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED EventType = 29 EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED EventType = 30 EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED EventType = 31 EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED EventType = 32 EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED EventType = 33 EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED EventType = 34 EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT EventType = 35 EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED EventType = 36 EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED EventType = 37 EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED EventType = 38 EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED EventType = 39 EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES EventType = 40 )
type HistoryEvent ¶ added in v0.8.14
type HistoryEvent struct { // see %homedir%\go\pkg\mod\go.temporal.io\api@v1.4.0\history\v1\message.pb.go:3325 EventID int64 `json:"event_id,omitempty"` EventTime *time.Time `json:"event_time,omitempty"` EventType EventType `json:"event_type,omitempty"` Version int64 `json:"version,omitempty"` TaskID int64 `json:"task_id,omitempty"` Attributes map[string]interface{} `json:"Attributes,omitempty"` }
HistoryEvent is a simplified copy of a temporal.io HistoryEvent protobuf struct