Go 1.14 introduces usage of alternate go.mod files to track other dependencies which are not related to the main app. We use this to track all tool dependencies so that everybody uses the same version of all tools, including CI. This will prevent version conflicts due to everybody using different versions of the tools. And it will not try to upgrade the tool version, every single time, one runs the tool command. While here, we also re-generate some filestore mocks which weren't up to date. Fixes #13088 Co-authored-by: mattermod <mattermod@users.noreply.github.com>
222 строки
4.8 KiB
Go
222 строки
4.8 KiB
Go
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make filesstore-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
io "io"
|
|
|
|
filesstore "github.com/mattermost/mattermost-server/v5/services/filesstore"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
model "github.com/mattermost/mattermost-server/v5/model"
|
|
)
|
|
|
|
// FileBackend is an autogenerated mock type for the FileBackend type
|
|
type FileBackend struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// CopyFile provides a mock function with given fields: oldPath, newPath
|
|
func (_m *FileBackend) CopyFile(oldPath string, newPath string) *model.AppError {
|
|
ret := _m.Called(oldPath, newPath)
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.AppError); ok {
|
|
r0 = rf(oldPath, newPath)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// FileExists provides a mock function with given fields: path
|
|
func (_m *FileBackend) FileExists(path string) (bool, *model.AppError) {
|
|
ret := _m.Called(path)
|
|
|
|
var r0 bool
|
|
if rf, ok := ret.Get(0).(func(string) bool); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(path)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// ListDirectory provides a mock function with given fields: path
|
|
func (_m *FileBackend) ListDirectory(path string) (*[]string, *model.AppError) {
|
|
ret := _m.Called(path)
|
|
|
|
var r0 *[]string
|
|
if rf, ok := ret.Get(0).(func(string) *[]string); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*[]string)
|
|
}
|
|
}
|
|
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(path)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MoveFile provides a mock function with given fields: oldPath, newPath
|
|
func (_m *FileBackend) MoveFile(oldPath string, newPath string) *model.AppError {
|
|
ret := _m.Called(oldPath, newPath)
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.AppError); ok {
|
|
r0 = rf(oldPath, newPath)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// ReadFile provides a mock function with given fields: path
|
|
func (_m *FileBackend) ReadFile(path string) ([]byte, *model.AppError) {
|
|
ret := _m.Called(path)
|
|
|
|
var r0 []byte
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]byte)
|
|
}
|
|
}
|
|
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(path)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Reader provides a mock function with given fields: path
|
|
func (_m *FileBackend) Reader(path string) (filesstore.ReadCloseSeeker, *model.AppError) {
|
|
ret := _m.Called(path)
|
|
|
|
var r0 filesstore.ReadCloseSeeker
|
|
if rf, ok := ret.Get(0).(func(string) filesstore.ReadCloseSeeker); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(filesstore.ReadCloseSeeker)
|
|
}
|
|
}
|
|
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
r1 = rf(path)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// RemoveDirectory provides a mock function with given fields: path
|
|
func (_m *FileBackend) RemoveDirectory(path string) *model.AppError {
|
|
ret := _m.Called(path)
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveFile provides a mock function with given fields: path
|
|
func (_m *FileBackend) RemoveFile(path string) *model.AppError {
|
|
ret := _m.Called(path)
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
r0 = rf(path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// TestConnection provides a mock function with given fields:
|
|
func (_m *FileBackend) TestConnection() *model.AppError {
|
|
ret := _m.Called()
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// WriteFile provides a mock function with given fields: fr, path
|
|
func (_m *FileBackend) WriteFile(fr io.Reader, path string) (int64, *model.AppError) {
|
|
ret := _m.Called(fr, path)
|
|
|
|
var r0 int64
|
|
if rf, ok := ret.Get(0).(func(io.Reader, string) int64); ok {
|
|
r0 = rf(fr, path)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(1).(func(io.Reader, string) *model.AppError); ok {
|
|
r1 = rf(fr, path)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|