history

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeserializeAttributes

func DeserializeAttributes(eventType EventType, attributes []byte) (attr interface{}, err error)

func SerializeAttributes

func SerializeAttributes(attributes interface{}) ([]byte, error)

Types

type ActivityCompletedAttributes

type ActivityCompletedAttributes struct {
	Result payload.Payload
}

type ActivityFailedAttributes

type ActivityFailedAttributes struct {
	Reason string
}

type ActivityScheduledAttributes

type ActivityScheduledAttributes struct {
	Name string

	Inputs []payload.Payload
}

type Event

type Event struct {
	// ID is a unique identifier for this event
	ID string

	Type EventType

	Timestamp time.Time

	// ScheduleEventID is used to correlate events belonging together
	// For example, if an activity is scheduled, ScheduleEventID of the schedule event and the
	// completion/failure event are the same.
	ScheduleEventID int

	// Attributes are event type specific attributes
	Attributes interface{}

	VisibleAt *time.Time
}

func NewHistoryEvent

func NewHistoryEvent(timestamp time.Time, eventType EventType, attributes interface{}, opts ...HistoryEventOption) Event

func NewWorkflowCancellationEvent

func NewWorkflowCancellationEvent(timestamp time.Time) Event

func (Event) String

func (e Event) String() string

type EventType

type EventType uint
const (
	EventType_WorkflowExecutionStarted EventType
	EventType_WorkflowExecutionFinished
	EventType_WorkflowExecutionTerminated
	EventType_WorkflowExecutionCanceled

	EventType_WorkflowTaskStarted
	EventType_WorkflowTaskFinished

	EventType_SubWorkflowScheduled
	EventType_SubWorkflowCompleted
	EventType_SubWorkflowFailed

	EventType_ActivityScheduled
	EventType_ActivityCompleted
	EventType_ActivityFailed

	EventType_TimerScheduled
	EventType_TimerFired

	EventType_SignalReceived

	EventType_SideEffectResult
)

func (EventType) String

func (et EventType) String() string

type ExecutionCanceledAttributes

type ExecutionCanceledAttributes struct{}

type ExecutionCompletedAttributes

type ExecutionCompletedAttributes struct {
	Result payload.Payload
	Error  string
}

type ExecutionStartedAttributes

type ExecutionStartedAttributes struct {
	Name string

	Inputs []payload.Payload
}

type HistoryEventOption

type HistoryEventOption func(e *Event)

func ScheduleEventID

func ScheduleEventID(scheduleEventID int) HistoryEventOption

func VisibleAt

func VisibleAt(visibleAt time.Time) HistoryEventOption

type SideEffectResultAttributes

type SideEffectResultAttributes struct {
	Result payload.Payload
}

type SignalReceivedAttributes

type SignalReceivedAttributes struct {
	Name string
	Arg  payload.Payload
}

type SubWorkflowCompletedAttributes

type SubWorkflowCompletedAttributes struct {
	Result payload.Payload
}

type SubWorkflowFailedAttributes

type SubWorkflowFailedAttributes struct {
	Error string
}

type SubWorkflowScheduledAttributes

type SubWorkflowScheduledAttributes struct {
	InstanceID string

	Name string

	Inputs []payload.Payload
}

type TimerFiredAttributes

type TimerFiredAttributes struct {
	At time.Time
}

type TimerScheduledAttributes

type TimerScheduledAttributes struct {
	At time.Time
}

type WorkflowEvent

type WorkflowEvent struct {
	WorkflowInstance core.WorkflowInstance

	HistoryEvent Event
}

WorkflowEvent is a event addressed for a specific workflow instance

type WorkflowTaskFinishedAttributes

type WorkflowTaskFinishedAttributes struct {
}

type WorkflowTaskStartedAttributes

type WorkflowTaskStartedAttributes struct {
}

Jump to

Keyboard shortcuts

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