mirror of
https://github.com/tnb-labs/panel.git
synced 2026-09-01 14:55:12 +08:00
3ce353e8e4
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>
444 lines
12 KiB
Go
444 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"
|
|
)
|
|
|
|
// NewNotifyChannelRepo creates a new instance of NotifyChannelRepo. 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 NewNotifyChannelRepo(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *NotifyChannelRepo {
|
|
mock := &NotifyChannelRepo{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// NotifyChannelRepo is an autogenerated mock type for the NotifyChannelRepo type
|
|
type NotifyChannelRepo struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type NotifyChannelRepo_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *NotifyChannelRepo) EXPECT() *NotifyChannelRepo_Expecter {
|
|
return &NotifyChannelRepo_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// All provides a mock function for the type NotifyChannelRepo
|
|
func (_mock *NotifyChannelRepo) All() ([]*biz.NotifyChannel, error) {
|
|
ret := _mock.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for All")
|
|
}
|
|
|
|
var r0 []*biz.NotifyChannel
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func() ([]*biz.NotifyChannel, error)); ok {
|
|
return returnFunc()
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func() []*biz.NotifyChannel); ok {
|
|
r0 = returnFunc()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*biz.NotifyChannel)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func() error); ok {
|
|
r1 = returnFunc()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// NotifyChannelRepo_All_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'All'
|
|
type NotifyChannelRepo_All_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// All is a helper method to define mock.On call
|
|
func (_e *NotifyChannelRepo_Expecter) All() *NotifyChannelRepo_All_Call {
|
|
return &NotifyChannelRepo_All_Call{Call: _e.mock.On("All")}
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_All_Call) Run(run func()) *NotifyChannelRepo_All_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_All_Call) Return(notifyChannels []*biz.NotifyChannel, err error) *NotifyChannelRepo_All_Call {
|
|
_c.Call.Return(notifyChannels, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_All_Call) RunAndReturn(run func() ([]*biz.NotifyChannel, error)) *NotifyChannelRepo_All_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Create provides a mock function for the type NotifyChannelRepo
|
|
func (_mock *NotifyChannelRepo) Create(channel *biz.NotifyChannel) error {
|
|
ret := _mock.Called(channel)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Create")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(*biz.NotifyChannel) error); ok {
|
|
r0 = returnFunc(channel)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// NotifyChannelRepo_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
|
|
type NotifyChannelRepo_Create_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Create is a helper method to define mock.On call
|
|
// - channel *biz.NotifyChannel
|
|
func (_e *NotifyChannelRepo_Expecter) Create(channel any) *NotifyChannelRepo_Create_Call {
|
|
return &NotifyChannelRepo_Create_Call{Call: _e.mock.On("Create", channel)}
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Create_Call) Run(run func(channel *biz.NotifyChannel)) *NotifyChannelRepo_Create_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 *biz.NotifyChannel
|
|
if args[0] != nil {
|
|
arg0 = args[0].(*biz.NotifyChannel)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Create_Call) Return(err error) *NotifyChannelRepo_Create_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Create_Call) RunAndReturn(run func(channel *biz.NotifyChannel) error) *NotifyChannelRepo_Create_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Delete provides a mock function for the type NotifyChannelRepo
|
|
func (_mock *NotifyChannelRepo) 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
|
|
}
|
|
|
|
// NotifyChannelRepo_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
|
|
type NotifyChannelRepo_Delete_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Delete is a helper method to define mock.On call
|
|
// - id uint
|
|
func (_e *NotifyChannelRepo_Expecter) Delete(id any) *NotifyChannelRepo_Delete_Call {
|
|
return &NotifyChannelRepo_Delete_Call{Call: _e.mock.On("Delete", id)}
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Delete_Call) Run(run func(id uint)) *NotifyChannelRepo_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 *NotifyChannelRepo_Delete_Call) Return(err error) *NotifyChannelRepo_Delete_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Delete_Call) RunAndReturn(run func(id uint) error) *NotifyChannelRepo_Delete_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Get provides a mock function for the type NotifyChannelRepo
|
|
func (_mock *NotifyChannelRepo) Get(id uint) (*biz.NotifyChannel, error) {
|
|
ret := _mock.Called(id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 *biz.NotifyChannel
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(uint) (*biz.NotifyChannel, error)); ok {
|
|
return returnFunc(id)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(uint) *biz.NotifyChannel); ok {
|
|
r0 = returnFunc(id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*biz.NotifyChannel)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(uint) error); ok {
|
|
r1 = returnFunc(id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// NotifyChannelRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
|
|
type NotifyChannelRepo_Get_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Get is a helper method to define mock.On call
|
|
// - id uint
|
|
func (_e *NotifyChannelRepo_Expecter) Get(id any) *NotifyChannelRepo_Get_Call {
|
|
return &NotifyChannelRepo_Get_Call{Call: _e.mock.On("Get", id)}
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Get_Call) Run(run func(id uint)) *NotifyChannelRepo_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 *NotifyChannelRepo_Get_Call) Return(notifyChannel *biz.NotifyChannel, err error) *NotifyChannelRepo_Get_Call {
|
|
_c.Call.Return(notifyChannel, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Get_Call) RunAndReturn(run func(id uint) (*biz.NotifyChannel, error)) *NotifyChannelRepo_Get_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetByIDs provides a mock function for the type NotifyChannelRepo
|
|
func (_mock *NotifyChannelRepo) GetByIDs(ids []uint) ([]*biz.NotifyChannel, error) {
|
|
ret := _mock.Called(ids)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetByIDs")
|
|
}
|
|
|
|
var r0 []*biz.NotifyChannel
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func([]uint) ([]*biz.NotifyChannel, error)); ok {
|
|
return returnFunc(ids)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func([]uint) []*biz.NotifyChannel); ok {
|
|
r0 = returnFunc(ids)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*biz.NotifyChannel)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func([]uint) error); ok {
|
|
r1 = returnFunc(ids)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// NotifyChannelRepo_GetByIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByIDs'
|
|
type NotifyChannelRepo_GetByIDs_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetByIDs is a helper method to define mock.On call
|
|
// - ids []uint
|
|
func (_e *NotifyChannelRepo_Expecter) GetByIDs(ids any) *NotifyChannelRepo_GetByIDs_Call {
|
|
return &NotifyChannelRepo_GetByIDs_Call{Call: _e.mock.On("GetByIDs", ids)}
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_GetByIDs_Call) Run(run func(ids []uint)) *NotifyChannelRepo_GetByIDs_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 *NotifyChannelRepo_GetByIDs_Call) Return(notifyChannels []*biz.NotifyChannel, err error) *NotifyChannelRepo_GetByIDs_Call {
|
|
_c.Call.Return(notifyChannels, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_GetByIDs_Call) RunAndReturn(run func(ids []uint) ([]*biz.NotifyChannel, error)) *NotifyChannelRepo_GetByIDs_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// List provides a mock function for the type NotifyChannelRepo
|
|
func (_mock *NotifyChannelRepo) List(page uint, limit uint) ([]*biz.NotifyChannel, int64, error) {
|
|
ret := _mock.Called(page, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for List")
|
|
}
|
|
|
|
var r0 []*biz.NotifyChannel
|
|
var r1 int64
|
|
var r2 error
|
|
if returnFunc, ok := ret.Get(0).(func(uint, uint) ([]*biz.NotifyChannel, int64, error)); ok {
|
|
return returnFunc(page, limit)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(uint, uint) []*biz.NotifyChannel); ok {
|
|
r0 = returnFunc(page, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*biz.NotifyChannel)
|
|
}
|
|
}
|
|
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
|
|
}
|
|
|
|
// NotifyChannelRepo_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
|
|
type NotifyChannelRepo_List_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// List is a helper method to define mock.On call
|
|
// - page uint
|
|
// - limit uint
|
|
func (_e *NotifyChannelRepo_Expecter) List(page any, limit any) *NotifyChannelRepo_List_Call {
|
|
return &NotifyChannelRepo_List_Call{Call: _e.mock.On("List", page, limit)}
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_List_Call) Run(run func(page uint, limit uint)) *NotifyChannelRepo_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 *NotifyChannelRepo_List_Call) Return(notifyChannels []*biz.NotifyChannel, n int64, err error) *NotifyChannelRepo_List_Call {
|
|
_c.Call.Return(notifyChannels, n, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_List_Call) RunAndReturn(run func(page uint, limit uint) ([]*biz.NotifyChannel, int64, error)) *NotifyChannelRepo_List_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Update provides a mock function for the type NotifyChannelRepo
|
|
func (_mock *NotifyChannelRepo) Update(channel *biz.NotifyChannel) error {
|
|
ret := _mock.Called(channel)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Update")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(*biz.NotifyChannel) error); ok {
|
|
r0 = returnFunc(channel)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// NotifyChannelRepo_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
|
|
type NotifyChannelRepo_Update_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Update is a helper method to define mock.On call
|
|
// - channel *biz.NotifyChannel
|
|
func (_e *NotifyChannelRepo_Expecter) Update(channel any) *NotifyChannelRepo_Update_Call {
|
|
return &NotifyChannelRepo_Update_Call{Call: _e.mock.On("Update", channel)}
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Update_Call) Run(run func(channel *biz.NotifyChannel)) *NotifyChannelRepo_Update_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 *biz.NotifyChannel
|
|
if args[0] != nil {
|
|
arg0 = args[0].(*biz.NotifyChannel)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Update_Call) Return(err error) *NotifyChannelRepo_Update_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *NotifyChannelRepo_Update_Call) RunAndReturn(run func(channel *biz.NotifyChannel) error) *NotifyChannelRepo_Update_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|