Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
@@ -0,0 +1,129 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"github.com/qsfera/server/services/collaboration/pkg/connector"
mock "github.com/stretchr/testify/mock"
)
// NewConnectorService creates a new instance of ConnectorService. 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 NewConnectorService(t interface {
mock.TestingT
Cleanup(func())
}) *ConnectorService {
mock := &ConnectorService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// ConnectorService is an autogenerated mock type for the ConnectorService type
type ConnectorService struct {
mock.Mock
}
type ConnectorService_Expecter struct {
mock *mock.Mock
}
func (_m *ConnectorService) EXPECT() *ConnectorService_Expecter {
return &ConnectorService_Expecter{mock: &_m.Mock}
}
// GetContentConnector provides a mock function for the type ConnectorService
func (_mock *ConnectorService) GetContentConnector() connector.ContentConnectorService {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetContentConnector")
}
var r0 connector.ContentConnectorService
if returnFunc, ok := ret.Get(0).(func() connector.ContentConnectorService); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(connector.ContentConnectorService)
}
}
return r0
}
// ConnectorService_GetContentConnector_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContentConnector'
type ConnectorService_GetContentConnector_Call struct {
*mock.Call
}
// GetContentConnector is a helper method to define mock.On call
func (_e *ConnectorService_Expecter) GetContentConnector() *ConnectorService_GetContentConnector_Call {
return &ConnectorService_GetContentConnector_Call{Call: _e.mock.On("GetContentConnector")}
}
func (_c *ConnectorService_GetContentConnector_Call) Run(run func()) *ConnectorService_GetContentConnector_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *ConnectorService_GetContentConnector_Call) Return(contentConnectorService connector.ContentConnectorService) *ConnectorService_GetContentConnector_Call {
_c.Call.Return(contentConnectorService)
return _c
}
func (_c *ConnectorService_GetContentConnector_Call) RunAndReturn(run func() connector.ContentConnectorService) *ConnectorService_GetContentConnector_Call {
_c.Call.Return(run)
return _c
}
// GetFileConnector provides a mock function for the type ConnectorService
func (_mock *ConnectorService) GetFileConnector() connector.FileConnectorService {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetFileConnector")
}
var r0 connector.FileConnectorService
if returnFunc, ok := ret.Get(0).(func() connector.FileConnectorService); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(connector.FileConnectorService)
}
}
return r0
}
// ConnectorService_GetFileConnector_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFileConnector'
type ConnectorService_GetFileConnector_Call struct {
*mock.Call
}
// GetFileConnector is a helper method to define mock.On call
func (_e *ConnectorService_Expecter) GetFileConnector() *ConnectorService_GetFileConnector_Call {
return &ConnectorService_GetFileConnector_Call{Call: _e.mock.On("GetFileConnector")}
}
func (_c *ConnectorService_GetFileConnector_Call) Run(run func()) *ConnectorService_GetFileConnector_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *ConnectorService_GetFileConnector_Call) Return(fileConnectorService connector.FileConnectorService) *ConnectorService_GetFileConnector_Call {
_c.Call.Return(fileConnectorService)
return _c
}
func (_c *ConnectorService_GetFileConnector_Call) RunAndReturn(run func() connector.FileConnectorService) *ConnectorService_GetFileConnector_Call {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,178 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"io"
"net/http"
"github.com/qsfera/server/services/collaboration/pkg/connector"
mock "github.com/stretchr/testify/mock"
)
// NewContentConnectorService creates a new instance of ContentConnectorService. 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 NewContentConnectorService(t interface {
mock.TestingT
Cleanup(func())
}) *ContentConnectorService {
mock := &ContentConnectorService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// ContentConnectorService is an autogenerated mock type for the ContentConnectorService type
type ContentConnectorService struct {
mock.Mock
}
type ContentConnectorService_Expecter struct {
mock *mock.Mock
}
func (_m *ContentConnectorService) EXPECT() *ContentConnectorService_Expecter {
return &ContentConnectorService_Expecter{mock: &_m.Mock}
}
// GetFile provides a mock function for the type ContentConnectorService
func (_mock *ContentConnectorService) GetFile(ctx context.Context, w http.ResponseWriter) error {
ret := _mock.Called(ctx, w)
if len(ret) == 0 {
panic("no return value specified for GetFile")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, http.ResponseWriter) error); ok {
r0 = returnFunc(ctx, w)
} else {
r0 = ret.Error(0)
}
return r0
}
// ContentConnectorService_GetFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFile'
type ContentConnectorService_GetFile_Call struct {
*mock.Call
}
// GetFile is a helper method to define mock.On call
// - ctx context.Context
// - w http.ResponseWriter
func (_e *ContentConnectorService_Expecter) GetFile(ctx interface{}, w interface{}) *ContentConnectorService_GetFile_Call {
return &ContentConnectorService_GetFile_Call{Call: _e.mock.On("GetFile", ctx, w)}
}
func (_c *ContentConnectorService_GetFile_Call) Run(run func(ctx context.Context, w http.ResponseWriter)) *ContentConnectorService_GetFile_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 http.ResponseWriter
if args[1] != nil {
arg1 = args[1].(http.ResponseWriter)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *ContentConnectorService_GetFile_Call) Return(err error) *ContentConnectorService_GetFile_Call {
_c.Call.Return(err)
return _c
}
func (_c *ContentConnectorService_GetFile_Call) RunAndReturn(run func(ctx context.Context, w http.ResponseWriter) error) *ContentConnectorService_GetFile_Call {
_c.Call.Return(run)
return _c
}
// PutFile provides a mock function for the type ContentConnectorService
func (_mock *ContentConnectorService) PutFile(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, stream, streamLength, lockID)
if len(ret) == 0 {
panic("no return value specified for PutFile")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, stream, streamLength, lockID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, stream, streamLength, lockID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, io.Reader, int64, string) error); ok {
r1 = returnFunc(ctx, stream, streamLength, lockID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ContentConnectorService_PutFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutFile'
type ContentConnectorService_PutFile_Call struct {
*mock.Call
}
// PutFile is a helper method to define mock.On call
// - ctx context.Context
// - stream io.Reader
// - streamLength int64
// - lockID string
func (_e *ContentConnectorService_Expecter) PutFile(ctx interface{}, stream interface{}, streamLength interface{}, lockID interface{}) *ContentConnectorService_PutFile_Call {
return &ContentConnectorService_PutFile_Call{Call: _e.mock.On("PutFile", ctx, stream, streamLength, lockID)}
}
func (_c *ContentConnectorService_PutFile_Call) Run(run func(ctx context.Context, stream io.Reader, streamLength int64, lockID string)) *ContentConnectorService_PutFile_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 io.Reader
if args[1] != nil {
arg1 = args[1].(io.Reader)
}
var arg2 int64
if args[2] != nil {
arg2 = args[2].(int64)
}
var arg3 string
if args[3] != nil {
arg3 = args[3].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *ContentConnectorService_PutFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *ContentConnectorService_PutFile_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *ContentConnectorService_PutFile_Call) RunAndReturn(run func(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error)) *ContentConnectorService_PutFile_Call {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,756 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"io"
"github.com/qsfera/server/services/collaboration/pkg/connector"
mock "github.com/stretchr/testify/mock"
)
// NewFileConnectorService creates a new instance of FileConnectorService. 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 NewFileConnectorService(t interface {
mock.TestingT
Cleanup(func())
}) *FileConnectorService {
mock := &FileConnectorService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// FileConnectorService is an autogenerated mock type for the FileConnectorService type
type FileConnectorService struct {
mock.Mock
}
type FileConnectorService_Expecter struct {
mock *mock.Mock
}
func (_m *FileConnectorService) EXPECT() *FileConnectorService_Expecter {
return &FileConnectorService_Expecter{mock: &_m.Mock}
}
// CheckFileInfo provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) CheckFileInfo(ctx context.Context) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for CheckFileInfo")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_CheckFileInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckFileInfo'
type FileConnectorService_CheckFileInfo_Call struct {
*mock.Call
}
// CheckFileInfo is a helper method to define mock.On call
// - ctx context.Context
func (_e *FileConnectorService_Expecter) CheckFileInfo(ctx interface{}) *FileConnectorService_CheckFileInfo_Call {
return &FileConnectorService_CheckFileInfo_Call{Call: _e.mock.On("CheckFileInfo", ctx)}
}
func (_c *FileConnectorService_CheckFileInfo_Call) Run(run func(ctx context.Context)) *FileConnectorService_CheckFileInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *FileConnectorService_CheckFileInfo_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_CheckFileInfo_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_CheckFileInfo_Call) RunAndReturn(run func(ctx context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_CheckFileInfo_Call {
_c.Call.Return(run)
return _c
}
// DeleteFile provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) DeleteFile(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, lockID)
if len(ret) == 0 {
panic("no return value specified for DeleteFile")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, lockID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, lockID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, lockID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_DeleteFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteFile'
type FileConnectorService_DeleteFile_Call struct {
*mock.Call
}
// DeleteFile is a helper method to define mock.On call
// - ctx context.Context
// - lockID string
func (_e *FileConnectorService_Expecter) DeleteFile(ctx interface{}, lockID interface{}) *FileConnectorService_DeleteFile_Call {
return &FileConnectorService_DeleteFile_Call{Call: _e.mock.On("DeleteFile", ctx, lockID)}
}
func (_c *FileConnectorService_DeleteFile_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_DeleteFile_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *FileConnectorService_DeleteFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_DeleteFile_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_DeleteFile_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_DeleteFile_Call {
_c.Call.Return(run)
return _c
}
// GetAvatar provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) GetAvatar(ctx context.Context, userID string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, userID)
if len(ret) == 0 {
panic("no return value specified for GetAvatar")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, userID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, userID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, userID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_GetAvatar_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAvatar'
type FileConnectorService_GetAvatar_Call struct {
*mock.Call
}
// GetAvatar is a helper method to define mock.On call
// - ctx context.Context
// - userID string
func (_e *FileConnectorService_Expecter) GetAvatar(ctx interface{}, userID interface{}) *FileConnectorService_GetAvatar_Call {
return &FileConnectorService_GetAvatar_Call{Call: _e.mock.On("GetAvatar", ctx, userID)}
}
func (_c *FileConnectorService_GetAvatar_Call) Run(run func(ctx context.Context, userID string)) *FileConnectorService_GetAvatar_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *FileConnectorService_GetAvatar_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_GetAvatar_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_GetAvatar_Call) RunAndReturn(run func(ctx context.Context, userID string) (*connector.ConnectorResponse, error)) *FileConnectorService_GetAvatar_Call {
_c.Call.Return(run)
return _c
}
// GetLock provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) GetLock(ctx context.Context) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetLock")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_GetLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLock'
type FileConnectorService_GetLock_Call struct {
*mock.Call
}
// GetLock is a helper method to define mock.On call
// - ctx context.Context
func (_e *FileConnectorService_Expecter) GetLock(ctx interface{}) *FileConnectorService_GetLock_Call {
return &FileConnectorService_GetLock_Call{Call: _e.mock.On("GetLock", ctx)}
}
func (_c *FileConnectorService_GetLock_Call) Run(run func(ctx context.Context)) *FileConnectorService_GetLock_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *FileConnectorService_GetLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_GetLock_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_GetLock_Call) RunAndReturn(run func(ctx context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_GetLock_Call {
_c.Call.Return(run)
return _c
}
// Lock provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) Lock(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, lockID, oldLockID)
if len(ret) == 0 {
panic("no return value specified for Lock")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, lockID, oldLockID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, lockID, oldLockID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = returnFunc(ctx, lockID, oldLockID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_Lock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Lock'
type FileConnectorService_Lock_Call struct {
*mock.Call
}
// Lock is a helper method to define mock.On call
// - ctx context.Context
// - lockID string
// - oldLockID string
func (_e *FileConnectorService_Expecter) Lock(ctx interface{}, lockID interface{}, oldLockID interface{}) *FileConnectorService_Lock_Call {
return &FileConnectorService_Lock_Call{Call: _e.mock.On("Lock", ctx, lockID, oldLockID)}
}
func (_c *FileConnectorService_Lock_Call) Run(run func(ctx context.Context, lockID string, oldLockID string)) *FileConnectorService_Lock_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *FileConnectorService_Lock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_Lock_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_Lock_Call) RunAndReturn(run func(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_Lock_Call {
_c.Call.Return(run)
return _c
}
// PutRelativeFileRelative provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) PutRelativeFileRelative(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, ccs, stream, streamLength, target)
if len(ret) == 0 {
panic("no return value specified for PutRelativeFileRelative")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, ccs, stream, streamLength, target)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, ccs, stream, streamLength, target)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok {
r1 = returnFunc(ctx, ccs, stream, streamLength, target)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_PutRelativeFileRelative_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutRelativeFileRelative'
type FileConnectorService_PutRelativeFileRelative_Call struct {
*mock.Call
}
// PutRelativeFileRelative is a helper method to define mock.On call
// - ctx context.Context
// - ccs connector.ContentConnectorService
// - stream io.Reader
// - streamLength int64
// - target string
func (_e *FileConnectorService_Expecter) PutRelativeFileRelative(ctx interface{}, ccs interface{}, stream interface{}, streamLength interface{}, target interface{}) *FileConnectorService_PutRelativeFileRelative_Call {
return &FileConnectorService_PutRelativeFileRelative_Call{Call: _e.mock.On("PutRelativeFileRelative", ctx, ccs, stream, streamLength, target)}
}
func (_c *FileConnectorService_PutRelativeFileRelative_Call) Run(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string)) *FileConnectorService_PutRelativeFileRelative_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 connector.ContentConnectorService
if args[1] != nil {
arg1 = args[1].(connector.ContentConnectorService)
}
var arg2 io.Reader
if args[2] != nil {
arg2 = args[2].(io.Reader)
}
var arg3 int64
if args[3] != nil {
arg3 = args[3].(int64)
}
var arg4 string
if args[4] != nil {
arg4 = args[4].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *FileConnectorService_PutRelativeFileRelative_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_PutRelativeFileRelative_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_PutRelativeFileRelative_Call) RunAndReturn(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileRelative_Call {
_c.Call.Return(run)
return _c
}
// PutRelativeFileSuggested provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) PutRelativeFileSuggested(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, ccs, stream, streamLength, target)
if len(ret) == 0 {
panic("no return value specified for PutRelativeFileSuggested")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, ccs, stream, streamLength, target)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, ccs, stream, streamLength, target)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok {
r1 = returnFunc(ctx, ccs, stream, streamLength, target)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_PutRelativeFileSuggested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutRelativeFileSuggested'
type FileConnectorService_PutRelativeFileSuggested_Call struct {
*mock.Call
}
// PutRelativeFileSuggested is a helper method to define mock.On call
// - ctx context.Context
// - ccs connector.ContentConnectorService
// - stream io.Reader
// - streamLength int64
// - target string
func (_e *FileConnectorService_Expecter) PutRelativeFileSuggested(ctx interface{}, ccs interface{}, stream interface{}, streamLength interface{}, target interface{}) *FileConnectorService_PutRelativeFileSuggested_Call {
return &FileConnectorService_PutRelativeFileSuggested_Call{Call: _e.mock.On("PutRelativeFileSuggested", ctx, ccs, stream, streamLength, target)}
}
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Run(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string)) *FileConnectorService_PutRelativeFileSuggested_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 connector.ContentConnectorService
if args[1] != nil {
arg1 = args[1].(connector.ContentConnectorService)
}
var arg2 io.Reader
if args[2] != nil {
arg2 = args[2].(io.Reader)
}
var arg3 int64
if args[3] != nil {
arg3 = args[3].(int64)
}
var arg4 string
if args[4] != nil {
arg4 = args[4].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
arg4,
)
})
return _c
}
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_PutRelativeFileSuggested_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) RunAndReturn(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileSuggested_Call {
_c.Call.Return(run)
return _c
}
// RefreshLock provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) RefreshLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, lockID)
if len(ret) == 0 {
panic("no return value specified for RefreshLock")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, lockID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, lockID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, lockID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_RefreshLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshLock'
type FileConnectorService_RefreshLock_Call struct {
*mock.Call
}
// RefreshLock is a helper method to define mock.On call
// - ctx context.Context
// - lockID string
func (_e *FileConnectorService_Expecter) RefreshLock(ctx interface{}, lockID interface{}) *FileConnectorService_RefreshLock_Call {
return &FileConnectorService_RefreshLock_Call{Call: _e.mock.On("RefreshLock", ctx, lockID)}
}
func (_c *FileConnectorService_RefreshLock_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_RefreshLock_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *FileConnectorService_RefreshLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_RefreshLock_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_RefreshLock_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_RefreshLock_Call {
_c.Call.Return(run)
return _c
}
// RenameFile provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) RenameFile(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, lockID, target)
if len(ret) == 0 {
panic("no return value specified for RenameFile")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, lockID, target)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, lockID, target)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = returnFunc(ctx, lockID, target)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_RenameFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameFile'
type FileConnectorService_RenameFile_Call struct {
*mock.Call
}
// RenameFile is a helper method to define mock.On call
// - ctx context.Context
// - lockID string
// - target string
func (_e *FileConnectorService_Expecter) RenameFile(ctx interface{}, lockID interface{}, target interface{}) *FileConnectorService_RenameFile_Call {
return &FileConnectorService_RenameFile_Call{Call: _e.mock.On("RenameFile", ctx, lockID, target)}
}
func (_c *FileConnectorService_RenameFile_Call) Run(run func(ctx context.Context, lockID string, target string)) *FileConnectorService_RenameFile_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *FileConnectorService_RenameFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_RenameFile_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_RenameFile_Call) RunAndReturn(run func(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_RenameFile_Call {
_c.Call.Return(run)
return _c
}
// UnLock provides a mock function for the type FileConnectorService
func (_mock *FileConnectorService) UnLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
ret := _mock.Called(ctx, lockID)
if len(ret) == 0 {
panic("no return value specified for UnLock")
}
var r0 *connector.ConnectorResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
return returnFunc(ctx, lockID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
r0 = returnFunc(ctx, lockID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*connector.ConnectorResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, lockID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FileConnectorService_UnLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnLock'
type FileConnectorService_UnLock_Call struct {
*mock.Call
}
// UnLock is a helper method to define mock.On call
// - ctx context.Context
// - lockID string
func (_e *FileConnectorService_Expecter) UnLock(ctx interface{}, lockID interface{}) *FileConnectorService_UnLock_Call {
return &FileConnectorService_UnLock_Call{Call: _e.mock.On("UnLock", ctx, lockID)}
}
func (_c *FileConnectorService_UnLock_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_UnLock_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *FileConnectorService_UnLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_UnLock_Call {
_c.Call.Return(connectorResponse, err)
return _c
}
func (_c *FileConnectorService_UnLock_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_UnLock_Call {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,108 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool"
mock "github.com/stretchr/testify/mock"
)
// NewSelectable creates a new instance of Selectable. 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 NewSelectable[T any](t interface {
mock.TestingT
Cleanup(func())
}) *Selectable[T] {
mock := &Selectable[T]{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Selectable is an autogenerated mock type for the Selectable type
type Selectable[T any] struct {
mock.Mock
}
type Selectable_Expecter[T any] struct {
mock *mock.Mock
}
func (_m *Selectable[T]) EXPECT() *Selectable_Expecter[T] {
return &Selectable_Expecter[T]{mock: &_m.Mock}
}
// Next provides a mock function for the type Selectable
func (_mock *Selectable[T]) Next(opts ...pool.Option) (T, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(opts)
} else {
tmpRet = _mock.Called()
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for Next")
}
var r0 T
var r1 error
if returnFunc, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok {
return returnFunc(opts...)
}
if returnFunc, ok := ret.Get(0).(func(...pool.Option) T); ok {
r0 = returnFunc(opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(T)
}
}
if returnFunc, ok := ret.Get(1).(func(...pool.Option) error); ok {
r1 = returnFunc(opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Selectable_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next'
type Selectable_Next_Call[T any] struct {
*mock.Call
}
// Next is a helper method to define mock.On call
// - opts ...pool.Option
func (_e *Selectable_Expecter[T]) Next(opts ...interface{}) *Selectable_Next_Call[T] {
return &Selectable_Next_Call[T]{Call: _e.mock.On("Next",
append([]interface{}{}, opts...)...)}
}
func (_c *Selectable_Next_Call[T]) Run(run func(opts ...pool.Option)) *Selectable_Next_Call[T] {
_c.Call.Run(func(args mock.Arguments) {
var arg0 []pool.Option
var variadicArgs []pool.Option
if len(args) > 0 {
variadicArgs = args[0].([]pool.Option)
}
arg0 = variadicArgs
run(
arg0...,
)
})
return _c
}
func (_c *Selectable_Next_Call[T]) Return(v T, err error) *Selectable_Next_Call[T] {
_c.Call.Return(v, err)
return _c
}
func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(opts ...pool.Option) (T, error)) *Selectable_Next_Call[T] {
_c.Call.Return(run)
return _c
}
@@ -0,0 +1,87 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
mock "github.com/stretchr/testify/mock"
)
// NewLockParser creates a new instance of LockParser. 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 NewLockParser(t interface {
mock.TestingT
Cleanup(func())
}) *LockParser {
mock := &LockParser{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// LockParser is an autogenerated mock type for the LockParser type
type LockParser struct {
mock.Mock
}
type LockParser_Expecter struct {
mock *mock.Mock
}
func (_m *LockParser) EXPECT() *LockParser_Expecter {
return &LockParser_Expecter{mock: &_m.Mock}
}
// ParseLock provides a mock function for the type LockParser
func (_mock *LockParser) ParseLock(id string) string {
ret := _mock.Called(id)
if len(ret) == 0 {
panic("no return value specified for ParseLock")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func(string) string); ok {
r0 = returnFunc(id)
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// LockParser_ParseLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseLock'
type LockParser_ParseLock_Call struct {
*mock.Call
}
// ParseLock is a helper method to define mock.On call
// - id string
func (_e *LockParser_Expecter) ParseLock(id interface{}) *LockParser_ParseLock_Call {
return &LockParser_ParseLock_Call{Call: _e.mock.On("ParseLock", id)}
}
func (_c *LockParser_ParseLock_Call) Run(run func(id string)) *LockParser_ParseLock_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
run(
arg0,
)
})
return _c
}
func (_c *LockParser_ParseLock_Call) Return(s string) *LockParser_ParseLock_Call {
_c.Call.Return(s)
return _c
}
func (_c *LockParser_ParseLock_Call) RunAndReturn(run func(id string) string) *LockParser_ParseLock_Call {
_c.Call.Return(run)
return _c
}