Documentation ¶
Overview ¶
Package transport contains data structures that implement agent transport capabilities. transport implementations are responsible for connecting to the Tink server and retrieving workflows for the agent to run.
Index ¶
- type Fake
- type File
- type GRPC
- type WorkflowHandler
- type WorkflowHandlerMock
- func (mock *WorkflowHandlerMock) CancelWorkflow(workflowID string)
- func (mock *WorkflowHandlerMock) CancelWorkflowCalls() []struct{ ... }
- func (mock *WorkflowHandlerMock) HandleWorkflow(contextMoqParam context.Context, workflowMoqParam workflow.Workflow, ...)
- func (mock *WorkflowHandlerMock) HandleWorkflowCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶ added in v0.10.0
type File struct { // Log is a logger for debugging. Log logr.Logger // Path to the workflow to run. Path string }
File is a transport implementation that executes a single workflow stored as a file.
func (*File) RecordEvent ¶ added in v0.10.0
type GRPC ¶
type GRPC struct {
// contains filtered or unexported fields
}
func NewGRPC ¶
func NewGRPC(log logr.Logger, client workflowproto.WorkflowServiceClient) *GRPC
type WorkflowHandler ¶
type WorkflowHandler interface { // HandleWorkflow executes the given workflow. The event.Recorder can be used to publish events // as the workflow transits its lifecycle. HandleWorkflow should not block and should be efficient // in handing off workflow processing. HandleWorkflow(context.Context, workflow.Workflow, event.Recorder) // CancelWorkflow cancels a workflow identified by workflowID. It should not block and should // be efficient in handing off the cancellation request. CancelWorkflow(workflowID string) }
WorkflowHandler is responsible for workflow execution.
type WorkflowHandlerMock ¶
type WorkflowHandlerMock struct { // CancelWorkflowFunc mocks the CancelWorkflow method. CancelWorkflowFunc func(workflowID string) // HandleWorkflowFunc mocks the HandleWorkflow method. HandleWorkflowFunc func(contextMoqParam context.Context, workflowMoqParam workflow.Workflow, recorder event.Recorder) // contains filtered or unexported fields }
WorkflowHandlerMock is a mock implementation of WorkflowHandler.
func TestSomethingThatUsesWorkflowHandler(t *testing.T) { // make and configure a mocked WorkflowHandler mockedWorkflowHandler := &WorkflowHandlerMock{ CancelWorkflowFunc: func(workflowID string) { panic("mock out the CancelWorkflow method") }, HandleWorkflowFunc: func(contextMoqParam context.Context, workflowMoqParam workflow.Workflow, recorder event.Recorder) { panic("mock out the HandleWorkflow method") }, } // use mockedWorkflowHandler in code that requires WorkflowHandler // and then make assertions. }
func (*WorkflowHandlerMock) CancelWorkflow ¶
func (mock *WorkflowHandlerMock) CancelWorkflow(workflowID string)
CancelWorkflow calls CancelWorkflowFunc.
func (*WorkflowHandlerMock) CancelWorkflowCalls ¶
func (mock *WorkflowHandlerMock) CancelWorkflowCalls() []struct { WorkflowID string }
CancelWorkflowCalls gets all the calls that were made to CancelWorkflow. Check the length with:
len(mockedWorkflowHandler.CancelWorkflowCalls())
func (*WorkflowHandlerMock) HandleWorkflow ¶
func (mock *WorkflowHandlerMock) HandleWorkflow(contextMoqParam context.Context, workflowMoqParam workflow.Workflow, recorder event.Recorder)
HandleWorkflow calls HandleWorkflowFunc.
func (*WorkflowHandlerMock) HandleWorkflowCalls ¶
func (mock *WorkflowHandlerMock) HandleWorkflowCalls() []struct { ContextMoqParam context.Context WorkflowMoqParam workflow.Workflow Recorder event.Recorder }
HandleWorkflowCalls gets all the calls that were made to HandleWorkflow. Check the length with:
len(mockedWorkflowHandler.HandleWorkflowCalls())