Documentation
¶
Overview ¶
Package event describes the event set and an interface for recording events. Events are generated as workflows execute.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionFailed ¶
ActionFailed occurs when an action fails to complete.
func (ActionFailed) GetName ¶
func (ActionFailed) GetName() Name
func (ActionFailed) String ¶
func (e ActionFailed) String() string
type ActionStarted ¶
ActionStarted occurs when an action begins running.
func (ActionStarted) GetName ¶
func (ActionStarted) GetName() Name
func (ActionStarted) String ¶
func (e ActionStarted) String() string
type ActionSucceeded ¶
ActionSucceeded occurs when an action successfully completes.
func (ActionSucceeded) GetName ¶
func (ActionSucceeded) GetName() Name
func (ActionSucceeded) String ¶
func (e ActionSucceeded) String() string
type Event ¶
type Event interface {
// GetName retrieves the event name.
GetName() Name
// contains filtered or unexported methods
}
Event is an event generated during execution of a Workflow. Each event in the event package implements this interface. Consumers may type switch the Event to the appropriate type for event handling.
E.g.
switch ev.(type) {
case event.ActionStarted:
// Handle ActionStarted event.
default:
// Unsupported event.
}
type IncompatibleError ¶
type IncompatibleError struct {
Event Event
}
IncompatibleError indicates an event was received that.
func (IncompatibleError) Error ¶
func (e IncompatibleError) Error() string
type Name ¶
type Name string
Name is a unique name identifying an event.
const WorkflowRejectedName Name = "WorkflowRejected"
type RecorderMock ¶
type RecorderMock struct {
// RecordEventFunc mocks the RecordEvent method.
RecordEventFunc func(contextMoqParam context.Context, event Event) error
// contains filtered or unexported fields
}
RecorderMock is a mock implementation of Recorder.
func TestSomethingThatUsesRecorder(t *testing.T) {
// make and configure a mocked Recorder
mockedRecorder := &RecorderMock{
RecordEventFunc: func(contextMoqParam context.Context, event Event) error {
panic("mock out the RecordEvent method")
},
}
// use mockedRecorder in code that requires Recorder
// and then make assertions.
}
func NoopRecorder ¶
func NoopRecorder() *RecorderMock
NoopRecorder retrieves a nooping fake recorder.
func (*RecorderMock) RecordEvent ¶
func (mock *RecorderMock) RecordEvent(contextMoqParam context.Context, event Event) error
RecordEvent calls RecordEventFunc.
func (*RecorderMock) RecordEventCalls ¶
func (mock *RecorderMock) RecordEventCalls() []struct { ContextMoqParam context.Context Event Event }
RecordEventCalls gets all the calls that were made to RecordEvent. Check the length with:
len(mockedRecorder.RecordEventCalls())
type WorkflowRejected ¶
WorkflowRejected is generated when a workflow is being rejected by the agent.
func (WorkflowRejected) GetName ¶
func (WorkflowRejected) GetName() Name
func (WorkflowRejected) String ¶
func (e WorkflowRejected) String() string