Files
panel/mocks/biz/TaskRepo.go
T
耗子 3ce353e8e4 chore: 升级 Go 1.27 并迁移 mockery v3 修复 CI
mockery v2 已 EOL,其内嵌的旧版 x/tools 无法解析 Go 1.27 的 export data,
导致 Mockery workflow 在 stable 切到 1.27.0 后持续失败。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 17:37:38 +08:00

485 lines
12 KiB
Go

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package biz
import (
"github.com/acepanel/panel/v3/internal/biz"
mock "github.com/stretchr/testify/mock"
)
// NewTaskRepo creates a new instance of TaskRepo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewTaskRepo(t interface {
mock.TestingT
Cleanup(func())
}) *TaskRepo {
mock := &TaskRepo{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// TaskRepo is an autogenerated mock type for the TaskRepo type
type TaskRepo struct {
mock.Mock
}
type TaskRepo_Expecter struct {
mock *mock.Mock
}
func (_m *TaskRepo) EXPECT() *TaskRepo_Expecter {
return &TaskRepo_Expecter{mock: &_m.Mock}
}
// Cancel provides a mock function for the type TaskRepo
func (_mock *TaskRepo) Cancel(id uint) error {
ret := _mock.Called(id)
if len(ret) == 0 {
panic("no return value specified for Cancel")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(uint) error); ok {
r0 = returnFunc(id)
} else {
r0 = ret.Error(0)
}
return r0
}
// TaskRepo_Cancel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cancel'
type TaskRepo_Cancel_Call struct {
*mock.Call
}
// Cancel is a helper method to define mock.On call
// - id uint
func (_e *TaskRepo_Expecter) Cancel(id any) *TaskRepo_Cancel_Call {
return &TaskRepo_Cancel_Call{Call: _e.mock.On("Cancel", id)}
}
func (_c *TaskRepo_Cancel_Call) Run(run func(id uint)) *TaskRepo_Cancel_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 uint
if args[0] != nil {
arg0 = args[0].(uint)
}
run(
arg0,
)
})
return _c
}
func (_c *TaskRepo_Cancel_Call) Return(err error) *TaskRepo_Cancel_Call {
_c.Call.Return(err)
return _c
}
func (_c *TaskRepo_Cancel_Call) RunAndReturn(run func(id uint) error) *TaskRepo_Cancel_Call {
_c.Call.Return(run)
return _c
}
// Delete provides a mock function for the type TaskRepo
func (_mock *TaskRepo) Delete(id uint) error {
ret := _mock.Called(id)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(uint) error); ok {
r0 = returnFunc(id)
} else {
r0 = ret.Error(0)
}
return r0
}
// TaskRepo_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type TaskRepo_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - id uint
func (_e *TaskRepo_Expecter) Delete(id any) *TaskRepo_Delete_Call {
return &TaskRepo_Delete_Call{Call: _e.mock.On("Delete", id)}
}
func (_c *TaskRepo_Delete_Call) Run(run func(id uint)) *TaskRepo_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 uint
if args[0] != nil {
arg0 = args[0].(uint)
}
run(
arg0,
)
})
return _c
}
func (_c *TaskRepo_Delete_Call) Return(err error) *TaskRepo_Delete_Call {
_c.Call.Return(err)
return _c
}
func (_c *TaskRepo_Delete_Call) RunAndReturn(run func(id uint) error) *TaskRepo_Delete_Call {
_c.Call.Return(run)
return _c
}
// Get provides a mock function for the type TaskRepo
func (_mock *TaskRepo) Get(id uint) (*biz.Task, error) {
ret := _mock.Called(id)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 *biz.Task
var r1 error
if returnFunc, ok := ret.Get(0).(func(uint) (*biz.Task, error)); ok {
return returnFunc(id)
}
if returnFunc, ok := ret.Get(0).(func(uint) *biz.Task); ok {
r0 = returnFunc(id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*biz.Task)
}
}
if returnFunc, ok := ret.Get(1).(func(uint) error); ok {
r1 = returnFunc(id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TaskRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
type TaskRepo_Get_Call struct {
*mock.Call
}
// Get is a helper method to define mock.On call
// - id uint
func (_e *TaskRepo_Expecter) Get(id any) *TaskRepo_Get_Call {
return &TaskRepo_Get_Call{Call: _e.mock.On("Get", id)}
}
func (_c *TaskRepo_Get_Call) Run(run func(id uint)) *TaskRepo_Get_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 uint
if args[0] != nil {
arg0 = args[0].(uint)
}
run(
arg0,
)
})
return _c
}
func (_c *TaskRepo_Get_Call) Return(task *biz.Task, err error) *TaskRepo_Get_Call {
_c.Call.Return(task, err)
return _c
}
func (_c *TaskRepo_Get_Call) RunAndReturn(run func(id uint) (*biz.Task, error)) *TaskRepo_Get_Call {
_c.Call.Return(run)
return _c
}
// HasRunningTask provides a mock function for the type TaskRepo
func (_mock *TaskRepo) HasRunningTask() bool {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for HasRunningTask")
}
var r0 bool
if returnFunc, ok := ret.Get(0).(func() bool); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// TaskRepo_HasRunningTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasRunningTask'
type TaskRepo_HasRunningTask_Call struct {
*mock.Call
}
// HasRunningTask is a helper method to define mock.On call
func (_e *TaskRepo_Expecter) HasRunningTask() *TaskRepo_HasRunningTask_Call {
return &TaskRepo_HasRunningTask_Call{Call: _e.mock.On("HasRunningTask")}
}
func (_c *TaskRepo_HasRunningTask_Call) Run(run func()) *TaskRepo_HasRunningTask_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *TaskRepo_HasRunningTask_Call) Return(b bool) *TaskRepo_HasRunningTask_Call {
_c.Call.Return(b)
return _c
}
func (_c *TaskRepo_HasRunningTask_Call) RunAndReturn(run func() bool) *TaskRepo_HasRunningTask_Call {
_c.Call.Return(run)
return _c
}
// List provides a mock function for the type TaskRepo
func (_mock *TaskRepo) List(page uint, limit uint) ([]*biz.Task, int64, error) {
ret := _mock.Called(page, limit)
if len(ret) == 0 {
panic("no return value specified for List")
}
var r0 []*biz.Task
var r1 int64
var r2 error
if returnFunc, ok := ret.Get(0).(func(uint, uint) ([]*biz.Task, int64, error)); ok {
return returnFunc(page, limit)
}
if returnFunc, ok := ret.Get(0).(func(uint, uint) []*biz.Task); ok {
r0 = returnFunc(page, limit)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*biz.Task)
}
}
if returnFunc, ok := ret.Get(1).(func(uint, uint) int64); ok {
r1 = returnFunc(page, limit)
} else {
r1 = ret.Get(1).(int64)
}
if returnFunc, ok := ret.Get(2).(func(uint, uint) error); ok {
r2 = returnFunc(page, limit)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// TaskRepo_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
type TaskRepo_List_Call struct {
*mock.Call
}
// List is a helper method to define mock.On call
// - page uint
// - limit uint
func (_e *TaskRepo_Expecter) List(page any, limit any) *TaskRepo_List_Call {
return &TaskRepo_List_Call{Call: _e.mock.On("List", page, limit)}
}
func (_c *TaskRepo_List_Call) Run(run func(page uint, limit uint)) *TaskRepo_List_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 uint
if args[0] != nil {
arg0 = args[0].(uint)
}
var arg1 uint
if args[1] != nil {
arg1 = args[1].(uint)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *TaskRepo_List_Call) Return(tasks []*biz.Task, n int64, err error) *TaskRepo_List_Call {
_c.Call.Return(tasks, n, err)
return _c
}
func (_c *TaskRepo_List_Call) RunAndReturn(run func(page uint, limit uint) ([]*biz.Task, int64, error)) *TaskRepo_List_Call {
_c.Call.Return(run)
return _c
}
// Push provides a mock function for the type TaskRepo
func (_mock *TaskRepo) Push(task *biz.Task) error {
ret := _mock.Called(task)
if len(ret) == 0 {
panic("no return value specified for Push")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(*biz.Task) error); ok {
r0 = returnFunc(task)
} else {
r0 = ret.Error(0)
}
return r0
}
// TaskRepo_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push'
type TaskRepo_Push_Call struct {
*mock.Call
}
// Push is a helper method to define mock.On call
// - task *biz.Task
func (_e *TaskRepo_Expecter) Push(task any) *TaskRepo_Push_Call {
return &TaskRepo_Push_Call{Call: _e.mock.On("Push", task)}
}
func (_c *TaskRepo_Push_Call) Run(run func(task *biz.Task)) *TaskRepo_Push_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 *biz.Task
if args[0] != nil {
arg0 = args[0].(*biz.Task)
}
run(
arg0,
)
})
return _c
}
func (_c *TaskRepo_Push_Call) Return(err error) *TaskRepo_Push_Call {
_c.Call.Return(err)
return _c
}
func (_c *TaskRepo_Push_Call) RunAndReturn(run func(task *biz.Task) error) *TaskRepo_Push_Call {
_c.Call.Return(run)
return _c
}
// UpdateLog provides a mock function for the type TaskRepo
func (_mock *TaskRepo) UpdateLog(id uint, log string) error {
ret := _mock.Called(id, log)
if len(ret) == 0 {
panic("no return value specified for UpdateLog")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(uint, string) error); ok {
r0 = returnFunc(id, log)
} else {
r0 = ret.Error(0)
}
return r0
}
// TaskRepo_UpdateLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateLog'
type TaskRepo_UpdateLog_Call struct {
*mock.Call
}
// UpdateLog is a helper method to define mock.On call
// - id uint
// - log string
func (_e *TaskRepo_Expecter) UpdateLog(id any, log any) *TaskRepo_UpdateLog_Call {
return &TaskRepo_UpdateLog_Call{Call: _e.mock.On("UpdateLog", id, log)}
}
func (_c *TaskRepo_UpdateLog_Call) Run(run func(id uint, log string)) *TaskRepo_UpdateLog_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 uint
if args[0] != nil {
arg0 = args[0].(uint)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *TaskRepo_UpdateLog_Call) Return(err error) *TaskRepo_UpdateLog_Call {
_c.Call.Return(err)
return _c
}
func (_c *TaskRepo_UpdateLog_Call) RunAndReturn(run func(id uint, log string) error) *TaskRepo_UpdateLog_Call {
_c.Call.Return(run)
return _c
}
// UpdateStatus provides a mock function for the type TaskRepo
func (_mock *TaskRepo) UpdateStatus(id uint, status biz.TaskStatus) error {
ret := _mock.Called(id, status)
if len(ret) == 0 {
panic("no return value specified for UpdateStatus")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(uint, biz.TaskStatus) error); ok {
r0 = returnFunc(id, status)
} else {
r0 = ret.Error(0)
}
return r0
}
// TaskRepo_UpdateStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStatus'
type TaskRepo_UpdateStatus_Call struct {
*mock.Call
}
// UpdateStatus is a helper method to define mock.On call
// - id uint
// - status biz.TaskStatus
func (_e *TaskRepo_Expecter) UpdateStatus(id any, status any) *TaskRepo_UpdateStatus_Call {
return &TaskRepo_UpdateStatus_Call{Call: _e.mock.On("UpdateStatus", id, status)}
}
func (_c *TaskRepo_UpdateStatus_Call) Run(run func(id uint, status biz.TaskStatus)) *TaskRepo_UpdateStatus_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 uint
if args[0] != nil {
arg0 = args[0].(uint)
}
var arg1 biz.TaskStatus
if args[1] != nil {
arg1 = args[1].(biz.TaskStatus)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *TaskRepo_UpdateStatus_Call) Return(err error) *TaskRepo_UpdateStatus_Call {
_c.Call.Return(err)
return _c
}
func (_c *TaskRepo_UpdateStatus_Call) RunAndReturn(run func(id uint, status biz.TaskStatus) error) *TaskRepo_UpdateStatus_Call {
_c.Call.Return(run)
return _c
}