github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/shared/filestore/mocks/FileBackend.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  // Regenerate this file using `make filestore-mocks`.
     4  
     5  package mocks
     6  
     7  import (
     8  	io "io"
     9  
    10  	filestore "github.com/masterhung0112/hk_server/v5/shared/filestore"
    11  
    12  	mock "github.com/stretchr/testify/mock"
    13  
    14  	time "time"
    15  )
    16  
    17  // FileBackend is an autogenerated mock type for the FileBackend type
    18  type FileBackend struct {
    19  	mock.Mock
    20  }
    21  
    22  // AppendFile provides a mock function with given fields: fr, path
    23  func (_m *FileBackend) AppendFile(fr io.Reader, path string) (int64, error) {
    24  	ret := _m.Called(fr, path)
    25  
    26  	var r0 int64
    27  	if rf, ok := ret.Get(0).(func(io.Reader, string) int64); ok {
    28  		r0 = rf(fr, path)
    29  	} else {
    30  		r0 = ret.Get(0).(int64)
    31  	}
    32  
    33  	var r1 error
    34  	if rf, ok := ret.Get(1).(func(io.Reader, string) error); ok {
    35  		r1 = rf(fr, path)
    36  	} else {
    37  		r1 = ret.Error(1)
    38  	}
    39  
    40  	return r0, r1
    41  }
    42  
    43  // CopyFile provides a mock function with given fields: oldPath, newPath
    44  func (_m *FileBackend) CopyFile(oldPath string, newPath string) error {
    45  	ret := _m.Called(oldPath, newPath)
    46  
    47  	var r0 error
    48  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
    49  		r0 = rf(oldPath, newPath)
    50  	} else {
    51  		r0 = ret.Error(0)
    52  	}
    53  
    54  	return r0
    55  }
    56  
    57  // FileExists provides a mock function with given fields: path
    58  func (_m *FileBackend) FileExists(path string) (bool, error) {
    59  	ret := _m.Called(path)
    60  
    61  	var r0 bool
    62  	if rf, ok := ret.Get(0).(func(string) bool); ok {
    63  		r0 = rf(path)
    64  	} else {
    65  		r0 = ret.Get(0).(bool)
    66  	}
    67  
    68  	var r1 error
    69  	if rf, ok := ret.Get(1).(func(string) error); ok {
    70  		r1 = rf(path)
    71  	} else {
    72  		r1 = ret.Error(1)
    73  	}
    74  
    75  	return r0, r1
    76  }
    77  
    78  // FileModTime provides a mock function with given fields: path
    79  func (_m *FileBackend) FileModTime(path string) (time.Time, error) {
    80  	ret := _m.Called(path)
    81  
    82  	var r0 time.Time
    83  	if rf, ok := ret.Get(0).(func(string) time.Time); ok {
    84  		r0 = rf(path)
    85  	} else {
    86  		r0 = ret.Get(0).(time.Time)
    87  	}
    88  
    89  	var r1 error
    90  	if rf, ok := ret.Get(1).(func(string) error); ok {
    91  		r1 = rf(path)
    92  	} else {
    93  		r1 = ret.Error(1)
    94  	}
    95  
    96  	return r0, r1
    97  }
    98  
    99  // FileSize provides a mock function with given fields: path
   100  func (_m *FileBackend) FileSize(path string) (int64, error) {
   101  	ret := _m.Called(path)
   102  
   103  	var r0 int64
   104  	if rf, ok := ret.Get(0).(func(string) int64); ok {
   105  		r0 = rf(path)
   106  	} else {
   107  		r0 = ret.Get(0).(int64)
   108  	}
   109  
   110  	var r1 error
   111  	if rf, ok := ret.Get(1).(func(string) error); ok {
   112  		r1 = rf(path)
   113  	} else {
   114  		r1 = ret.Error(1)
   115  	}
   116  
   117  	return r0, r1
   118  }
   119  
   120  // ListDirectory provides a mock function with given fields: path
   121  func (_m *FileBackend) ListDirectory(path string) ([]string, error) {
   122  	ret := _m.Called(path)
   123  
   124  	var r0 []string
   125  	if rf, ok := ret.Get(0).(func(string) []string); ok {
   126  		r0 = rf(path)
   127  	} else {
   128  		if ret.Get(0) != nil {
   129  			r0 = ret.Get(0).([]string)
   130  		}
   131  	}
   132  
   133  	var r1 error
   134  	if rf, ok := ret.Get(1).(func(string) error); ok {
   135  		r1 = rf(path)
   136  	} else {
   137  		r1 = ret.Error(1)
   138  	}
   139  
   140  	return r0, r1
   141  }
   142  
   143  // MoveFile provides a mock function with given fields: oldPath, newPath
   144  func (_m *FileBackend) MoveFile(oldPath string, newPath string) error {
   145  	ret := _m.Called(oldPath, newPath)
   146  
   147  	var r0 error
   148  	if rf, ok := ret.Get(0).(func(string, string) error); ok {
   149  		r0 = rf(oldPath, newPath)
   150  	} else {
   151  		r0 = ret.Error(0)
   152  	}
   153  
   154  	return r0
   155  }
   156  
   157  // ReadFile provides a mock function with given fields: path
   158  func (_m *FileBackend) ReadFile(path string) ([]byte, error) {
   159  	ret := _m.Called(path)
   160  
   161  	var r0 []byte
   162  	if rf, ok := ret.Get(0).(func(string) []byte); ok {
   163  		r0 = rf(path)
   164  	} else {
   165  		if ret.Get(0) != nil {
   166  			r0 = ret.Get(0).([]byte)
   167  		}
   168  	}
   169  
   170  	var r1 error
   171  	if rf, ok := ret.Get(1).(func(string) error); ok {
   172  		r1 = rf(path)
   173  	} else {
   174  		r1 = ret.Error(1)
   175  	}
   176  
   177  	return r0, r1
   178  }
   179  
   180  // Reader provides a mock function with given fields: path
   181  func (_m *FileBackend) Reader(path string) (filestore.ReadCloseSeeker, error) {
   182  	ret := _m.Called(path)
   183  
   184  	var r0 filestore.ReadCloseSeeker
   185  	if rf, ok := ret.Get(0).(func(string) filestore.ReadCloseSeeker); ok {
   186  		r0 = rf(path)
   187  	} else {
   188  		if ret.Get(0) != nil {
   189  			r0 = ret.Get(0).(filestore.ReadCloseSeeker)
   190  		}
   191  	}
   192  
   193  	var r1 error
   194  	if rf, ok := ret.Get(1).(func(string) error); ok {
   195  		r1 = rf(path)
   196  	} else {
   197  		r1 = ret.Error(1)
   198  	}
   199  
   200  	return r0, r1
   201  }
   202  
   203  // RemoveDirectory provides a mock function with given fields: path
   204  func (_m *FileBackend) RemoveDirectory(path string) error {
   205  	ret := _m.Called(path)
   206  
   207  	var r0 error
   208  	if rf, ok := ret.Get(0).(func(string) error); ok {
   209  		r0 = rf(path)
   210  	} else {
   211  		r0 = ret.Error(0)
   212  	}
   213  
   214  	return r0
   215  }
   216  
   217  // RemoveFile provides a mock function with given fields: path
   218  func (_m *FileBackend) RemoveFile(path string) error {
   219  	ret := _m.Called(path)
   220  
   221  	var r0 error
   222  	if rf, ok := ret.Get(0).(func(string) error); ok {
   223  		r0 = rf(path)
   224  	} else {
   225  		r0 = ret.Error(0)
   226  	}
   227  
   228  	return r0
   229  }
   230  
   231  // TestConnection provides a mock function with given fields:
   232  func (_m *FileBackend) TestConnection() error {
   233  	ret := _m.Called()
   234  
   235  	var r0 error
   236  	if rf, ok := ret.Get(0).(func() error); ok {
   237  		r0 = rf()
   238  	} else {
   239  		r0 = ret.Error(0)
   240  	}
   241  
   242  	return r0
   243  }
   244  
   245  // WriteFile provides a mock function with given fields: fr, path
   246  func (_m *FileBackend) WriteFile(fr io.Reader, path string) (int64, error) {
   247  	ret := _m.Called(fr, path)
   248  
   249  	var r0 int64
   250  	if rf, ok := ret.Get(0).(func(io.Reader, string) int64); ok {
   251  		r0 = rf(fr, path)
   252  	} else {
   253  		r0 = ret.Get(0).(int64)
   254  	}
   255  
   256  	var r1 error
   257  	if rf, ok := ret.Get(1).(func(io.Reader, string) error); ok {
   258  		r1 = rf(fr, path)
   259  	} else {
   260  		r1 = ret.Error(1)
   261  	}
   262  
   263  	return r0, r1
   264  }