[MM-55595] Use annotated logger in search layer (#25468)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5a4dba8809
Коммит
b2ec1ff8ae
@@ -6,6 +6,7 @@ package mocks
|
||||
|
||||
import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
time "time"
|
||||
@@ -16,13 +17,13 @@ type SearchEngineInterface struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// DataRetentionDeleteIndexes provides a mock function with given fields: cutoff
|
||||
func (_m *SearchEngineInterface) DataRetentionDeleteIndexes(cutoff time.Time) *model.AppError {
|
||||
ret := _m.Called(cutoff)
|
||||
// DataRetentionDeleteIndexes provides a mock function with given fields: rctx, cutoff
|
||||
func (_m *SearchEngineInterface) DataRetentionDeleteIndexes(rctx request.CTX, cutoff time.Time) *model.AppError {
|
||||
ret := _m.Called(rctx, cutoff)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(time.Time) *model.AppError); ok {
|
||||
r0 = rf(cutoff)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, time.Time) *model.AppError); ok {
|
||||
r0 = rf(rctx, cutoff)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -48,13 +49,13 @@ func (_m *SearchEngineInterface) DeleteChannel(channel *model.Channel) *model.Ap
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteChannelPosts provides a mock function with given fields: channelID
|
||||
func (_m *SearchEngineInterface) DeleteChannelPosts(channelID string) *model.AppError {
|
||||
ret := _m.Called(channelID)
|
||||
// DeleteChannelPosts provides a mock function with given fields: rctx, channelID
|
||||
func (_m *SearchEngineInterface) DeleteChannelPosts(rctx request.CTX, channelID string) *model.AppError {
|
||||
ret := _m.Called(rctx, channelID)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
r0 = rf(channelID)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
|
||||
r0 = rf(rctx, channelID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -80,13 +81,13 @@ func (_m *SearchEngineInterface) DeleteFile(fileID string) *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteFilesBatch provides a mock function with given fields: endTime, limit
|
||||
func (_m *SearchEngineInterface) DeleteFilesBatch(endTime int64, limit int64) *model.AppError {
|
||||
ret := _m.Called(endTime, limit)
|
||||
// DeleteFilesBatch provides a mock function with given fields: rctx, endTime, limit
|
||||
func (_m *SearchEngineInterface) DeleteFilesBatch(rctx request.CTX, endTime int64, limit int64) *model.AppError {
|
||||
ret := _m.Called(rctx, endTime, limit)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(int64, int64) *model.AppError); ok {
|
||||
r0 = rf(endTime, limit)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64, int64) *model.AppError); ok {
|
||||
r0 = rf(rctx, endTime, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -112,13 +113,13 @@ func (_m *SearchEngineInterface) DeletePost(post *model.Post) *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeletePostFiles provides a mock function with given fields: postID
|
||||
func (_m *SearchEngineInterface) DeletePostFiles(postID string) *model.AppError {
|
||||
ret := _m.Called(postID)
|
||||
// DeletePostFiles provides a mock function with given fields: rctx, postID
|
||||
func (_m *SearchEngineInterface) DeletePostFiles(rctx request.CTX, postID string) *model.AppError {
|
||||
ret := _m.Called(rctx, postID)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
r0 = rf(postID)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
|
||||
r0 = rf(rctx, postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -144,13 +145,13 @@ func (_m *SearchEngineInterface) DeleteUser(user *model.User) *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteUserFiles provides a mock function with given fields: userID
|
||||
func (_m *SearchEngineInterface) DeleteUserFiles(userID string) *model.AppError {
|
||||
ret := _m.Called(userID)
|
||||
// DeleteUserFiles provides a mock function with given fields: rctx, userID
|
||||
func (_m *SearchEngineInterface) DeleteUserFiles(rctx request.CTX, userID string) *model.AppError {
|
||||
ret := _m.Called(rctx, userID)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
r0 = rf(userID)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
|
||||
r0 = rf(rctx, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -160,13 +161,13 @@ func (_m *SearchEngineInterface) DeleteUserFiles(userID string) *model.AppError
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteUserPosts provides a mock function with given fields: userID
|
||||
func (_m *SearchEngineInterface) DeleteUserPosts(userID string) *model.AppError {
|
||||
ret := _m.Called(userID)
|
||||
// DeleteUserPosts provides a mock function with given fields: rctx, userID
|
||||
func (_m *SearchEngineInterface) DeleteUserPosts(rctx request.CTX, userID string) *model.AppError {
|
||||
ret := _m.Called(rctx, userID)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
r0 = rf(userID)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
|
||||
r0 = rf(rctx, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -234,13 +235,13 @@ func (_m *SearchEngineInterface) GetVersion() int {
|
||||
return r0
|
||||
}
|
||||
|
||||
// IndexChannel provides a mock function with given fields: channel, userIDs, teamMemberIDs
|
||||
func (_m *SearchEngineInterface) IndexChannel(channel *model.Channel, userIDs []string, teamMemberIDs []string) *model.AppError {
|
||||
ret := _m.Called(channel, userIDs, teamMemberIDs)
|
||||
// IndexChannel provides a mock function with given fields: rctx, channel, userIDs, teamMemberIDs
|
||||
func (_m *SearchEngineInterface) IndexChannel(rctx request.CTX, channel *model.Channel, userIDs []string, teamMemberIDs []string) *model.AppError {
|
||||
ret := _m.Called(rctx, channel, userIDs, teamMemberIDs)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*model.Channel, []string, []string) *model.AppError); ok {
|
||||
r0 = rf(channel, userIDs, teamMemberIDs)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []string, []string) *model.AppError); ok {
|
||||
r0 = rf(rctx, channel, userIDs, teamMemberIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -282,13 +283,13 @@ func (_m *SearchEngineInterface) IndexPost(post *model.Post, teamId string) *mod
|
||||
return r0
|
||||
}
|
||||
|
||||
// IndexUser provides a mock function with given fields: user, teamsIds, channelsIds
|
||||
func (_m *SearchEngineInterface) IndexUser(user *model.User, teamsIds []string, channelsIds []string) *model.AppError {
|
||||
ret := _m.Called(user, teamsIds, channelsIds)
|
||||
// IndexUser provides a mock function with given fields: rctx, user, teamsIds, channelsIds
|
||||
func (_m *SearchEngineInterface) IndexUser(rctx request.CTX, user *model.User, teamsIds []string, channelsIds []string) *model.AppError {
|
||||
ret := _m.Called(rctx, user, teamsIds, channelsIds)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*model.User, []string, []string) *model.AppError); ok {
|
||||
r0 = rf(user, teamsIds, channelsIds)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, []string, []string) *model.AppError); ok {
|
||||
r0 = rf(rctx, user, teamsIds, channelsIds)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -382,13 +383,13 @@ func (_m *SearchEngineInterface) IsSearchEnabled() bool {
|
||||
return r0
|
||||
}
|
||||
|
||||
// PurgeIndexes provides a mock function with given fields:
|
||||
func (_m *SearchEngineInterface) PurgeIndexes() *model.AppError {
|
||||
ret := _m.Called()
|
||||
// PurgeIndexes provides a mock function with given fields: rctx
|
||||
func (_m *SearchEngineInterface) PurgeIndexes(rctx request.CTX) *model.AppError {
|
||||
ret := _m.Called(rctx)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
|
||||
r0 = rf()
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) *model.AppError); ok {
|
||||
r0 = rf(rctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -398,13 +399,13 @@ func (_m *SearchEngineInterface) PurgeIndexes() *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// RefreshIndexes provides a mock function with given fields:
|
||||
func (_m *SearchEngineInterface) RefreshIndexes() *model.AppError {
|
||||
ret := _m.Called()
|
||||
// RefreshIndexes provides a mock function with given fields: rctx
|
||||
func (_m *SearchEngineInterface) RefreshIndexes(rctx request.CTX) *model.AppError {
|
||||
ret := _m.Called(rctx)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
|
||||
r0 = rf()
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) *model.AppError); ok {
|
||||
r0 = rf(rctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
@@ -604,13 +605,13 @@ func (_m *SearchEngineInterface) Stop() *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// TestConfig provides a mock function with given fields: cfg
|
||||
func (_m *SearchEngineInterface) TestConfig(cfg *model.Config) *model.AppError {
|
||||
ret := _m.Called(cfg)
|
||||
// TestConfig provides a mock function with given fields: rctx, cfg
|
||||
func (_m *SearchEngineInterface) TestConfig(rctx request.CTX, cfg *model.Config) *model.AppError {
|
||||
ret := _m.Called(rctx, cfg)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*model.Config) *model.AppError); ok {
|
||||
r0 = rf(cfg)
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config) *model.AppError); ok {
|
||||
r0 = rf(rctx, cfg)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
|
||||
Ссылка в новой задаче
Block a user