mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? - TaskAttributes is now passed to all CHASM executors and validators. I decided against introducing a struct for task arguments because it's likely that any additional bits we'd pass along to handlers would go in `TaskAttributes`, and not some outer container (`taskWithAttributes`), and I'd like handlers that don't need attributes to be able to simply `_` them out. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [] added new unit test(s) - [ ] added new functional test(s) --------- Co-authored-by: Stephan Behnke <[email protected]>
133 lines
4.7 KiB
Go
133 lines
4.7 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: task.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -package chasm -source task.go -destination task_mock.go
|
|
//
|
|
|
|
// Package chasm is a generated GoMock package.
|
|
package chasm
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockSideEffectTaskExecutor is a mock of SideEffectTaskExecutor interface.
|
|
type MockSideEffectTaskExecutor[C any, T any] struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockSideEffectTaskExecutorMockRecorder[C, T]
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockSideEffectTaskExecutorMockRecorder is the mock recorder for MockSideEffectTaskExecutor.
|
|
type MockSideEffectTaskExecutorMockRecorder[C any, T any] struct {
|
|
mock *MockSideEffectTaskExecutor[C, T]
|
|
}
|
|
|
|
// NewMockSideEffectTaskExecutor creates a new mock instance.
|
|
func NewMockSideEffectTaskExecutor[C any, T any](ctrl *gomock.Controller) *MockSideEffectTaskExecutor[C, T] {
|
|
mock := &MockSideEffectTaskExecutor[C, T]{ctrl: ctrl}
|
|
mock.recorder = &MockSideEffectTaskExecutorMockRecorder[C, T]{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockSideEffectTaskExecutor[C, T]) EXPECT() *MockSideEffectTaskExecutorMockRecorder[C, T] {
|
|
return m.recorder
|
|
}
|
|
|
|
// Execute mocks base method.
|
|
func (m *MockSideEffectTaskExecutor[C, T]) Execute(arg0 context.Context, arg1 ComponentRef, arg2 TaskAttributes, arg3 T) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Execute indicates an expected call of Execute.
|
|
func (mr *MockSideEffectTaskExecutorMockRecorder[C, T]) Execute(arg0, arg1, arg2, arg3 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockSideEffectTaskExecutor[C, T])(nil).Execute), arg0, arg1, arg2, arg3)
|
|
}
|
|
|
|
// MockPureTaskExecutor is a mock of PureTaskExecutor interface.
|
|
type MockPureTaskExecutor[C any, T any] struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockPureTaskExecutorMockRecorder[C, T]
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockPureTaskExecutorMockRecorder is the mock recorder for MockPureTaskExecutor.
|
|
type MockPureTaskExecutorMockRecorder[C any, T any] struct {
|
|
mock *MockPureTaskExecutor[C, T]
|
|
}
|
|
|
|
// NewMockPureTaskExecutor creates a new mock instance.
|
|
func NewMockPureTaskExecutor[C any, T any](ctrl *gomock.Controller) *MockPureTaskExecutor[C, T] {
|
|
mock := &MockPureTaskExecutor[C, T]{ctrl: ctrl}
|
|
mock.recorder = &MockPureTaskExecutorMockRecorder[C, T]{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockPureTaskExecutor[C, T]) EXPECT() *MockPureTaskExecutorMockRecorder[C, T] {
|
|
return m.recorder
|
|
}
|
|
|
|
// Execute mocks base method.
|
|
func (m *MockPureTaskExecutor[C, T]) Execute(arg0 MutableContext, arg1 C, arg2 TaskAttributes, arg3 T) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Execute indicates an expected call of Execute.
|
|
func (mr *MockPureTaskExecutorMockRecorder[C, T]) Execute(arg0, arg1, arg2, arg3 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockPureTaskExecutor[C, T])(nil).Execute), arg0, arg1, arg2, arg3)
|
|
}
|
|
|
|
// MockTaskValidator is a mock of TaskValidator interface.
|
|
type MockTaskValidator[C any, T any] struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockTaskValidatorMockRecorder[C, T]
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockTaskValidatorMockRecorder is the mock recorder for MockTaskValidator.
|
|
type MockTaskValidatorMockRecorder[C any, T any] struct {
|
|
mock *MockTaskValidator[C, T]
|
|
}
|
|
|
|
// NewMockTaskValidator creates a new mock instance.
|
|
func NewMockTaskValidator[C any, T any](ctrl *gomock.Controller) *MockTaskValidator[C, T] {
|
|
mock := &MockTaskValidator[C, T]{ctrl: ctrl}
|
|
mock.recorder = &MockTaskValidatorMockRecorder[C, T]{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockTaskValidator[C, T]) EXPECT() *MockTaskValidatorMockRecorder[C, T] {
|
|
return m.recorder
|
|
}
|
|
|
|
// Validate mocks base method.
|
|
func (m *MockTaskValidator[C, T]) Validate(arg0 Context, arg1 C, arg2 TaskAttributes, arg3 T) (bool, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Validate", arg0, arg1, arg2, arg3)
|
|
ret0, _ := ret[0].(bool)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Validate indicates an expected call of Validate.
|
|
func (mr *MockTaskValidatorMockRecorder[C, T]) Validate(arg0, arg1, arg2, arg3 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validate", reflect.TypeOf((*MockTaskValidator[C, T])(nil).Validate), arg0, arg1, arg2, arg3)
|
|
}
|