grafana/pkg/infra/filestorage/file_storage_mock.go
Artur Wierzbicki 1d2aa7c69b
Storage: add delete / deleteFolder / createFolder (#51887)
* delete / delete folder / create folder

* add backend tests

* implement force delete

* fix merge

* lint fix

* fix delete root folder

* fix folder name validation

* fix mysql path_hash issue

* Fix returning error
2022-07-08 22:23:16 +04:00

131 lines
3.1 KiB
Go

// Code generated by mockery v2.10.6. DO NOT EDIT.
package filestorage
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// MockFileStorage is an autogenerated mock type for the FileStorage type
type MockFileStorage struct {
mock.Mock
}
// CreateFolder provides a mock function with given fields: ctx, path
func (_m *MockFileStorage) CreateFolder(ctx context.Context, path string) error {
ret := _m.Called(ctx, path)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, path)
} else {
r0 = ret.Error(0)
}
return r0
}
// Delete provides a mock function with given fields: ctx, path
func (_m *MockFileStorage) Delete(ctx context.Context, path string) error {
ret := _m.Called(ctx, path)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, path)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteFolder provides a mock function with given fields: ctx, path, options
func (_m *MockFileStorage) DeleteFolder(ctx context.Context, path string, options *DeleteFolderOptions) error {
ret := _m.Called(ctx, path, options)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *DeleteFolderOptions) error); ok {
r0 = rf(ctx, path, options)
} else {
r0 = ret.Error(0)
}
return r0
}
// Get provides a mock function with given fields: ctx, path
func (_m *MockFileStorage) Get(ctx context.Context, path string) (*File, error) {
ret := _m.Called(ctx, path)
var r0 *File
if rf, ok := ret.Get(0).(func(context.Context, string) *File); ok {
r0 = rf(ctx, path)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*File)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, folderPath, paging, options
func (_m *MockFileStorage) List(ctx context.Context, folderPath string, paging *Paging, options *ListOptions) (*ListResponse, error) {
ret := _m.Called(ctx, folderPath, paging, options)
var r0 *ListResponse
if rf, ok := ret.Get(0).(func(context.Context, string, *Paging, *ListOptions) *ListResponse); ok {
r0 = rf(ctx, folderPath, paging, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*ListResponse)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, *Paging, *ListOptions) error); ok {
r1 = rf(ctx, folderPath, paging, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Upsert provides a mock function with given fields: ctx, command
func (_m *MockFileStorage) Upsert(ctx context.Context, command *UpsertFileCommand) error {
ret := _m.Called(ctx, command)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *UpsertFileCommand) error); ok {
r0 = rf(ctx, command)
} else {
r0 = ret.Error(0)
}
return r0
}
// close provides a mock function with given fields:
func (_m *MockFileStorage) close() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}