Documentation ¶
Index ¶
- Constants
- type AlreadyCompletedError
- type ErrorHandler
- type Logger
- type MockWorkflowService
- func (_m *MockWorkflowService) CancelProcess(ctx context.Context, id string) (err error)
- func (_m *MockWorkflowService) GetProcess(ctx context.Context, id string) (process pipeline.Process, err error)
- func (_m *MockWorkflowService) ListProcesses(ctx context.Context, query pipeline.Process) (processes []pipeline.Process, err error)
- func (_m *MockWorkflowService) LogProcess(ctx context.Context, proc pipeline.Process) (process pipeline.Process, err error)
- func (_m *MockWorkflowService) LogProcessEvent(ctx context.Context, proc pipeline.ProcessEvent) (processEvent pipeline.ProcessEvent, err error)
- func (_m *MockWorkflowService) SignalProcess(ctx context.Context, id string, signal string, value interface{}) (err error)
- type NoopLogger
- type NotFoundError
- type Process
- type ProcessActivity
- type ProcessActivityInput
- type ProcessEvent
- type ProcessEventActivityInput
- type ProcessStatus
- type Service
- type Status
- type Store
- type WorkflowService
Constants ¶
const ProcessActivityName = "process"
const ProcessEventActivityName = "process-event"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlreadyCompletedError ¶
type AlreadyCompletedError struct {
ID string
}
AlreadyCompletedError is returned if a process the user is trying to mutate has already completed.
func (AlreadyCompletedError) AlreadyCompleted ¶
func (AlreadyCompletedError) AlreadyCompleted() bool
AlreadyCompleted tells a client that this error is related to a process already being completed. Can be used to translate the error to eg. status code.
func (AlreadyCompletedError) Details ¶
func (e AlreadyCompletedError) Details() []interface{}
Details returns error details.
func (AlreadyCompletedError) Error ¶
func (AlreadyCompletedError) Error() string
Error implements the error interface.
func (AlreadyCompletedError) ServiceError ¶
func (AlreadyCompletedError) ServiceError() bool
ServiceError tells the transport layer whether this error should be translated into the transport format or an internal error should be returned instead.
type MockWorkflowService ¶
MockWorkflowService is an autogenerated mock for the WorkflowService type.
func (*MockWorkflowService) CancelProcess ¶
func (_m *MockWorkflowService) CancelProcess(ctx context.Context, id string) (err error)
CancelProcess provides a mock function.
func (*MockWorkflowService) GetProcess ¶
func (_m *MockWorkflowService) GetProcess(ctx context.Context, id string) (process pipeline.Process, err error)
GetProcess provides a mock function.
func (*MockWorkflowService) ListProcesses ¶
func (_m *MockWorkflowService) ListProcesses(ctx context.Context, query pipeline.Process) (processes []pipeline.Process, err error)
ListProcesses provides a mock function.
func (*MockWorkflowService) LogProcess ¶
func (_m *MockWorkflowService) LogProcess(ctx context.Context, proc pipeline.Process) (process pipeline.Process, err error)
LogProcess provides a mock function.
func (*MockWorkflowService) LogProcessEvent ¶
func (_m *MockWorkflowService) LogProcessEvent(ctx context.Context, proc pipeline.ProcessEvent) (processEvent pipeline.ProcessEvent, err error)
LogProcessEvent provides a mock function.
func (*MockWorkflowService) SignalProcess ¶
func (_m *MockWorkflowService) SignalProcess(ctx context.Context, id string, signal string, value interface{}) (err error)
SignalProcess provides a mock function.
type NoopLogger ¶
type NoopLogger = common.NoopLogger
NoopLogger is a logger that discards every log event.
type NotFoundError ¶
type NotFoundError struct {
ID string
}
NotFoundError is returned if a process cannot be found.
func (NotFoundError) Details ¶
func (e NotFoundError) Details() []interface{}
Details returns error details.
func (NotFoundError) Error ¶
func (NotFoundError) Error() string
Error implements the error interface.
func (NotFoundError) NotFound ¶
func (NotFoundError) NotFound() bool
NotFound tells a client that this error is related to a resource being not found. Can be used to translate the error to eg. status code.
func (NotFoundError) ServiceError ¶
func (NotFoundError) ServiceError() bool
ServiceError tells the transport layer whether this error should be translated into the transport format or an internal error should be returned instead.
type ProcessActivity ¶
type ProcessActivity struct {
// contains filtered or unexported fields
}
func NewProcessActivity ¶
func NewProcessActivity(service Service) ProcessActivity
func (ProcessActivity) ExecuteProcess ¶
func (a ProcessActivity) ExecuteProcess(ctx context.Context, input ProcessActivityInput) error
func (ProcessActivity) ExecuteProcessEvent ¶
func (a ProcessActivity) ExecuteProcessEvent(ctx context.Context, input ProcessEventActivityInput) error
type ProcessActivityInput ¶
type ProcessEvent ¶
type ProcessEvent = pipeline.ProcessEvent
ProcessEvent represents an pipeline process event.
type ProcessStatus ¶
type ProcessStatus = pipeline.ProcessStatus
ProcessStatus represents an pipeline process/event status.
type Service ¶
type Service interface { // LogProcess create a process entry LogProcess(ctx context.Context, proc Process) (process Process, err error) // LogProcessEvent create a process event LogProcessEvent(ctx context.Context, proc ProcessEvent) (processEvent ProcessEvent, err error) // ListProcesses lists access processes visible for a user. ListProcesses(ctx context.Context, query Process) (processes []Process, err error) // GetProcess returns a single process. GetProcess(ctx context.Context, id string) (process Process, err error) }
Service provides access to pipeline processes.
type Store ¶
type Store interface { // ListProcesses lists the process in the for a given organization. ListProcesses(ctx context.Context, query Process) ([]Process, error) // LogProcess adds a process entry. LogProcess(ctx context.Context, p Process) error // GetProcess gets a process entry. GetProcess(ctx context.Context, id string) (Process, error) // LogProcessEvent adds a process event to a process. LogProcessEvent(ctx context.Context, p ProcessEvent) error }
Store persists access processes in a persistent store.
type WorkflowService ¶
type WorkflowService interface { Service // CancelProcess cancels a single process. CancelProcess(ctx context.Context, id string) (err error) // SignalProcess sends a signal to a single process. SignalProcess(ctx context.Context, id string, signal string, value interface{}) (err error) }
func NewWorkflowService ¶
func NewWorkflowService(store Store, workflowClient workflowClient) WorkflowService
NewWorkflowService returns a new WorkflowService.