mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
7a340f486b
* Storage: add `WithContents` option to `storage.Get()` * fix tests Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
138 lines
3.3 KiB
Go
138 lines
3.3 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, options
|
|
func (_m *MockFileStorage) Get(ctx context.Context, path string, options *GetFileOptions) (*File, bool, error) {
|
|
ret := _m.Called(ctx, path, options)
|
|
|
|
var r0 *File
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, *GetFileOptions) *File); ok {
|
|
r0 = rf(ctx, path, options)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*File)
|
|
}
|
|
}
|
|
|
|
var r1 bool
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, *GetFileOptions) bool); ok {
|
|
r1 = rf(ctx, path, options)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
var r2 error
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, *GetFileOptions) error); ok {
|
|
r2 = rf(ctx, path, options)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// 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
|
|
}
|