mirror of https://github.com/milvus-io/milvus.git
808 lines
23 KiB
Go
808 lines
23 KiB
Go
// Code generated by mockery v2.32.4. DO NOT EDIT.
|
|
|
|
package mock_kv
|
|
|
|
import (
|
|
predicates "github.com/milvus-io/milvus/pkg/kv/predicates"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockMetaKv is an autogenerated mock type for the MetaKv type
|
|
type MockMetaKv struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockMetaKv_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockMetaKv) EXPECT() *MockMetaKv_Expecter {
|
|
return &MockMetaKv_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Close provides a mock function with given fields:
|
|
func (_m *MockMetaKv) Close() {
|
|
_m.Called()
|
|
}
|
|
|
|
// MockMetaKv_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
|
|
type MockMetaKv_Close_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Close is a helper method to define mock.On call
|
|
func (_e *MockMetaKv_Expecter) Close() *MockMetaKv_Close_Call {
|
|
return &MockMetaKv_Close_Call{Call: _e.mock.On("Close")}
|
|
}
|
|
|
|
func (_c *MockMetaKv_Close_Call) Run(run func()) *MockMetaKv_Close_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Close_Call) Return() *MockMetaKv_Close_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Close_Call) RunAndReturn(run func()) *MockMetaKv_Close_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// CompareVersionAndSwap provides a mock function with given fields: key, version, target
|
|
func (_m *MockMetaKv) CompareVersionAndSwap(key string, version int64, target string) (bool, error) {
|
|
ret := _m.Called(key, version, target)
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, int64, string) (bool, error)); ok {
|
|
return rf(key, version, target)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, int64, string) bool); ok {
|
|
r0 = rf(key, version, target)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int64, string) error); ok {
|
|
r1 = rf(key, version, target)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockMetaKv_CompareVersionAndSwap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompareVersionAndSwap'
|
|
type MockMetaKv_CompareVersionAndSwap_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// CompareVersionAndSwap is a helper method to define mock.On call
|
|
// - key string
|
|
// - version int64
|
|
// - target string
|
|
func (_e *MockMetaKv_Expecter) CompareVersionAndSwap(key interface{}, version interface{}, target interface{}) *MockMetaKv_CompareVersionAndSwap_Call {
|
|
return &MockMetaKv_CompareVersionAndSwap_Call{Call: _e.mock.On("CompareVersionAndSwap", key, version, target)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_CompareVersionAndSwap_Call) Run(run func(key string, version int64, target string)) *MockMetaKv_CompareVersionAndSwap_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string), args[1].(int64), args[2].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_CompareVersionAndSwap_Call) Return(_a0 bool, _a1 error) *MockMetaKv_CompareVersionAndSwap_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_CompareVersionAndSwap_Call) RunAndReturn(run func(string, int64, string) (bool, error)) *MockMetaKv_CompareVersionAndSwap_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetPath provides a mock function with given fields: key
|
|
func (_m *MockMetaKv) GetPath(key string) string {
|
|
ret := _m.Called(key)
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func(string) string); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_GetPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPath'
|
|
type MockMetaKv_GetPath_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetPath is a helper method to define mock.On call
|
|
// - key string
|
|
func (_e *MockMetaKv_Expecter) GetPath(key interface{}) *MockMetaKv_GetPath_Call {
|
|
return &MockMetaKv_GetPath_Call{Call: _e.mock.On("GetPath", key)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_GetPath_Call) Run(run func(key string)) *MockMetaKv_GetPath_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_GetPath_Call) Return(_a0 string) *MockMetaKv_GetPath_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_GetPath_Call) RunAndReturn(run func(string) string) *MockMetaKv_GetPath_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Has provides a mock function with given fields: key
|
|
func (_m *MockMetaKv) Has(key string) (bool, error) {
|
|
ret := _m.Called(key)
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
|
|
return rf(key)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) bool); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(key)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockMetaKv_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has'
|
|
type MockMetaKv_Has_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Has is a helper method to define mock.On call
|
|
// - key string
|
|
func (_e *MockMetaKv_Expecter) Has(key interface{}) *MockMetaKv_Has_Call {
|
|
return &MockMetaKv_Has_Call{Call: _e.mock.On("Has", key)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_Has_Call) Run(run func(key string)) *MockMetaKv_Has_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Has_Call) Return(_a0 bool, _a1 error) *MockMetaKv_Has_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Has_Call) RunAndReturn(run func(string) (bool, error)) *MockMetaKv_Has_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// HasPrefix provides a mock function with given fields: prefix
|
|
func (_m *MockMetaKv) HasPrefix(prefix string) (bool, error) {
|
|
ret := _m.Called(prefix)
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
|
|
return rf(prefix)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) bool); ok {
|
|
r0 = rf(prefix)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(prefix)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockMetaKv_HasPrefix_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasPrefix'
|
|
type MockMetaKv_HasPrefix_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// HasPrefix is a helper method to define mock.On call
|
|
// - prefix string
|
|
func (_e *MockMetaKv_Expecter) HasPrefix(prefix interface{}) *MockMetaKv_HasPrefix_Call {
|
|
return &MockMetaKv_HasPrefix_Call{Call: _e.mock.On("HasPrefix", prefix)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_HasPrefix_Call) Run(run func(prefix string)) *MockMetaKv_HasPrefix_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_HasPrefix_Call) Return(_a0 bool, _a1 error) *MockMetaKv_HasPrefix_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_HasPrefix_Call) RunAndReturn(run func(string) (bool, error)) *MockMetaKv_HasPrefix_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Load provides a mock function with given fields: key
|
|
func (_m *MockMetaKv) Load(key string) (string, error) {
|
|
ret := _m.Called(key)
|
|
|
|
var r0 string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (string, error)); ok {
|
|
return rf(key)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) string); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(key)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockMetaKv_Load_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Load'
|
|
type MockMetaKv_Load_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Load is a helper method to define mock.On call
|
|
// - key string
|
|
func (_e *MockMetaKv_Expecter) Load(key interface{}) *MockMetaKv_Load_Call {
|
|
return &MockMetaKv_Load_Call{Call: _e.mock.On("Load", key)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_Load_Call) Run(run func(key string)) *MockMetaKv_Load_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Load_Call) Return(_a0 string, _a1 error) *MockMetaKv_Load_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Load_Call) RunAndReturn(run func(string) (string, error)) *MockMetaKv_Load_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// LoadWithPrefix provides a mock function with given fields: key
|
|
func (_m *MockMetaKv) LoadWithPrefix(key string) ([]string, []string, error) {
|
|
ret := _m.Called(key)
|
|
|
|
var r0 []string
|
|
var r1 []string
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(string) ([]string, []string, error)); ok {
|
|
return rf(key)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) []string); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]string)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) []string); ok {
|
|
r1 = rf(key)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).([]string)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(string) error); ok {
|
|
r2 = rf(key)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// MockMetaKv_LoadWithPrefix_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadWithPrefix'
|
|
type MockMetaKv_LoadWithPrefix_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// LoadWithPrefix is a helper method to define mock.On call
|
|
// - key string
|
|
func (_e *MockMetaKv_Expecter) LoadWithPrefix(key interface{}) *MockMetaKv_LoadWithPrefix_Call {
|
|
return &MockMetaKv_LoadWithPrefix_Call{Call: _e.mock.On("LoadWithPrefix", key)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_LoadWithPrefix_Call) Run(run func(key string)) *MockMetaKv_LoadWithPrefix_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_LoadWithPrefix_Call) Return(_a0 []string, _a1 []string, _a2 error) *MockMetaKv_LoadWithPrefix_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_LoadWithPrefix_Call) RunAndReturn(run func(string) ([]string, []string, error)) *MockMetaKv_LoadWithPrefix_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// MultiLoad provides a mock function with given fields: keys
|
|
func (_m *MockMetaKv) MultiLoad(keys []string) ([]string, error) {
|
|
ret := _m.Called(keys)
|
|
|
|
var r0 []string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func([]string) ([]string, error)); ok {
|
|
return rf(keys)
|
|
}
|
|
if rf, ok := ret.Get(0).(func([]string) []string); ok {
|
|
r0 = rf(keys)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]string)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func([]string) error); ok {
|
|
r1 = rf(keys)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockMetaKv_MultiLoad_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiLoad'
|
|
type MockMetaKv_MultiLoad_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// MultiLoad is a helper method to define mock.On call
|
|
// - keys []string
|
|
func (_e *MockMetaKv_Expecter) MultiLoad(keys interface{}) *MockMetaKv_MultiLoad_Call {
|
|
return &MockMetaKv_MultiLoad_Call{Call: _e.mock.On("MultiLoad", keys)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiLoad_Call) Run(run func(keys []string)) *MockMetaKv_MultiLoad_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].([]string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiLoad_Call) Return(_a0 []string, _a1 error) *MockMetaKv_MultiLoad_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiLoad_Call) RunAndReturn(run func([]string) ([]string, error)) *MockMetaKv_MultiLoad_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// MultiRemove provides a mock function with given fields: keys
|
|
func (_m *MockMetaKv) MultiRemove(keys []string) error {
|
|
ret := _m.Called(keys)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func([]string) error); ok {
|
|
r0 = rf(keys)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_MultiRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiRemove'
|
|
type MockMetaKv_MultiRemove_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// MultiRemove is a helper method to define mock.On call
|
|
// - keys []string
|
|
func (_e *MockMetaKv_Expecter) MultiRemove(keys interface{}) *MockMetaKv_MultiRemove_Call {
|
|
return &MockMetaKv_MultiRemove_Call{Call: _e.mock.On("MultiRemove", keys)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiRemove_Call) Run(run func(keys []string)) *MockMetaKv_MultiRemove_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].([]string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiRemove_Call) Return(_a0 error) *MockMetaKv_MultiRemove_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiRemove_Call) RunAndReturn(run func([]string) error) *MockMetaKv_MultiRemove_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// MultiSave provides a mock function with given fields: kvs
|
|
func (_m *MockMetaKv) MultiSave(kvs map[string]string) error {
|
|
ret := _m.Called(kvs)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(map[string]string) error); ok {
|
|
r0 = rf(kvs)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_MultiSave_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiSave'
|
|
type MockMetaKv_MultiSave_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// MultiSave is a helper method to define mock.On call
|
|
// - kvs map[string]string
|
|
func (_e *MockMetaKv_Expecter) MultiSave(kvs interface{}) *MockMetaKv_MultiSave_Call {
|
|
return &MockMetaKv_MultiSave_Call{Call: _e.mock.On("MultiSave", kvs)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSave_Call) Run(run func(kvs map[string]string)) *MockMetaKv_MultiSave_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(map[string]string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSave_Call) Return(_a0 error) *MockMetaKv_MultiSave_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSave_Call) RunAndReturn(run func(map[string]string) error) *MockMetaKv_MultiSave_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// MultiSaveAndRemove provides a mock function with given fields: saves, removals, preds
|
|
func (_m *MockMetaKv) MultiSaveAndRemove(saves map[string]string, removals []string, preds ...predicates.Predicate) error {
|
|
_va := make([]interface{}, len(preds))
|
|
for _i := range preds {
|
|
_va[_i] = preds[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, saves, removals)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(map[string]string, []string, ...predicates.Predicate) error); ok {
|
|
r0 = rf(saves, removals, preds...)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_MultiSaveAndRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiSaveAndRemove'
|
|
type MockMetaKv_MultiSaveAndRemove_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// MultiSaveAndRemove is a helper method to define mock.On call
|
|
// - saves map[string]string
|
|
// - removals []string
|
|
// - preds ...predicates.Predicate
|
|
func (_e *MockMetaKv_Expecter) MultiSaveAndRemove(saves interface{}, removals interface{}, preds ...interface{}) *MockMetaKv_MultiSaveAndRemove_Call {
|
|
return &MockMetaKv_MultiSaveAndRemove_Call{Call: _e.mock.On("MultiSaveAndRemove",
|
|
append([]interface{}{saves, removals}, preds...)...)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSaveAndRemove_Call) Run(run func(saves map[string]string, removals []string, preds ...predicates.Predicate)) *MockMetaKv_MultiSaveAndRemove_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
variadicArgs := make([]predicates.Predicate, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(predicates.Predicate)
|
|
}
|
|
}
|
|
run(args[0].(map[string]string), args[1].([]string), variadicArgs...)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSaveAndRemove_Call) Return(_a0 error) *MockMetaKv_MultiSaveAndRemove_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSaveAndRemove_Call) RunAndReturn(run func(map[string]string, []string, ...predicates.Predicate) error) *MockMetaKv_MultiSaveAndRemove_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// MultiSaveAndRemoveWithPrefix provides a mock function with given fields: saves, removals, preds
|
|
func (_m *MockMetaKv) MultiSaveAndRemoveWithPrefix(saves map[string]string, removals []string, preds ...predicates.Predicate) error {
|
|
_va := make([]interface{}, len(preds))
|
|
for _i := range preds {
|
|
_va[_i] = preds[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, saves, removals)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(map[string]string, []string, ...predicates.Predicate) error); ok {
|
|
r0 = rf(saves, removals, preds...)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_MultiSaveAndRemoveWithPrefix_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiSaveAndRemoveWithPrefix'
|
|
type MockMetaKv_MultiSaveAndRemoveWithPrefix_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// MultiSaveAndRemoveWithPrefix is a helper method to define mock.On call
|
|
// - saves map[string]string
|
|
// - removals []string
|
|
// - preds ...predicates.Predicate
|
|
func (_e *MockMetaKv_Expecter) MultiSaveAndRemoveWithPrefix(saves interface{}, removals interface{}, preds ...interface{}) *MockMetaKv_MultiSaveAndRemoveWithPrefix_Call {
|
|
return &MockMetaKv_MultiSaveAndRemoveWithPrefix_Call{Call: _e.mock.On("MultiSaveAndRemoveWithPrefix",
|
|
append([]interface{}{saves, removals}, preds...)...)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSaveAndRemoveWithPrefix_Call) Run(run func(saves map[string]string, removals []string, preds ...predicates.Predicate)) *MockMetaKv_MultiSaveAndRemoveWithPrefix_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
variadicArgs := make([]predicates.Predicate, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(predicates.Predicate)
|
|
}
|
|
}
|
|
run(args[0].(map[string]string), args[1].([]string), variadicArgs...)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSaveAndRemoveWithPrefix_Call) Return(_a0 error) *MockMetaKv_MultiSaveAndRemoveWithPrefix_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_MultiSaveAndRemoveWithPrefix_Call) RunAndReturn(run func(map[string]string, []string, ...predicates.Predicate) error) *MockMetaKv_MultiSaveAndRemoveWithPrefix_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Remove provides a mock function with given fields: key
|
|
func (_m *MockMetaKv) Remove(key string) error {
|
|
ret := _m.Called(key)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove'
|
|
type MockMetaKv_Remove_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Remove is a helper method to define mock.On call
|
|
// - key string
|
|
func (_e *MockMetaKv_Expecter) Remove(key interface{}) *MockMetaKv_Remove_Call {
|
|
return &MockMetaKv_Remove_Call{Call: _e.mock.On("Remove", key)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_Remove_Call) Run(run func(key string)) *MockMetaKv_Remove_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Remove_Call) Return(_a0 error) *MockMetaKv_Remove_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Remove_Call) RunAndReturn(run func(string) error) *MockMetaKv_Remove_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// RemoveWithPrefix provides a mock function with given fields: key
|
|
func (_m *MockMetaKv) RemoveWithPrefix(key string) error {
|
|
ret := _m.Called(key)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_RemoveWithPrefix_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveWithPrefix'
|
|
type MockMetaKv_RemoveWithPrefix_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// RemoveWithPrefix is a helper method to define mock.On call
|
|
// - key string
|
|
func (_e *MockMetaKv_Expecter) RemoveWithPrefix(key interface{}) *MockMetaKv_RemoveWithPrefix_Call {
|
|
return &MockMetaKv_RemoveWithPrefix_Call{Call: _e.mock.On("RemoveWithPrefix", key)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_RemoveWithPrefix_Call) Run(run func(key string)) *MockMetaKv_RemoveWithPrefix_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_RemoveWithPrefix_Call) Return(_a0 error) *MockMetaKv_RemoveWithPrefix_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_RemoveWithPrefix_Call) RunAndReturn(run func(string) error) *MockMetaKv_RemoveWithPrefix_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Save provides a mock function with given fields: key, value
|
|
func (_m *MockMetaKv) Save(key string, value string) error {
|
|
ret := _m.Called(key, value)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
r0 = rf(key, value)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
|
|
type MockMetaKv_Save_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Save is a helper method to define mock.On call
|
|
// - key string
|
|
// - value string
|
|
func (_e *MockMetaKv_Expecter) Save(key interface{}, value interface{}) *MockMetaKv_Save_Call {
|
|
return &MockMetaKv_Save_Call{Call: _e.mock.On("Save", key, value)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_Save_Call) Run(run func(key string, value string)) *MockMetaKv_Save_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Save_Call) Return(_a0 error) *MockMetaKv_Save_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_Save_Call) RunAndReturn(run func(string, string) error) *MockMetaKv_Save_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// WalkWithPrefix provides a mock function with given fields: prefix, paginationSize, fn
|
|
func (_m *MockMetaKv) WalkWithPrefix(prefix string, paginationSize int, fn func([]byte, []byte) error) error {
|
|
ret := _m.Called(prefix, paginationSize, fn)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, int, func([]byte, []byte) error) error); ok {
|
|
r0 = rf(prefix, paginationSize, fn)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockMetaKv_WalkWithPrefix_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WalkWithPrefix'
|
|
type MockMetaKv_WalkWithPrefix_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// WalkWithPrefix is a helper method to define mock.On call
|
|
// - prefix string
|
|
// - paginationSize int
|
|
// - fn func([]byte , []byte) error
|
|
func (_e *MockMetaKv_Expecter) WalkWithPrefix(prefix interface{}, paginationSize interface{}, fn interface{}) *MockMetaKv_WalkWithPrefix_Call {
|
|
return &MockMetaKv_WalkWithPrefix_Call{Call: _e.mock.On("WalkWithPrefix", prefix, paginationSize, fn)}
|
|
}
|
|
|
|
func (_c *MockMetaKv_WalkWithPrefix_Call) Run(run func(prefix string, paginationSize int, fn func([]byte, []byte) error)) *MockMetaKv_WalkWithPrefix_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string), args[1].(int), args[2].(func([]byte, []byte) error))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_WalkWithPrefix_Call) Return(_a0 error) *MockMetaKv_WalkWithPrefix_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMetaKv_WalkWithPrefix_Call) RunAndReturn(run func(string, int, func([]byte, []byte) error) error) *MockMetaKv_WalkWithPrefix_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockMetaKv creates a new instance of MockMetaKv. 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 NewMockMetaKv(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockMetaKv {
|
|
mock := &MockMetaKv{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|