mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
Goes from 135 MB binary with 1153 files importing go.temporal.io and 224
importing google.golang.org/grpc to a 10 MB native binary with ZERO of
either.
Deleted:
- tasks/, tasktests/, service/, chasm/, client/, api/, proto/, tools/
- cmd/tools/, components/, docker/
- schema/{cassandra,elasticsearch,mysql,postgresql,sqlite}/
- 40 tainted common/ subdirs + 7 top-level common files
- tests/testutils (no longer referenced after surviving deps drop common)
New cmd/tasksd (~100 lines) boots tasks.Embed (zap.Node) + http.Server.
New pkg/tasks/embed.go registers ZAP handlers for the SDK opcode surface
(0x0060-0x00A5). Workflow handlers return a 501 "not yet implemented"
envelope; native engine lands behind this contract.
Build: go build ./cmd/tasksd → 10 MB
Vet: go vet ./... → clean
Boot: tasksd --zap-port 9999 --http :7243
Probes: /healthz, /v1/tasks/health → 200
UI: /_/tasks/, / → 200 (embedded Vite bundle)
ZAP: _tasks._tcp on :9999 (mDNS disabled; direct connect)
go.mod: tidy. No go.temporal.io. No google.golang.org/grpc.
167 lines
6.2 KiB
Go
167 lines
6.2 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: engine.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -package chasm -source engine.go -destination engine_mock.go
|
|
//
|
|
|
|
// Package chasm is a generated GoMock package.
|
|
package chasm
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockEngine is a mock of Engine interface.
|
|
type MockEngine struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockEngineMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockEngineMockRecorder is the mock recorder for MockEngine.
|
|
type MockEngineMockRecorder struct {
|
|
mock *MockEngine
|
|
}
|
|
|
|
// NewMockEngine creates a new mock instance.
|
|
func NewMockEngine(ctrl *gomock.Controller) *MockEngine {
|
|
mock := &MockEngine{ctrl: ctrl}
|
|
mock.recorder = &MockEngineMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockEngine) EXPECT() *MockEngineMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// DeleteExecution mocks base method.
|
|
func (m *MockEngine) DeleteExecution(arg0 context.Context, arg1 ComponentRef, arg2 DeleteExecutionRequest) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "DeleteExecution", arg0, arg1, arg2)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// DeleteExecution indicates an expected call of DeleteExecution.
|
|
func (mr *MockEngineMockRecorder) DeleteExecution(arg0, arg1, arg2 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteExecution", reflect.TypeOf((*MockEngine)(nil).DeleteExecution), arg0, arg1, arg2)
|
|
}
|
|
|
|
// NotifyExecution mocks base method.
|
|
func (m *MockEngine) NotifyExecution(arg0 ExecutionKey) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "NotifyExecution", arg0)
|
|
}
|
|
|
|
// NotifyExecution indicates an expected call of NotifyExecution.
|
|
func (mr *MockEngineMockRecorder) NotifyExecution(arg0 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NotifyExecution", reflect.TypeOf((*MockEngine)(nil).NotifyExecution), arg0)
|
|
}
|
|
|
|
// PollComponent mocks base method.
|
|
func (m *MockEngine) PollComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(Context, Component) (bool, error), arg3 ...TransitionOption) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "PollComponent", varargs...)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// PollComponent indicates an expected call of PollComponent.
|
|
func (mr *MockEngineMockRecorder) PollComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PollComponent", reflect.TypeOf((*MockEngine)(nil).PollComponent), varargs...)
|
|
}
|
|
|
|
// ReadComponent mocks base method.
|
|
func (m *MockEngine) ReadComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(Context, Component) error, arg3 ...TransitionOption) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "ReadComponent", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// ReadComponent indicates an expected call of ReadComponent.
|
|
func (mr *MockEngineMockRecorder) ReadComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadComponent", reflect.TypeOf((*MockEngine)(nil).ReadComponent), varargs...)
|
|
}
|
|
|
|
// StartExecution mocks base method.
|
|
func (m *MockEngine) StartExecution(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext) (RootComponent, error), arg3 ...TransitionOption) (StartExecutionResult, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "StartExecution", varargs...)
|
|
ret0, _ := ret[0].(StartExecutionResult)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// StartExecution indicates an expected call of StartExecution.
|
|
func (mr *MockEngineMockRecorder) StartExecution(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartExecution", reflect.TypeOf((*MockEngine)(nil).StartExecution), varargs...)
|
|
}
|
|
|
|
// UpdateComponent mocks base method.
|
|
func (m *MockEngine) UpdateComponent(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext, Component) error, arg3 ...TransitionOption) ([]byte, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2}
|
|
for _, a := range arg3 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "UpdateComponent", varargs...)
|
|
ret0, _ := ret[0].([]byte)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// UpdateComponent indicates an expected call of UpdateComponent.
|
|
func (mr *MockEngineMockRecorder) UpdateComponent(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2}, arg3...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateComponent", reflect.TypeOf((*MockEngine)(nil).UpdateComponent), varargs...)
|
|
}
|
|
|
|
// UpdateWithStartExecution mocks base method.
|
|
func (m *MockEngine) UpdateWithStartExecution(arg0 context.Context, arg1 ComponentRef, arg2 func(MutableContext) (RootComponent, error), arg3 func(MutableContext, Component) error, arg4 ...TransitionOption) (EngineUpdateWithStartExecutionResult, error) {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{arg0, arg1, arg2, arg3}
|
|
for _, a := range arg4 {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "UpdateWithStartExecution", varargs...)
|
|
ret0, _ := ret[0].(EngineUpdateWithStartExecutionResult)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// UpdateWithStartExecution indicates an expected call of UpdateWithStartExecution.
|
|
func (mr *MockEngineMockRecorder) UpdateWithStartExecution(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{arg0, arg1, arg2, arg3}, arg4...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWithStartExecution", reflect.TypeOf((*MockEngine)(nil).UpdateWithStartExecution), varargs...)
|
|
}
|