```release-note NONE ``` --------- Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Mattermost Build <build@mattermost.com>
226 строки
4.6 KiB
Go
226 строки
4.6 KiB
Go
// Code generated by mockery v2.42.2. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make cache-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
time "time"
|
|
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// Cache is an autogenerated mock type for the Cache type
|
|
type Cache struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Get provides a mock function with given fields: key, value
|
|
func (_m *Cache) Get(key string, value interface{}) error {
|
|
ret := _m.Called(key, value)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, interface{}) error); ok {
|
|
r0 = rf(key, value)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// GetInvalidateClusterEvent provides a mock function with given fields:
|
|
func (_m *Cache) GetInvalidateClusterEvent() model.ClusterEvent {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetInvalidateClusterEvent")
|
|
}
|
|
|
|
var r0 model.ClusterEvent
|
|
if rf, ok := ret.Get(0).(func() model.ClusterEvent); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(model.ClusterEvent)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// GetMulti provides a mock function with given fields: keys, values
|
|
func (_m *Cache) GetMulti(keys []string, values []interface{}) []error {
|
|
ret := _m.Called(keys, values)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetMulti")
|
|
}
|
|
|
|
var r0 []error
|
|
if rf, ok := ret.Get(0).(func([]string, []interface{}) []error); ok {
|
|
r0 = rf(keys, values)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]error)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Keys provides a mock function with given fields:
|
|
func (_m *Cache) Keys() ([]string, error) {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Keys")
|
|
}
|
|
|
|
var r0 []string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func() ([]string, error)); ok {
|
|
return rf()
|
|
}
|
|
if rf, ok := ret.Get(0).(func() []string); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]string)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
r1 = rf()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Name provides a mock function with given fields:
|
|
func (_m *Cache) Name() string {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Name")
|
|
}
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Purge provides a mock function with given fields:
|
|
func (_m *Cache) Purge() error {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Purge")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Remove provides a mock function with given fields: key
|
|
func (_m *Cache) Remove(key string) error {
|
|
ret := _m.Called(key)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Remove")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(key)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Set provides a mock function with given fields: key, value
|
|
func (_m *Cache) Set(key string, value interface{}) error {
|
|
ret := _m.Called(key, value)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Set")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, interface{}) error); ok {
|
|
r0 = rf(key, value)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SetWithDefaultExpiry provides a mock function with given fields: key, value
|
|
func (_m *Cache) SetWithDefaultExpiry(key string, value interface{}) error {
|
|
ret := _m.Called(key, value)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SetWithDefaultExpiry")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, interface{}) error); ok {
|
|
r0 = rf(key, value)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SetWithExpiry provides a mock function with given fields: key, value, ttl
|
|
func (_m *Cache) SetWithExpiry(key string, value interface{}, ttl time.Duration) error {
|
|
ret := _m.Called(key, value, ttl)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SetWithExpiry")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, interface{}, time.Duration) error); ok {
|
|
r0 = rf(key, value, ttl)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NewCache creates a new instance of Cache. 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 NewCache(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *Cache {
|
|
mock := &Cache{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|