fixed most init errors in channels/store/storetest dir | 24 files edited (#26522)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5dba6e082d
Коммит
71bf7777f5
@@ -2954,7 +2954,7 @@ func (a *App) SearchAllChannels(c request.CTX, term string, opts model.ChannelSe
|
||||
ExcludeGroupConstrained: opts.ExcludeGroupConstrained,
|
||||
PolicyID: opts.PolicyID,
|
||||
IncludePolicyID: opts.IncludePolicyID,
|
||||
IncludeSearchById: opts.IncludeSearchById,
|
||||
IncludeSearchByID: opts.IncludeSearchById,
|
||||
ExcludeRemote: opts.ExcludeRemote,
|
||||
ExcludePolicyConstrained: opts.ExcludePolicyConstrained,
|
||||
Public: opts.Public,
|
||||
|
||||
@@ -2151,7 +2151,7 @@ func (a *App) SetPostReminder(rctx request.CTX, postID, userID string, targetTim
|
||||
CreateAt: model.GetMillis(),
|
||||
UserId: userID,
|
||||
RootId: postID,
|
||||
ChannelId: metadata.ChannelId,
|
||||
ChannelId: metadata.ChannelID,
|
||||
// It's okay to keep this non-translated. This is just a fallback.
|
||||
// The webapp will parse the timestamp and show that in user's local timezone.
|
||||
Message: fmt.Sprintf("You will be reminded about %s by @%s at %s", permalink, metadata.Username, parsedTime),
|
||||
|
||||
@@ -471,7 +471,7 @@ type OpenTracingLayerWebhookStore struct {
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerAuditStore) Get(user_id string, offset int, limit int) (model.Audits, error) {
|
||||
func (s *OpenTracingLayerAuditStore) Get(userID string, offset int, limit int) (model.Audits, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "AuditStore.Get")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -480,7 +480,7 @@ func (s *OpenTracingLayerAuditStore) Get(user_id string, offset int, limit int)
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.AuditStore.Get(user_id, offset, limit)
|
||||
result, err := s.AuditStore.Get(userID, offset, limit)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -1091,7 +1091,7 @@ func (s *OpenTracingLayerChannelStore) GetAllDirectChannelsForExportAfter(limit
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetByName(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetByName(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetByName")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -1100,7 +1100,7 @@ func (s *OpenTracingLayerChannelStore) GetByName(team_id string, name string, al
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelStore.GetByName(team_id, name, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByName(teamID, name, allowFromCache)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -1109,7 +1109,7 @@ func (s *OpenTracingLayerChannelStore) GetByName(team_id string, name string, al
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetByNameIncludeDeleted(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetByNameIncludeDeleted")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -1118,7 +1118,7 @@ func (s *OpenTracingLayerChannelStore) GetByNameIncludeDeleted(team_id string, n
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelStore.GetByNameIncludeDeleted(team_id, name, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNameIncludeDeleted(teamID, name, allowFromCache)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -1127,7 +1127,7 @@ func (s *OpenTracingLayerChannelStore) GetByNameIncludeDeleted(team_id string, n
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetByNames(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetByNames(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetByNames")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -1136,7 +1136,7 @@ func (s *OpenTracingLayerChannelStore) GetByNames(team_id string, names []string
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelStore.GetByNames(team_id, names, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNames(teamID, names, allowFromCache)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -1145,7 +1145,7 @@ func (s *OpenTracingLayerChannelStore) GetByNames(team_id string, names []string
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetByNamesIncludeDeleted(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetByNamesIncludeDeleted(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetByNamesIncludeDeleted")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -1154,7 +1154,7 @@ func (s *OpenTracingLayerChannelStore) GetByNamesIncludeDeleted(team_id string,
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelStore.GetByNamesIncludeDeleted(team_id, names, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNamesIncludeDeleted(teamID, names, allowFromCache)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -1379,7 +1379,7 @@ func (s *OpenTracingLayerChannelStore) GetChannelsWithUnreadsAndWithMentions(ctx
|
||||
return result, resultVar1, resultVar2, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetDeleted(team_id string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetDeleted(teamID string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetDeleted")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -1388,7 +1388,7 @@ func (s *OpenTracingLayerChannelStore) GetDeleted(team_id string, offset int, li
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelStore.GetDeleted(team_id, offset, limit, userID)
|
||||
result, err := s.ChannelStore.GetDeleted(teamID, offset, limit, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -1397,7 +1397,7 @@ func (s *OpenTracingLayerChannelStore) GetDeleted(team_id string, offset int, li
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetDeletedByName(team_id string, name string) (*model.Channel, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetDeletedByName(teamID string, name string) (*model.Channel, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetDeletedByName")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -1406,7 +1406,7 @@ func (s *OpenTracingLayerChannelStore) GetDeletedByName(team_id string, name str
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelStore.GetDeletedByName(team_id, name)
|
||||
result, err := s.ChannelStore.GetDeletedByName(teamID, name)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -2491,7 +2491,7 @@ func (s *OpenTracingLayerChannelStore) SetDeleteAt(channelID string, deleteAt in
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) SetShared(channelId string, shared bool) error {
|
||||
func (s *OpenTracingLayerChannelStore) SetShared(channelID string, shared bool) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.SetShared")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2500,7 +2500,7 @@ func (s *OpenTracingLayerChannelStore) SetShared(channelId string, shared bool)
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.ChannelStore.SetShared(channelId, shared)
|
||||
err := s.ChannelStore.SetShared(channelID, shared)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -2725,7 +2725,7 @@ func (s *OpenTracingLayerChannelStore) UserBelongsToChannels(userID string, chan
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) error {
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) Delete(bookmarkID string, deleteFile bool) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelBookmarkStore.Delete")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2734,7 +2734,7 @@ func (s *OpenTracingLayerChannelBookmarkStore) Delete(bookmarkId string, deleteF
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.ChannelBookmarkStore.Delete(bookmarkId, deleteFile)
|
||||
err := s.ChannelBookmarkStore.Delete(bookmarkID, deleteFile)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -2743,7 +2743,7 @@ func (s *OpenTracingLayerChannelBookmarkStore) Delete(bookmarkId string, deleteF
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileId string) error {
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelBookmarkStore.ErrorIfBookmarkFileInfoAlreadyAttached")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2752,7 +2752,7 @@ func (s *OpenTracingLayerChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAtt
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.ChannelBookmarkStore.ErrorIfBookmarkFileInfoAlreadyAttached(fileId)
|
||||
err := s.ChannelBookmarkStore.ErrorIfBookmarkFileInfoAlreadyAttached(fileID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -2779,7 +2779,7 @@ func (s *OpenTracingLayerChannelBookmarkStore) Get(Id string, includeDeleted boo
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) GetBookmarksForChannelSince(channelId string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) GetBookmarksForChannelSince(channelID string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelBookmarkStore.GetBookmarksForChannelSince")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2788,7 +2788,7 @@ func (s *OpenTracingLayerChannelBookmarkStore) GetBookmarksForChannelSince(chann
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelBookmarkStore.GetBookmarksForChannelSince(channelId, since)
|
||||
result, err := s.ChannelBookmarkStore.GetBookmarksForChannelSince(channelID, since)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -2833,7 +2833,7 @@ func (s *OpenTracingLayerChannelBookmarkStore) Update(bookmark *model.ChannelBoo
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) UpdateSortOrder(bookmarkId string, channelId string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
func (s *OpenTracingLayerChannelBookmarkStore) UpdateSortOrder(bookmarkID string, channelID string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelBookmarkStore.UpdateSortOrder")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -2842,7 +2842,7 @@ func (s *OpenTracingLayerChannelBookmarkStore) UpdateSortOrder(bookmarkId string
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ChannelBookmarkStore.UpdateSortOrder(bookmarkId, channelId, newIndex)
|
||||
result, err := s.ChannelBookmarkStore.UpdateSortOrder(bookmarkID, channelID, newIndex)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -3440,7 +3440,7 @@ func (s *OpenTracingLayerDesktopTokensStore) Delete(token string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerDesktopTokensStore) DeleteByUserId(userId string) error {
|
||||
func (s *OpenTracingLayerDesktopTokensStore) DeleteByUserId(userID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "DesktopTokensStore.DeleteByUserId")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -3449,7 +3449,7 @@ func (s *OpenTracingLayerDesktopTokensStore) DeleteByUserId(userId string) error
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.DesktopTokensStore.DeleteByUserId(userId)
|
||||
err := s.DesktopTokensStore.DeleteByUserId(userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -3494,7 +3494,7 @@ func (s *OpenTracingLayerDesktopTokensStore) GetUserId(token string, minCreatedA
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerDesktopTokensStore) Insert(token string, createAt int64, userId string) error {
|
||||
func (s *OpenTracingLayerDesktopTokensStore) Insert(token string, createAt int64, userID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "DesktopTokensStore.Insert")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -3503,7 +3503,7 @@ func (s *OpenTracingLayerDesktopTokensStore) Insert(token string, createAt int64
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.DesktopTokensStore.Insert(token, createAt, userId)
|
||||
err := s.DesktopTokensStore.Insert(token, createAt, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -3548,7 +3548,7 @@ func (s *OpenTracingLayerDraftStore) DeleteDraftsAssociatedWithPost(channelID st
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
func (s *OpenTracingLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "DraftStore.DeleteEmptyDraftsByCreateAtAndUserId")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -3557,7 +3557,7 @@ func (s *OpenTracingLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(create
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.DraftStore.DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err := s.DraftStore.DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -3566,7 +3566,7 @@ func (s *OpenTracingLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(create
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerDraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
func (s *OpenTracingLayerDraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "DraftStore.DeleteOrphanDraftsByCreateAtAndUserId")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -3575,7 +3575,7 @@ func (s *OpenTracingLayerDraftStore) DeleteOrphanDraftsByCreateAtAndUserId(creat
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.DraftStore.DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err := s.DraftStore.DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -3620,7 +3620,7 @@ func (s *OpenTracingLayerDraftStore) GetDraftsForUser(userID string, teamID stri
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerDraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userId string) (int64, string, error) {
|
||||
func (s *OpenTracingLayerDraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userID string) (int64, string, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "DraftStore.GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -3629,7 +3629,7 @@ func (s *OpenTracingLayerDraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraft
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, resultVar1, err := s.DraftStore.GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
result, resultVar1, err := s.DraftStore.GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -5590,7 +5590,7 @@ func (s *OpenTracingLayerNotifyAdminStore) Get(trial bool) ([]*model.NotifyAdmin
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerNotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
func (s *OpenTracingLayerNotifyAdminStore) GetDataByUserIdAndFeature(userID string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "NotifyAdminStore.GetDataByUserIdAndFeature")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5599,7 +5599,7 @@ func (s *OpenTracingLayerNotifyAdminStore) GetDataByUserIdAndFeature(userId stri
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.NotifyAdminStore.GetDataByUserIdAndFeature(userId, feature)
|
||||
result, err := s.NotifyAdminStore.GetDataByUserIdAndFeature(userID, feature)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -5626,7 +5626,7 @@ func (s *OpenTracingLayerNotifyAdminStore) Save(data *model.NotifyAdminData) (*m
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerNotifyAdminStore) Update(userId string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
func (s *OpenTracingLayerNotifyAdminStore) Update(userID string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "NotifyAdminStore.Update")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5635,7 +5635,7 @@ func (s *OpenTracingLayerNotifyAdminStore) Update(userId string, requiredPlan st
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.NotifyAdminStore.Update(userId, requiredPlan, requiredFeature, now)
|
||||
err := s.NotifyAdminStore.Update(userID, requiredPlan, requiredFeature, now)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -5698,7 +5698,7 @@ func (s *OpenTracingLayerOAuthStore) GetAccessDataByRefreshToken(token string) (
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerOAuthStore) GetAccessDataByUserForApp(userID string, clientId string) ([]*model.AccessData, error) {
|
||||
func (s *OpenTracingLayerOAuthStore) GetAccessDataByUserForApp(userID string, clientID string) ([]*model.AccessData, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "OAuthStore.GetAccessDataByUserForApp")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5707,7 +5707,7 @@ func (s *OpenTracingLayerOAuthStore) GetAccessDataByUserForApp(userID string, cl
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.OAuthStore.GetAccessDataByUserForApp(userID, clientId)
|
||||
result, err := s.OAuthStore.GetAccessDataByUserForApp(userID, clientID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -5806,7 +5806,7 @@ func (s *OpenTracingLayerOAuthStore) GetAuthorizedApps(userID string, offset int
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerOAuthStore) GetPreviousAccessData(userID string, clientId string) (*model.AccessData, error) {
|
||||
func (s *OpenTracingLayerOAuthStore) GetPreviousAccessData(userID string, clientID string) (*model.AccessData, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "OAuthStore.GetPreviousAccessData")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5815,7 +5815,7 @@ func (s *OpenTracingLayerOAuthStore) GetPreviousAccessData(userID string, client
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.OAuthStore.GetPreviousAccessData(userID, clientId)
|
||||
result, err := s.OAuthStore.GetPreviousAccessData(userID, clientID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -5896,7 +5896,7 @@ func (s *OpenTracingLayerOAuthStore) RemoveAuthData(code string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerOAuthStore) RemoveAuthDataByClientId(clientId string, userId string) error {
|
||||
func (s *OpenTracingLayerOAuthStore) RemoveAuthDataByClientId(clientID string, userID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "OAuthStore.RemoveAuthDataByClientId")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5905,7 +5905,7 @@ func (s *OpenTracingLayerOAuthStore) RemoveAuthDataByClientId(clientId string, u
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.OAuthStore.RemoveAuthDataByClientId(clientId, userId)
|
||||
err := s.OAuthStore.RemoveAuthDataByClientId(clientID, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -5914,7 +5914,7 @@ func (s *OpenTracingLayerOAuthStore) RemoveAuthDataByClientId(clientId string, u
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerOAuthStore) RemoveAuthDataByUserId(userId string) error {
|
||||
func (s *OpenTracingLayerOAuthStore) RemoveAuthDataByUserId(userID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "OAuthStore.RemoveAuthDataByUserId")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5923,7 +5923,7 @@ func (s *OpenTracingLayerOAuthStore) RemoveAuthDataByUserId(userId string) error
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.OAuthStore.RemoveAuthDataByUserId(userId)
|
||||
err := s.OAuthStore.RemoveAuthDataByUserId(userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -6395,7 +6395,7 @@ func (s *OpenTracingLayerPostStore) GetDirectPostParentsForExportAfter(limit int
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerPostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error) {
|
||||
func (s *OpenTracingLayerPostStore) GetEditHistoryForPost(postID string) ([]*model.Post, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "PostStore.GetEditHistoryForPost")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -6404,7 +6404,7 @@ func (s *OpenTracingLayerPostStore) GetEditHistoryForPost(postId string) ([]*mod
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.PostStore.GetEditHistoryForPost(postId)
|
||||
result, err := s.PostStore.GetEditHistoryForPost(postID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -6861,7 +6861,7 @@ func (s *OpenTracingLayerPostStore) GetSingle(rctx request.CTX, id string, inclD
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerPostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userId string) (bool, error) {
|
||||
func (s *OpenTracingLayerPostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userID string) (bool, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "PostStore.HasAutoResponsePostByUserSince")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -6870,7 +6870,7 @@ func (s *OpenTracingLayerPostStore) HasAutoResponsePostByUserSince(options model
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.PostStore.HasAutoResponsePostByUserSince(options, userId)
|
||||
result, err := s.PostStore.HasAutoResponsePostByUserSince(options, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -7342,7 +7342,7 @@ func (s *OpenTracingLayerPostPersistentNotificationStore) UpdateLastActivity(pos
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerPostPriorityStore) GetForPost(postId string) (*model.PostPriority, error) {
|
||||
func (s *OpenTracingLayerPostPriorityStore) GetForPost(postID string) (*model.PostPriority, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "PostPriorityStore.GetForPost")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -7351,7 +7351,7 @@ func (s *OpenTracingLayerPostPriorityStore) GetForPost(postId string) (*model.Po
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.PostPriorityStore.GetForPost(postId)
|
||||
result, err := s.PostPriorityStore.GetForPost(postID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -7738,7 +7738,7 @@ func (s *OpenTracingLayerReactionStore) DeleteOrphanedRowsByIds(r *model.Retenti
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerReactionStore) ExistsOnPost(postId string, emojiName string) (bool, error) {
|
||||
func (s *OpenTracingLayerReactionStore) ExistsOnPost(postID string, emojiName string) (bool, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ReactionStore.ExistsOnPost")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -7747,7 +7747,7 @@ func (s *OpenTracingLayerReactionStore) ExistsOnPost(postId string, emojiName st
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ReactionStore.ExistsOnPost(postId, emojiName)
|
||||
result, err := s.ReactionStore.ExistsOnPost(postID, emojiName)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -7774,7 +7774,7 @@ func (s *OpenTracingLayerReactionStore) GetForPost(postID string, allowFromCache
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerReactionStore) GetForPostSince(postId string, since int64, excludeRemoteId string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
func (s *OpenTracingLayerReactionStore) GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ReactionStore.GetForPostSince")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -7783,7 +7783,7 @@ func (s *OpenTracingLayerReactionStore) GetForPostSince(postId string, since int
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ReactionStore.GetForPostSince(postId, since, excludeRemoteId, inclDeleted)
|
||||
result, err := s.ReactionStore.GetForPostSince(postID, since, excludeRemoteID, inclDeleted)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -7810,7 +7810,7 @@ func (s *OpenTracingLayerReactionStore) GetSingle(userID string, postID string,
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerReactionStore) GetUniqueCountForPost(postId string) (int, error) {
|
||||
func (s *OpenTracingLayerReactionStore) GetUniqueCountForPost(postID string) (int, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ReactionStore.GetUniqueCountForPost")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -7819,7 +7819,7 @@ func (s *OpenTracingLayerReactionStore) GetUniqueCountForPost(postId string) (in
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ReactionStore.GetUniqueCountForPost(postId)
|
||||
result, err := s.ReactionStore.GetUniqueCountForPost(postID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -7882,7 +7882,7 @@ func (s *OpenTracingLayerReactionStore) Save(reaction *model.Reaction) (*model.R
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRemoteClusterStore) Delete(remoteClusterId string) (bool, error) {
|
||||
func (s *OpenTracingLayerRemoteClusterStore) Delete(remoteClusterID string) (bool, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RemoteClusterStore.Delete")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -7891,7 +7891,7 @@ func (s *OpenTracingLayerRemoteClusterStore) Delete(remoteClusterId string) (boo
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.RemoteClusterStore.Delete(remoteClusterId)
|
||||
result, err := s.RemoteClusterStore.Delete(remoteClusterID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -7900,7 +7900,7 @@ func (s *OpenTracingLayerRemoteClusterStore) Delete(remoteClusterId string) (boo
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRemoteClusterStore) Get(remoteClusterId string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
func (s *OpenTracingLayerRemoteClusterStore) Get(remoteClusterID string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RemoteClusterStore.Get")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -7909,7 +7909,7 @@ func (s *OpenTracingLayerRemoteClusterStore) Get(remoteClusterId string, include
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.RemoteClusterStore.Get(remoteClusterId, includeDeleted)
|
||||
result, err := s.RemoteClusterStore.Get(remoteClusterID, includeDeleted)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -7972,7 +7972,7 @@ func (s *OpenTracingLayerRemoteClusterStore) Save(rc *model.RemoteCluster) (*mod
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRemoteClusterStore) SetLastPingAt(remoteClusterId string) error {
|
||||
func (s *OpenTracingLayerRemoteClusterStore) SetLastPingAt(remoteClusterID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RemoteClusterStore.SetLastPingAt")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -7981,7 +7981,7 @@ func (s *OpenTracingLayerRemoteClusterStore) SetLastPingAt(remoteClusterId strin
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.RemoteClusterStore.SetLastPingAt(remoteClusterId)
|
||||
err := s.RemoteClusterStore.SetLastPingAt(remoteClusterID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8008,7 +8008,7 @@ func (s *OpenTracingLayerRemoteClusterStore) Update(rc *model.RemoteCluster) (*m
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRemoteClusterStore) UpdateTopics(remoteClusterId string, topics string) (*model.RemoteCluster, error) {
|
||||
func (s *OpenTracingLayerRemoteClusterStore) UpdateTopics(remoteClusterID string, topics string) (*model.RemoteCluster, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RemoteClusterStore.UpdateTopics")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8017,7 +8017,7 @@ func (s *OpenTracingLayerRemoteClusterStore) UpdateTopics(remoteClusterId string
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.RemoteClusterStore.UpdateTopics(remoteClusterId, topics)
|
||||
result, err := s.RemoteClusterStore.UpdateTopics(remoteClusterID, topics)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8026,7 +8026,7 @@ func (s *OpenTracingLayerRemoteClusterStore) UpdateTopics(remoteClusterId string
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) AddChannels(policyId string, channelIds []string) error {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) AddChannels(policyID string, channelIds []string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.AddChannels")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8035,7 +8035,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) AddChannels(policyId string, chan
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.RetentionPolicyStore.AddChannels(policyId, channelIds)
|
||||
err := s.RetentionPolicyStore.AddChannels(policyID, channelIds)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8044,7 +8044,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) AddChannels(policyId string, chan
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) AddTeams(policyId string, teamIds []string) error {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) AddTeams(policyID string, teamIds []string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.AddTeams")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8053,7 +8053,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) AddTeams(policyId string, teamIds
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.RetentionPolicyStore.AddTeams(policyId, teamIds)
|
||||
err := s.RetentionPolicyStore.AddTeams(policyID, teamIds)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8170,7 +8170,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetChannelPoliciesForUser(userID
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetChannels(policyId string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetChannels(policyID string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.GetChannels")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8179,7 +8179,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetChannels(policyId string, offs
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.RetentionPolicyStore.GetChannels(policyId, offset, limit)
|
||||
result, err := s.RetentionPolicyStore.GetChannels(policyID, offset, limit)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8188,7 +8188,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetChannels(policyId string, offs
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetChannelsCount(policyId string) (int64, error) {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetChannelsCount(policyID string) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.GetChannelsCount")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8197,7 +8197,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetChannelsCount(policyId string)
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.RetentionPolicyStore.GetChannelsCount(policyId)
|
||||
result, err := s.RetentionPolicyStore.GetChannelsCount(policyID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8278,7 +8278,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetTeamPoliciesForUser(userID str
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetTeams(policyId string, offset int, limit int) ([]*model.Team, error) {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetTeams(policyID string, offset int, limit int) ([]*model.Team, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.GetTeams")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8287,7 +8287,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetTeams(policyId string, offset
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.RetentionPolicyStore.GetTeams(policyId, offset, limit)
|
||||
result, err := s.RetentionPolicyStore.GetTeams(policyID, offset, limit)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8296,7 +8296,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetTeams(policyId string, offset
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetTeamsCount(policyId string) (int64, error) {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) GetTeamsCount(policyID string) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.GetTeamsCount")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8305,7 +8305,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) GetTeamsCount(policyId string) (i
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.RetentionPolicyStore.GetTeamsCount(policyId)
|
||||
result, err := s.RetentionPolicyStore.GetTeamsCount(policyID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8332,7 +8332,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) Patch(patch *model.RetentionPolic
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) RemoveChannels(policyId string, channelIds []string) error {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) RemoveChannels(policyID string, channelIds []string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.RemoveChannels")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8341,7 +8341,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) RemoveChannels(policyId string, c
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.RetentionPolicyStore.RemoveChannels(policyId, channelIds)
|
||||
err := s.RetentionPolicyStore.RemoveChannels(policyID, channelIds)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -8350,7 +8350,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) RemoveChannels(policyId string, c
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) RemoveTeams(policyId string, teamIds []string) error {
|
||||
func (s *OpenTracingLayerRetentionPolicyStore) RemoveTeams(policyID string, teamIds []string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "RetentionPolicyStore.RemoveTeams")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8359,7 +8359,7 @@ func (s *OpenTracingLayerRetentionPolicyStore) RemoveTeams(policyId string, team
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.RetentionPolicyStore.RemoveTeams(policyId, teamIds)
|
||||
err := s.RetentionPolicyStore.RemoveTeams(policyID, teamIds)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9034,7 +9034,7 @@ func (s *OpenTracingLayerSessionStore) UpdateRoles(userID string, roles string)
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) Delete(channelID string) (bool, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.Delete")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9043,7 +9043,7 @@ func (s *OpenTracingLayerSharedChannelStore) Delete(channelId string) (bool, err
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.Delete(channelId)
|
||||
result, err := s.SharedChannelStore.Delete(channelID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9052,7 +9052,7 @@ func (s *OpenTracingLayerSharedChannelStore) Delete(channelId string) (bool, err
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) DeleteRemote(remoteId string) (bool, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) DeleteRemote(remoteID string) (bool, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.DeleteRemote")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9061,7 +9061,7 @@ func (s *OpenTracingLayerSharedChannelStore) DeleteRemote(remoteId string) (bool
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.DeleteRemote(remoteId)
|
||||
result, err := s.SharedChannelStore.DeleteRemote(remoteID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9070,7 +9070,7 @@ func (s *OpenTracingLayerSharedChannelStore) DeleteRemote(remoteId string) (bool
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) Get(channelId string) (*model.SharedChannel, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) Get(channelID string) (*model.SharedChannel, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.Get")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9079,7 +9079,7 @@ func (s *OpenTracingLayerSharedChannelStore) Get(channelId string) (*model.Share
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.Get(channelId)
|
||||
result, err := s.SharedChannelStore.Get(channelID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9124,7 +9124,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetAllCount(opts model.SharedChanne
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetAttachment(fileId string, remoteId string) (*model.SharedChannelAttachment, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetAttachment(fileID string, remoteID string) (*model.SharedChannelAttachment, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.GetAttachment")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9133,7 +9133,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetAttachment(fileId string, remote
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.GetAttachment(fileId, remoteId)
|
||||
result, err := s.SharedChannelStore.GetAttachment(fileID, remoteID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9160,7 +9160,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetRemote(id string) (*model.Shared
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetRemoteByIds(channelId string, remoteId string) (*model.SharedChannelRemote, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.GetRemoteByIds")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9169,7 +9169,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetRemoteByIds(channelId string, re
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.GetRemoteByIds(channelId, remoteId)
|
||||
result, err := s.SharedChannelStore.GetRemoteByIds(channelID, remoteID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9178,7 +9178,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetRemoteByIds(channelId string, re
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetRemoteForUser(remoteId string, userId string) (*model.RemoteCluster, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetRemoteForUser(remoteID string, userID string) (*model.RemoteCluster, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.GetRemoteForUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9187,7 +9187,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetRemoteForUser(remoteId string, u
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.GetRemoteForUser(remoteId, userId)
|
||||
result, err := s.SharedChannelStore.GetRemoteForUser(remoteID, userID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9214,7 +9214,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetRemotes(offset int, limit int, o
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetRemotesStatus(channelId string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) GetRemotesStatus(channelID string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.GetRemotesStatus")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9223,7 +9223,7 @@ func (s *OpenTracingLayerSharedChannelStore) GetRemotesStatus(channelId string)
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.GetRemotesStatus(channelId)
|
||||
result, err := s.SharedChannelStore.GetRemotesStatus(channelID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -9304,7 +9304,7 @@ func (s *OpenTracingLayerSharedChannelStore) HasChannel(channelID string) (bool,
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSharedChannelStore) HasRemote(channelID string, remoteId string) (bool, error) {
|
||||
func (s *OpenTracingLayerSharedChannelStore) HasRemote(channelID string, remoteID string) (bool, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SharedChannelStore.HasRemote")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9313,7 +9313,7 @@ func (s *OpenTracingLayerSharedChannelStore) HasRemote(channelID string, remoteI
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.SharedChannelStore.HasRemote(channelID, remoteId)
|
||||
result, err := s.SharedChannelStore.HasRemote(channelID, remoteID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -10734,7 +10734,7 @@ func (s *OpenTracingLayerTermsOfServiceStore) Save(termsOfService *model.TermsOf
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) DeleteMembershipForUser(userId string, postID string) error {
|
||||
func (s *OpenTracingLayerThreadStore) DeleteMembershipForUser(userID string, postID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.DeleteMembershipForUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -10743,7 +10743,7 @@ func (s *OpenTracingLayerThreadStore) DeleteMembershipForUser(userId string, pos
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.ThreadStore.DeleteMembershipForUser(userId, postID)
|
||||
err := s.ThreadStore.DeleteMembershipForUser(userID, postID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -10806,7 +10806,7 @@ func (s *OpenTracingLayerThreadStore) Get(id string) (*model.Thread, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) GetMembershipForUser(userId string, postID string) (*model.ThreadMembership, error) {
|
||||
func (s *OpenTracingLayerThreadStore) GetMembershipForUser(userID string, postID string) (*model.ThreadMembership, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.GetMembershipForUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -10815,7 +10815,7 @@ func (s *OpenTracingLayerThreadStore) GetMembershipForUser(userId string, postID
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ThreadStore.GetMembershipForUser(userId, postID)
|
||||
result, err := s.ThreadStore.GetMembershipForUser(userID, postID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -10824,7 +10824,7 @@ func (s *OpenTracingLayerThreadStore) GetMembershipForUser(userId string, postID
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
func (s *OpenTracingLayerThreadStore) GetMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.GetMembershipsForUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -10833,7 +10833,7 @@ func (s *OpenTracingLayerThreadStore) GetMembershipsForUser(userId string, teamI
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ThreadStore.GetMembershipsForUser(userId, teamID)
|
||||
result, err := s.ThreadStore.GetMembershipsForUser(userID, teamID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -10932,7 +10932,7 @@ func (s *OpenTracingLayerThreadStore) GetThreadUnreadReplyCount(threadMembership
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) GetThreadsForUser(userId string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
func (s *OpenTracingLayerThreadStore) GetThreadsForUser(userID string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.GetThreadsForUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -10941,7 +10941,7 @@ func (s *OpenTracingLayerThreadStore) GetThreadsForUser(userId string, teamID st
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ThreadStore.GetThreadsForUser(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetThreadsForUser(userID, teamID, opts)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -10950,7 +10950,7 @@ func (s *OpenTracingLayerThreadStore) GetThreadsForUser(userId string, teamID st
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.GetTotalThreads")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -10959,7 +10959,7 @@ func (s *OpenTracingLayerThreadStore) GetTotalThreads(userId string, teamID stri
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ThreadStore.GetTotalThreads(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalThreads(userID, teamID, opts)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -10968,7 +10968,7 @@ func (s *OpenTracingLayerThreadStore) GetTotalThreads(userId string, teamID stri
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalUnreadMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalUnreadMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.GetTotalUnreadMentions")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -10977,7 +10977,7 @@ func (s *OpenTracingLayerThreadStore) GetTotalUnreadMentions(userId string, team
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ThreadStore.GetTotalUnreadMentions(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadMentions(userID, teamID, opts)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -10986,7 +10986,7 @@ func (s *OpenTracingLayerThreadStore) GetTotalUnreadMentions(userId string, team
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalUnreadThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalUnreadThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.GetTotalUnreadThreads")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -10995,7 +10995,7 @@ func (s *OpenTracingLayerThreadStore) GetTotalUnreadThreads(userId string, teamI
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ThreadStore.GetTotalUnreadThreads(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadThreads(userID, teamID, opts)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -11004,7 +11004,7 @@ func (s *OpenTracingLayerThreadStore) GetTotalUnreadThreads(userId string, teamI
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalUnreadUrgentMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *OpenTracingLayerThreadStore) GetTotalUnreadUrgentMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ThreadStore.GetTotalUnreadUrgentMentions")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -11013,7 +11013,7 @@ func (s *OpenTracingLayerThreadStore) GetTotalUnreadUrgentMentions(userId string
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.ThreadStore.GetTotalUnreadUrgentMentions(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadUrgentMentions(userID, teamID, opts)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -11696,7 +11696,7 @@ func (s *OpenTracingLayerUserStore) GetAllProfiles(options *model.UserGetOptions
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerUserStore) GetAllProfilesInChannel(rctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
func (s *OpenTracingLayerUserStore) GetAllProfilesInChannel(ctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAllProfilesInChannel")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -11705,7 +11705,7 @@ func (s *OpenTracingLayerUserStore) GetAllProfilesInChannel(rctx context.Context
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.UserStore.GetAllProfilesInChannel(rctx, channelID, allowFromCache)
|
||||
result, err := s.UserStore.GetAllProfilesInChannel(ctx, channelID, allowFromCache)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -12095,7 +12095,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesInChannelByStatus(options *model.
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerUserStore) GetProfilesNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
func (s *OpenTracingLayerUserStore) GetProfilesNotInChannel(teamID string, channelID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfilesNotInChannel")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -12104,7 +12104,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesNotInChannel(teamID string, chann
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
result, err := s.UserStore.GetProfilesNotInChannel(teamID, channelId, groupConstrained, offset, limit, viewRestrictions)
|
||||
result, err := s.UserStore.GetProfilesNotInChannel(teamID, channelID, groupConstrained, offset, limit, viewRestrictions)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
@@ -13034,7 +13034,7 @@ func (s *OpenTracingLayerUserAccessTokenStore) UpdateTokenEnable(tokenID string)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerUserTermsOfServiceStore) Delete(userID string, termsOfServiceId string) error {
|
||||
func (s *OpenTracingLayerUserTermsOfServiceStore) Delete(userID string, termsOfServiceID string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserTermsOfServiceStore.Delete")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -13043,7 +13043,7 @@ func (s *OpenTracingLayerUserTermsOfServiceStore) Delete(userID string, termsOfS
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
err := s.UserTermsOfServiceStore.Delete(userID, termsOfServiceId)
|
||||
err := s.UserTermsOfServiceStore.Delete(userID, termsOfServiceID)
|
||||
if err != nil {
|
||||
span.LogFields(spanlog.Error(err))
|
||||
ext.Error.Set(span, true)
|
||||
|
||||
@@ -491,11 +491,11 @@ func isRepeatableError(err error) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *RetryLayerAuditStore) Get(user_id string, offset int, limit int) (model.Audits, error) {
|
||||
func (s *RetryLayerAuditStore) Get(userID string, offset int, limit int) (model.Audits, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.AuditStore.Get(user_id, offset, limit)
|
||||
result, err := s.AuditStore.Get(userID, offset, limit)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -1196,11 +1196,11 @@ func (s *RetryLayerChannelStore) GetAllDirectChannelsForExportAfter(limit int, a
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelStore) GetByName(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
func (s *RetryLayerChannelStore) GetByName(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelStore.GetByName(team_id, name, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByName(teamID, name, allowFromCache)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -1217,11 +1217,11 @@ func (s *RetryLayerChannelStore) GetByName(team_id string, name string, allowFro
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelStore) GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
func (s *RetryLayerChannelStore) GetByNameIncludeDeleted(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelStore.GetByNameIncludeDeleted(team_id, name, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNameIncludeDeleted(teamID, name, allowFromCache)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -1238,11 +1238,11 @@ func (s *RetryLayerChannelStore) GetByNameIncludeDeleted(team_id string, name st
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelStore) GetByNames(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
func (s *RetryLayerChannelStore) GetByNames(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelStore.GetByNames(team_id, names, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNames(teamID, names, allowFromCache)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -1259,11 +1259,11 @@ func (s *RetryLayerChannelStore) GetByNames(team_id string, names []string, allo
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelStore) GetByNamesIncludeDeleted(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
func (s *RetryLayerChannelStore) GetByNamesIncludeDeleted(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelStore.GetByNamesIncludeDeleted(team_id, names, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNamesIncludeDeleted(teamID, names, allowFromCache)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -1532,11 +1532,11 @@ func (s *RetryLayerChannelStore) GetChannelsWithUnreadsAndWithMentions(ctx conte
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelStore) GetDeleted(team_id string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
func (s *RetryLayerChannelStore) GetDeleted(teamID string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelStore.GetDeleted(team_id, offset, limit, userID)
|
||||
result, err := s.ChannelStore.GetDeleted(teamID, offset, limit, userID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -1553,11 +1553,11 @@ func (s *RetryLayerChannelStore) GetDeleted(team_id string, offset int, limit in
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelStore) GetDeletedByName(team_id string, name string) (*model.Channel, error) {
|
||||
func (s *RetryLayerChannelStore) GetDeletedByName(teamID string, name string) (*model.Channel, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelStore.GetDeletedByName(team_id, name)
|
||||
result, err := s.ChannelStore.GetDeletedByName(teamID, name)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -2756,11 +2756,11 @@ func (s *RetryLayerChannelStore) SetDeleteAt(channelID string, deleteAt int64, u
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelStore) SetShared(channelId string, shared bool) error {
|
||||
func (s *RetryLayerChannelStore) SetShared(channelID string, shared bool) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.ChannelStore.SetShared(channelId, shared)
|
||||
err := s.ChannelStore.SetShared(channelID, shared)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -3029,11 +3029,11 @@ func (s *RetryLayerChannelStore) UserBelongsToChannels(userID string, channelIds
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) error {
|
||||
func (s *RetryLayerChannelBookmarkStore) Delete(bookmarkID string, deleteFile bool) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.ChannelBookmarkStore.Delete(bookmarkId, deleteFile)
|
||||
err := s.ChannelBookmarkStore.Delete(bookmarkID, deleteFile)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -3050,11 +3050,11 @@ func (s *RetryLayerChannelBookmarkStore) Delete(bookmarkId string, deleteFile bo
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileId string) error {
|
||||
func (s *RetryLayerChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.ChannelBookmarkStore.ErrorIfBookmarkFileInfoAlreadyAttached(fileId)
|
||||
err := s.ChannelBookmarkStore.ErrorIfBookmarkFileInfoAlreadyAttached(fileID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -3092,11 +3092,11 @@ func (s *RetryLayerChannelBookmarkStore) Get(Id string, includeDeleted bool) (*m
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelBookmarkStore) GetBookmarksForChannelSince(channelId string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
func (s *RetryLayerChannelBookmarkStore) GetBookmarksForChannelSince(channelID string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelBookmarkStore.GetBookmarksForChannelSince(channelId, since)
|
||||
result, err := s.ChannelBookmarkStore.GetBookmarksForChannelSince(channelID, since)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -3155,11 +3155,11 @@ func (s *RetryLayerChannelBookmarkStore) Update(bookmark *model.ChannelBookmark)
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerChannelBookmarkStore) UpdateSortOrder(bookmarkId string, channelId string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
func (s *RetryLayerChannelBookmarkStore) UpdateSortOrder(bookmarkID string, channelID string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ChannelBookmarkStore.UpdateSortOrder(bookmarkId, channelId, newIndex)
|
||||
result, err := s.ChannelBookmarkStore.UpdateSortOrder(bookmarkID, channelID, newIndex)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -3854,11 +3854,11 @@ func (s *RetryLayerDesktopTokensStore) Delete(token string) error {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerDesktopTokensStore) DeleteByUserId(userId string) error {
|
||||
func (s *RetryLayerDesktopTokensStore) DeleteByUserId(userID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.DesktopTokensStore.DeleteByUserId(userId)
|
||||
err := s.DesktopTokensStore.DeleteByUserId(userID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -3917,11 +3917,11 @@ func (s *RetryLayerDesktopTokensStore) GetUserId(token string, minCreatedAt int6
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerDesktopTokensStore) Insert(token string, createAt int64, userId string) error {
|
||||
func (s *RetryLayerDesktopTokensStore) Insert(token string, createAt int64, userID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.DesktopTokensStore.Insert(token, createAt, userId)
|
||||
err := s.DesktopTokensStore.Insert(token, createAt, userID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -3980,11 +3980,11 @@ func (s *RetryLayerDraftStore) DeleteDraftsAssociatedWithPost(channelID string,
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
func (s *RetryLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.DraftStore.DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err := s.DraftStore.DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -4001,11 +4001,11 @@ func (s *RetryLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerDraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
func (s *RetryLayerDraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.DraftStore.DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err := s.DraftStore.DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -4064,11 +4064,11 @@ func (s *RetryLayerDraftStore) GetDraftsForUser(userID string, teamID string) ([
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerDraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userId string) (int64, string, error) {
|
||||
func (s *RetryLayerDraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userID string) (int64, string, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, resultVar1, err := s.DraftStore.GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
result, resultVar1, err := s.DraftStore.GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
if err == nil {
|
||||
return result, resultVar1, nil
|
||||
}
|
||||
@@ -6344,11 +6344,11 @@ func (s *RetryLayerNotifyAdminStore) Get(trial bool) ([]*model.NotifyAdminData,
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerNotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
func (s *RetryLayerNotifyAdminStore) GetDataByUserIdAndFeature(userID string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.NotifyAdminStore.GetDataByUserIdAndFeature(userId, feature)
|
||||
result, err := s.NotifyAdminStore.GetDataByUserIdAndFeature(userID, feature)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -6386,11 +6386,11 @@ func (s *RetryLayerNotifyAdminStore) Save(data *model.NotifyAdminData) (*model.N
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerNotifyAdminStore) Update(userId string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
func (s *RetryLayerNotifyAdminStore) Update(userID string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.NotifyAdminStore.Update(userId, requiredPlan, requiredFeature, now)
|
||||
err := s.NotifyAdminStore.Update(userID, requiredPlan, requiredFeature, now)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -6470,11 +6470,11 @@ func (s *RetryLayerOAuthStore) GetAccessDataByRefreshToken(token string) (*model
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerOAuthStore) GetAccessDataByUserForApp(userID string, clientId string) ([]*model.AccessData, error) {
|
||||
func (s *RetryLayerOAuthStore) GetAccessDataByUserForApp(userID string, clientID string) ([]*model.AccessData, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.OAuthStore.GetAccessDataByUserForApp(userID, clientId)
|
||||
result, err := s.OAuthStore.GetAccessDataByUserForApp(userID, clientID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -6596,11 +6596,11 @@ func (s *RetryLayerOAuthStore) GetAuthorizedApps(userID string, offset int, limi
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerOAuthStore) GetPreviousAccessData(userID string, clientId string) (*model.AccessData, error) {
|
||||
func (s *RetryLayerOAuthStore) GetPreviousAccessData(userID string, clientID string) (*model.AccessData, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.OAuthStore.GetPreviousAccessData(userID, clientId)
|
||||
result, err := s.OAuthStore.GetPreviousAccessData(userID, clientID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -6701,11 +6701,11 @@ func (s *RetryLayerOAuthStore) RemoveAuthData(code string) error {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerOAuthStore) RemoveAuthDataByClientId(clientId string, userId string) error {
|
||||
func (s *RetryLayerOAuthStore) RemoveAuthDataByClientId(clientID string, userID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.OAuthStore.RemoveAuthDataByClientId(clientId, userId)
|
||||
err := s.OAuthStore.RemoveAuthDataByClientId(clientID, userID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -6722,11 +6722,11 @@ func (s *RetryLayerOAuthStore) RemoveAuthDataByClientId(clientId string, userId
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerOAuthStore) RemoveAuthDataByUserId(userId string) error {
|
||||
func (s *RetryLayerOAuthStore) RemoveAuthDataByUserId(userID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.OAuthStore.RemoveAuthDataByUserId(userId)
|
||||
err := s.OAuthStore.RemoveAuthDataByUserId(userID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -7274,11 +7274,11 @@ func (s *RetryLayerPostStore) GetDirectPostParentsForExportAfter(limit int, afte
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerPostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error) {
|
||||
func (s *RetryLayerPostStore) GetEditHistoryForPost(postID string) ([]*model.Post, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.PostStore.GetEditHistoryForPost(postId)
|
||||
result, err := s.PostStore.GetEditHistoryForPost(postID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -7790,11 +7790,11 @@ func (s *RetryLayerPostStore) GetSingle(rctx request.CTX, id string, inclDeleted
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerPostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userId string) (bool, error) {
|
||||
func (s *RetryLayerPostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userID string) (bool, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.PostStore.HasAutoResponsePostByUserSince(options, userId)
|
||||
result, err := s.PostStore.HasAutoResponsePostByUserSince(options, userID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -8342,11 +8342,11 @@ func (s *RetryLayerPostPersistentNotificationStore) UpdateLastActivity(postIds [
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerPostPriorityStore) GetForPost(postId string) (*model.PostPriority, error) {
|
||||
func (s *RetryLayerPostPriorityStore) GetForPost(postID string) (*model.PostPriority, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.PostPriorityStore.GetForPost(postId)
|
||||
result, err := s.PostPriorityStore.GetForPost(postID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -8804,11 +8804,11 @@ func (s *RetryLayerReactionStore) DeleteOrphanedRowsByIds(r *model.RetentionIdsF
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerReactionStore) ExistsOnPost(postId string, emojiName string) (bool, error) {
|
||||
func (s *RetryLayerReactionStore) ExistsOnPost(postID string, emojiName string) (bool, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ReactionStore.ExistsOnPost(postId, emojiName)
|
||||
result, err := s.ReactionStore.ExistsOnPost(postID, emojiName)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -8846,11 +8846,11 @@ func (s *RetryLayerReactionStore) GetForPost(postID string, allowFromCache bool)
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerReactionStore) GetForPostSince(postId string, since int64, excludeRemoteId string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
func (s *RetryLayerReactionStore) GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ReactionStore.GetForPostSince(postId, since, excludeRemoteId, inclDeleted)
|
||||
result, err := s.ReactionStore.GetForPostSince(postID, since, excludeRemoteID, inclDeleted)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -8888,11 +8888,11 @@ func (s *RetryLayerReactionStore) GetSingle(userID string, postID string, remote
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerReactionStore) GetUniqueCountForPost(postId string) (int, error) {
|
||||
func (s *RetryLayerReactionStore) GetUniqueCountForPost(postID string) (int, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ReactionStore.GetUniqueCountForPost(postId)
|
||||
result, err := s.ReactionStore.GetUniqueCountForPost(postID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -8972,11 +8972,11 @@ func (s *RetryLayerReactionStore) Save(reaction *model.Reaction) (*model.Reactio
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRemoteClusterStore) Delete(remoteClusterId string) (bool, error) {
|
||||
func (s *RetryLayerRemoteClusterStore) Delete(remoteClusterID string) (bool, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.RemoteClusterStore.Delete(remoteClusterId)
|
||||
result, err := s.RemoteClusterStore.Delete(remoteClusterID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -8993,11 +8993,11 @@ func (s *RetryLayerRemoteClusterStore) Delete(remoteClusterId string) (bool, err
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRemoteClusterStore) Get(remoteClusterId string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
func (s *RetryLayerRemoteClusterStore) Get(remoteClusterID string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.RemoteClusterStore.Get(remoteClusterId, includeDeleted)
|
||||
result, err := s.RemoteClusterStore.Get(remoteClusterID, includeDeleted)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -9077,11 +9077,11 @@ func (s *RetryLayerRemoteClusterStore) Save(rc *model.RemoteCluster) (*model.Rem
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRemoteClusterStore) SetLastPingAt(remoteClusterId string) error {
|
||||
func (s *RetryLayerRemoteClusterStore) SetLastPingAt(remoteClusterID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.RemoteClusterStore.SetLastPingAt(remoteClusterId)
|
||||
err := s.RemoteClusterStore.SetLastPingAt(remoteClusterID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -9119,11 +9119,11 @@ func (s *RetryLayerRemoteClusterStore) Update(rc *model.RemoteCluster) (*model.R
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRemoteClusterStore) UpdateTopics(remoteClusterId string, topics string) (*model.RemoteCluster, error) {
|
||||
func (s *RetryLayerRemoteClusterStore) UpdateTopics(remoteClusterID string, topics string) (*model.RemoteCluster, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.RemoteClusterStore.UpdateTopics(remoteClusterId, topics)
|
||||
result, err := s.RemoteClusterStore.UpdateTopics(remoteClusterID, topics)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -9140,11 +9140,11 @@ func (s *RetryLayerRemoteClusterStore) UpdateTopics(remoteClusterId string, topi
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) AddChannels(policyId string, channelIds []string) error {
|
||||
func (s *RetryLayerRetentionPolicyStore) AddChannels(policyID string, channelIds []string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.RetentionPolicyStore.AddChannels(policyId, channelIds)
|
||||
err := s.RetentionPolicyStore.AddChannels(policyID, channelIds)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -9161,11 +9161,11 @@ func (s *RetryLayerRetentionPolicyStore) AddChannels(policyId string, channelIds
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) AddTeams(policyId string, teamIds []string) error {
|
||||
func (s *RetryLayerRetentionPolicyStore) AddTeams(policyID string, teamIds []string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.RetentionPolicyStore.AddTeams(policyId, teamIds)
|
||||
err := s.RetentionPolicyStore.AddTeams(policyID, teamIds)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -9308,11 +9308,11 @@ func (s *RetryLayerRetentionPolicyStore) GetChannelPoliciesForUser(userID string
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) GetChannels(policyId string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
func (s *RetryLayerRetentionPolicyStore) GetChannels(policyID string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.RetentionPolicyStore.GetChannels(policyId, offset, limit)
|
||||
result, err := s.RetentionPolicyStore.GetChannels(policyID, offset, limit)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -9329,11 +9329,11 @@ func (s *RetryLayerRetentionPolicyStore) GetChannels(policyId string, offset int
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) GetChannelsCount(policyId string) (int64, error) {
|
||||
func (s *RetryLayerRetentionPolicyStore) GetChannelsCount(policyID string) (int64, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.RetentionPolicyStore.GetChannelsCount(policyId)
|
||||
result, err := s.RetentionPolicyStore.GetChannelsCount(policyID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -9434,11 +9434,11 @@ func (s *RetryLayerRetentionPolicyStore) GetTeamPoliciesForUser(userID string, o
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) GetTeams(policyId string, offset int, limit int) ([]*model.Team, error) {
|
||||
func (s *RetryLayerRetentionPolicyStore) GetTeams(policyID string, offset int, limit int) ([]*model.Team, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.RetentionPolicyStore.GetTeams(policyId, offset, limit)
|
||||
result, err := s.RetentionPolicyStore.GetTeams(policyID, offset, limit)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -9455,11 +9455,11 @@ func (s *RetryLayerRetentionPolicyStore) GetTeams(policyId string, offset int, l
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) GetTeamsCount(policyId string) (int64, error) {
|
||||
func (s *RetryLayerRetentionPolicyStore) GetTeamsCount(policyID string) (int64, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.RetentionPolicyStore.GetTeamsCount(policyId)
|
||||
result, err := s.RetentionPolicyStore.GetTeamsCount(policyID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -9497,11 +9497,11 @@ func (s *RetryLayerRetentionPolicyStore) Patch(patch *model.RetentionPolicyWithT
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) RemoveChannels(policyId string, channelIds []string) error {
|
||||
func (s *RetryLayerRetentionPolicyStore) RemoveChannels(policyID string, channelIds []string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.RetentionPolicyStore.RemoveChannels(policyId, channelIds)
|
||||
err := s.RetentionPolicyStore.RemoveChannels(policyID, channelIds)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -9518,11 +9518,11 @@ func (s *RetryLayerRetentionPolicyStore) RemoveChannels(policyId string, channel
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerRetentionPolicyStore) RemoveTeams(policyId string, teamIds []string) error {
|
||||
func (s *RetryLayerRetentionPolicyStore) RemoveTeams(policyID string, teamIds []string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.RetentionPolicyStore.RemoveTeams(policyId, teamIds)
|
||||
err := s.RetentionPolicyStore.RemoveTeams(policyID, teamIds)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -10316,11 +10316,11 @@ func (s *RetryLayerSessionStore) UpdateRoles(userID string, roles string) (strin
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
func (s *RetryLayerSharedChannelStore) Delete(channelID string) (bool, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.Delete(channelId)
|
||||
result, err := s.SharedChannelStore.Delete(channelID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -10337,11 +10337,11 @@ func (s *RetryLayerSharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) DeleteRemote(remoteId string) (bool, error) {
|
||||
func (s *RetryLayerSharedChannelStore) DeleteRemote(remoteID string) (bool, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.DeleteRemote(remoteId)
|
||||
result, err := s.SharedChannelStore.DeleteRemote(remoteID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -10358,11 +10358,11 @@ func (s *RetryLayerSharedChannelStore) DeleteRemote(remoteId string) (bool, erro
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) Get(channelId string) (*model.SharedChannel, error) {
|
||||
func (s *RetryLayerSharedChannelStore) Get(channelID string) (*model.SharedChannel, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.Get(channelId)
|
||||
result, err := s.SharedChannelStore.Get(channelID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -10421,11 +10421,11 @@ func (s *RetryLayerSharedChannelStore) GetAllCount(opts model.SharedChannelFilte
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) GetAttachment(fileId string, remoteId string) (*model.SharedChannelAttachment, error) {
|
||||
func (s *RetryLayerSharedChannelStore) GetAttachment(fileID string, remoteID string) (*model.SharedChannelAttachment, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.GetAttachment(fileId, remoteId)
|
||||
result, err := s.SharedChannelStore.GetAttachment(fileID, remoteID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -10463,11 +10463,11 @@ func (s *RetryLayerSharedChannelStore) GetRemote(id string) (*model.SharedChanne
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) GetRemoteByIds(channelId string, remoteId string) (*model.SharedChannelRemote, error) {
|
||||
func (s *RetryLayerSharedChannelStore) GetRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.GetRemoteByIds(channelId, remoteId)
|
||||
result, err := s.SharedChannelStore.GetRemoteByIds(channelID, remoteID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -10484,11 +10484,11 @@ func (s *RetryLayerSharedChannelStore) GetRemoteByIds(channelId string, remoteId
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) GetRemoteForUser(remoteId string, userId string) (*model.RemoteCluster, error) {
|
||||
func (s *RetryLayerSharedChannelStore) GetRemoteForUser(remoteID string, userID string) (*model.RemoteCluster, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.GetRemoteForUser(remoteId, userId)
|
||||
result, err := s.SharedChannelStore.GetRemoteForUser(remoteID, userID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -10526,11 +10526,11 @@ func (s *RetryLayerSharedChannelStore) GetRemotes(offset int, limit int, opts mo
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) GetRemotesStatus(channelId string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
func (s *RetryLayerSharedChannelStore) GetRemotesStatus(channelID string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.GetRemotesStatus(channelId)
|
||||
result, err := s.SharedChannelStore.GetRemotesStatus(channelID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -10631,11 +10631,11 @@ func (s *RetryLayerSharedChannelStore) HasChannel(channelID string) (bool, error
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSharedChannelStore) HasRemote(channelID string, remoteId string) (bool, error) {
|
||||
func (s *RetryLayerSharedChannelStore) HasRemote(channelID string, remoteID string) (bool, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.SharedChannelStore.HasRemote(channelID, remoteId)
|
||||
result, err := s.SharedChannelStore.HasRemote(channelID, remoteID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -12281,11 +12281,11 @@ func (s *RetryLayerTermsOfServiceStore) Save(termsOfService *model.TermsOfServic
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) DeleteMembershipForUser(userId string, postID string) error {
|
||||
func (s *RetryLayerThreadStore) DeleteMembershipForUser(userID string, postID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.ThreadStore.DeleteMembershipForUser(userId, postID)
|
||||
err := s.ThreadStore.DeleteMembershipForUser(userID, postID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -12365,11 +12365,11 @@ func (s *RetryLayerThreadStore) Get(id string) (*model.Thread, error) {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetMembershipForUser(userId string, postID string) (*model.ThreadMembership, error) {
|
||||
func (s *RetryLayerThreadStore) GetMembershipForUser(userID string, postID string) (*model.ThreadMembership, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetMembershipForUser(userId, postID)
|
||||
result, err := s.ThreadStore.GetMembershipForUser(userID, postID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -12386,11 +12386,11 @@ func (s *RetryLayerThreadStore) GetMembershipForUser(userId string, postID strin
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
func (s *RetryLayerThreadStore) GetMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetMembershipsForUser(userId, teamID)
|
||||
result, err := s.ThreadStore.GetMembershipsForUser(userID, teamID)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -12512,11 +12512,11 @@ func (s *RetryLayerThreadStore) GetThreadUnreadReplyCount(threadMembership *mode
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetThreadsForUser(userId string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
func (s *RetryLayerThreadStore) GetThreadsForUser(userID string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetThreadsForUser(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetThreadsForUser(userID, teamID, opts)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -12533,11 +12533,11 @@ func (s *RetryLayerThreadStore) GetThreadsForUser(userId string, teamID string,
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetTotalThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *RetryLayerThreadStore) GetTotalThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetTotalThreads(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalThreads(userID, teamID, opts)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -12554,11 +12554,11 @@ func (s *RetryLayerThreadStore) GetTotalThreads(userId string, teamID string, op
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetTotalUnreadMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *RetryLayerThreadStore) GetTotalUnreadMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetTotalUnreadMentions(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadMentions(userID, teamID, opts)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -12575,11 +12575,11 @@ func (s *RetryLayerThreadStore) GetTotalUnreadMentions(userId string, teamID str
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetTotalUnreadThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *RetryLayerThreadStore) GetTotalUnreadThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetTotalUnreadThreads(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadThreads(userID, teamID, opts)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -12596,11 +12596,11 @@ func (s *RetryLayerThreadStore) GetTotalUnreadThreads(userId string, teamID stri
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerThreadStore) GetTotalUnreadUrgentMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *RetryLayerThreadStore) GetTotalUnreadUrgentMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.ThreadStore.GetTotalUnreadUrgentMentions(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadUrgentMentions(userID, teamID, opts)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -13385,11 +13385,11 @@ func (s *RetryLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) GetAllProfilesInChannel(rctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
func (s *RetryLayerUserStore) GetAllProfilesInChannel(ctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.UserStore.GetAllProfilesInChannel(rctx, channelID, allowFromCache)
|
||||
result, err := s.UserStore.GetAllProfilesInChannel(ctx, channelID, allowFromCache)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -13823,11 +13823,11 @@ func (s *RetryLayerUserStore) GetProfilesInChannelByStatus(options *model.UserGe
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserStore) GetProfilesNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
func (s *RetryLayerUserStore) GetProfilesNotInChannel(teamID string, channelID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.UserStore.GetProfilesNotInChannel(teamID, channelId, groupConstrained, offset, limit, viewRestrictions)
|
||||
result, err := s.UserStore.GetProfilesNotInChannel(teamID, channelID, groupConstrained, offset, limit, viewRestrictions)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
@@ -14891,11 +14891,11 @@ func (s *RetryLayerUserAccessTokenStore) UpdateTokenEnable(tokenID string) error
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerUserTermsOfServiceStore) Delete(userID string, termsOfServiceId string) error {
|
||||
func (s *RetryLayerUserTermsOfServiceStore) Delete(userID string, termsOfServiceID string) error {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
err := s.UserTermsOfServiceStore.Delete(userID, termsOfServiceId)
|
||||
err := s.UserTermsOfServiceStore.Delete(userID, termsOfServiceID)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -3357,7 +3357,7 @@ func (s SqlChannelStore) channelSearchQuery(opts *store.ChannelSearchOpts) sq.Se
|
||||
}
|
||||
|
||||
likeFields := "c.Name, c.DisplayName, c.Purpose"
|
||||
if opts.IncludeSearchById {
|
||||
if opts.IncludeSearchByID {
|
||||
likeFields = likeFields + ", c.Id"
|
||||
}
|
||||
|
||||
|
||||
@@ -3284,7 +3284,7 @@ func (s *SqlPostStore) GetPostReminders(now int64) (_ []*model.PostReminder, err
|
||||
|
||||
func (s *SqlPostStore) GetPostReminderMetadata(postID string) (*store.PostReminderMetadata, error) {
|
||||
meta := &store.PostReminderMetadata{}
|
||||
err := s.GetReplicaX().Get(meta, `SELECT c.id as ChannelId,
|
||||
err := s.GetReplicaX().Get(meta, `SELECT c.id as ChannelID,
|
||||
COALESCE(t.name, '') as TeamName,
|
||||
u.locale as UserLocale, u.username as Username
|
||||
FROM Posts p
|
||||
|
||||
@@ -100,14 +100,14 @@ type RetentionPolicyStore interface {
|
||||
GetAll(offset, limit int) ([]*model.RetentionPolicyWithTeamAndChannelCounts, error)
|
||||
GetCount() (int64, error)
|
||||
Delete(id string) error
|
||||
GetChannels(policyId string, offset, limit int) (model.ChannelListWithTeamData, error)
|
||||
GetChannelsCount(policyId string) (int64, error)
|
||||
AddChannels(policyId string, channelIds []string) error
|
||||
RemoveChannels(policyId string, channelIds []string) error
|
||||
GetTeams(policyId string, offset, limit int) ([]*model.Team, error)
|
||||
GetTeamsCount(policyId string) (int64, error)
|
||||
AddTeams(policyId string, teamIds []string) error
|
||||
RemoveTeams(policyId string, teamIds []string) error
|
||||
GetChannels(policyID string, offset, limit int) (model.ChannelListWithTeamData, error)
|
||||
GetChannelsCount(policyID string) (int64, error)
|
||||
AddChannels(policyID string, channelIds []string) error
|
||||
RemoveChannels(policyID string, channelIds []string) error
|
||||
GetTeams(policyID string, offset, limit int) ([]*model.Team, error)
|
||||
GetTeamsCount(policyID string) (int64, error)
|
||||
AddTeams(policyID string, teamIds []string) error
|
||||
RemoveTeams(policyID string, teamIds []string) error
|
||||
DeleteOrphanedRows(limit int) (int64, error)
|
||||
GetTeamPoliciesForUser(userID string, offset, limit int) ([]*model.RetentionPolicyForTeam, error)
|
||||
GetTeamPoliciesCountForUser(userID string) (int64, error)
|
||||
@@ -197,12 +197,12 @@ type ChannelStore interface {
|
||||
SetDeleteAt(channelID string, deleteAt int64, updateAt int64) error
|
||||
PermanentDelete(ctx request.CTX, channelID string) error
|
||||
PermanentDeleteByTeam(teamID string) error
|
||||
GetByName(team_id string, name string, allowFromCache bool) (*model.Channel, error)
|
||||
GetByNames(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error)
|
||||
GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) (*model.Channel, error)
|
||||
GetByNamesIncludeDeleted(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error)
|
||||
GetDeletedByName(team_id string, name string) (*model.Channel, error)
|
||||
GetDeleted(team_id string, offset int, limit int, userID string) (model.ChannelList, error)
|
||||
GetByName(teamID string, name string, allowFromCache bool) (*model.Channel, error)
|
||||
GetByNames(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error)
|
||||
GetByNameIncludeDeleted(teamID string, name string, allowFromCache bool) (*model.Channel, error)
|
||||
GetByNamesIncludeDeleted(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error)
|
||||
GetDeletedByName(teamID string, name string) (*model.Channel, error)
|
||||
GetDeleted(teamID string, offset int, limit int, userID string) (model.ChannelList, error)
|
||||
GetChannels(teamID, userID string, opts *model.ChannelSearchOpts) (model.ChannelList, error)
|
||||
GetChannelsByUser(userID string, includeDeleted bool, lastDeleteAt, pageSize int, fromChannelID string) (model.ChannelList, error)
|
||||
GetAllChannelMemberIdsByChannelId(id string) ([]string, error)
|
||||
@@ -307,7 +307,7 @@ type ChannelStore interface {
|
||||
// GroupSyncedChannelCount returns the count of non-deleted group-constrained channels.
|
||||
GroupSyncedChannelCount() (int64, error)
|
||||
|
||||
SetShared(channelId string, shared bool) error
|
||||
SetShared(channelID string, shared bool) error
|
||||
// GetTeamForChannel returns the team for a given channelID.
|
||||
GetTeamForChannel(channelID string) (*model.Team, error)
|
||||
IsReadOnlyChannel(channelID string) (bool, error)
|
||||
@@ -328,11 +328,11 @@ type ThreadStore interface {
|
||||
GetThreadMembershipsForExport(postID string) ([]*model.ThreadMembershipForExport, error)
|
||||
|
||||
Get(id string) (*model.Thread, error)
|
||||
GetTotalUnreadThreads(userId, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetTotalThreads(userId, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetTotalUnreadMentions(userId, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetTotalUnreadUrgentMentions(userId, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetThreadsForUser(userId, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error)
|
||||
GetTotalUnreadThreads(userID, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetTotalThreads(userID, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetTotalUnreadMentions(userID, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetTotalUnreadUrgentMentions(userID, teamID string, opts model.GetUserThreadsOpts) (int64, error)
|
||||
GetThreadsForUser(userID, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error)
|
||||
GetThreadForUser(threadMembership *model.ThreadMembership, extended, postPriorityIsEnabled bool) (*model.ThreadResponse, error)
|
||||
GetTeamsUnreadForUser(userID string, teamIDs []string, includeUrgentMentionCount bool) (map[string]*model.TeamUnread, error)
|
||||
|
||||
@@ -342,9 +342,9 @@ type ThreadStore interface {
|
||||
MarkAsRead(userID, threadID string, timestamp int64) error
|
||||
|
||||
UpdateMembership(membership *model.ThreadMembership) (*model.ThreadMembership, error)
|
||||
GetMembershipsForUser(userId, teamID string) ([]*model.ThreadMembership, error)
|
||||
GetMembershipForUser(userId, postID string) (*model.ThreadMembership, error)
|
||||
DeleteMembershipForUser(userId, postID string) error
|
||||
GetMembershipsForUser(userID, teamID string) ([]*model.ThreadMembership, error)
|
||||
GetMembershipForUser(userID, postID string) (*model.ThreadMembership, error)
|
||||
DeleteMembershipForUser(userID, postID string) error
|
||||
MaintainMembership(userID, postID string, opts ThreadMembershipOpts) (*model.ThreadMembership, error)
|
||||
PermanentDeleteBatchForRetentionPolicies(now, globalPolicyEndTime, limit int64, cursor model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)
|
||||
PermanentDeleteBatchThreadMembershipsForRetentionPolicies(now, globalPolicyEndTime, limit int64, cursor model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)
|
||||
@@ -389,7 +389,7 @@ type PostStore interface {
|
||||
Overwrite(rctx request.CTX, post *model.Post) (*model.Post, error)
|
||||
OverwriteMultiple(posts []*model.Post) ([]*model.Post, int, error)
|
||||
GetPostsByIds(postIds []string) ([]*model.Post, error)
|
||||
GetEditHistoryForPost(postId string) ([]*model.Post, error)
|
||||
GetEditHistoryForPost(postID string) ([]*model.Post, error)
|
||||
GetPostsBatchForIndexing(startTime int64, startPostID string, limit int) ([]*model.PostForIndexing, error)
|
||||
PermanentDeleteBatchForRetentionPolicies(now, globalPolicyEndTime, limit int64, cursor model.RetentionPolicyCursor) (int64, model.RetentionPolicyCursor, error)
|
||||
PermanentDeleteBatch(endTime int64, limit int64) (int64, error)
|
||||
@@ -400,7 +400,7 @@ type PostStore interface {
|
||||
GetDirectPostParentsForExportAfter(limit int, afterID string, includeArchivedChannels bool) ([]*model.DirectPostForExport, error)
|
||||
SearchPostsForUser(rctx request.CTX, paramsList []*model.SearchParams, userID, teamID string, page, perPage int) (*model.PostSearchResults, error)
|
||||
GetOldestEntityCreationTime() (int64, error)
|
||||
HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userId string) (bool, error)
|
||||
HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userID string) (bool, error)
|
||||
GetPostsSinceForSync(options model.GetPostsSinceForSyncOptions, cursor model.GetPostsSinceForSyncCursor, limit int) ([]*model.Post, model.GetPostsSinceForSyncCursor, error)
|
||||
SetPostReminder(reminder *model.PostReminder) error
|
||||
GetPostReminders(now int64) ([]*model.PostReminder, error)
|
||||
@@ -433,8 +433,8 @@ type UserStore interface {
|
||||
GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, error)
|
||||
GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, error)
|
||||
GetProfilesInChannelByAdmin(options *model.UserGetOptions) ([]*model.User, error)
|
||||
GetAllProfilesInChannel(rctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error)
|
||||
GetProfilesNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
|
||||
GetAllProfilesInChannel(ctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error)
|
||||
GetProfilesNotInChannel(teamID string, channelID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
|
||||
GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, error)
|
||||
GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
|
||||
GetAllProfiles(options *model.UserGetOptions) ([]*model.User, error)
|
||||
@@ -526,7 +526,7 @@ type SessionStore interface {
|
||||
|
||||
type AuditStore interface {
|
||||
Save(audit *model.Audit) error
|
||||
Get(user_id string, offset int, limit int) (model.Audits, error)
|
||||
Get(userID string, offset int, limit int) (model.Audits, error)
|
||||
PermanentDeleteByUser(userID string) error
|
||||
}
|
||||
|
||||
@@ -542,12 +542,12 @@ type ClusterDiscoveryStore interface {
|
||||
type RemoteClusterStore interface {
|
||||
Save(rc *model.RemoteCluster) (*model.RemoteCluster, error)
|
||||
Update(rc *model.RemoteCluster) (*model.RemoteCluster, error)
|
||||
Delete(remoteClusterId string) (bool, error)
|
||||
Get(remoteClusterId string, includeDeleted bool) (*model.RemoteCluster, error)
|
||||
Delete(remoteClusterID string) (bool, error)
|
||||
Get(remoteClusterID string, includeDeleted bool) (*model.RemoteCluster, error)
|
||||
GetByPluginID(pluginID string) (*model.RemoteCluster, error)
|
||||
GetAll(offset, limit int, filter model.RemoteClusterQueryFilter) ([]*model.RemoteCluster, error)
|
||||
UpdateTopics(remoteClusterId string, topics string) (*model.RemoteCluster, error)
|
||||
SetLastPingAt(remoteClusterId string) error
|
||||
UpdateTopics(remoteClusterID string, topics string) (*model.RemoteCluster, error)
|
||||
SetLastPingAt(remoteClusterID string) error
|
||||
}
|
||||
|
||||
type ComplianceStore interface {
|
||||
@@ -570,15 +570,15 @@ type OAuthStore interface {
|
||||
SaveAuthData(authData *model.AuthData) (*model.AuthData, error)
|
||||
GetAuthData(code string) (*model.AuthData, error)
|
||||
RemoveAuthData(code string) error
|
||||
RemoveAuthDataByClientId(clientId string, userId string) error
|
||||
RemoveAuthDataByUserId(userId string) error
|
||||
RemoveAuthDataByClientId(clientID string, userID string) error
|
||||
RemoveAuthDataByUserId(userID string) error
|
||||
PermanentDeleteAuthDataByUser(userID string) error
|
||||
SaveAccessData(accessData *model.AccessData) (*model.AccessData, error)
|
||||
UpdateAccessData(accessData *model.AccessData) (*model.AccessData, error)
|
||||
GetAccessData(token string) (*model.AccessData, error)
|
||||
GetAccessDataByUserForApp(userID, clientId string) ([]*model.AccessData, error)
|
||||
GetAccessDataByUserForApp(userID, clientID string) ([]*model.AccessData, error)
|
||||
GetAccessDataByRefreshToken(token string) (*model.AccessData, error)
|
||||
GetPreviousAccessData(userID, clientId string) (*model.AccessData, error)
|
||||
GetPreviousAccessData(userID, clientID string) (*model.AccessData, error)
|
||||
RemoveAccessData(token string) error
|
||||
RemoveAllAccessData() error
|
||||
}
|
||||
@@ -684,9 +684,9 @@ type TokenStore interface {
|
||||
|
||||
type DesktopTokensStore interface {
|
||||
GetUserId(token string, minCreatedAt int64) (*string, error)
|
||||
Insert(token string, createAt int64, userId string) error
|
||||
Insert(token string, createAt int64, userID string) error
|
||||
Delete(token string) error
|
||||
DeleteByUserId(userId string) error
|
||||
DeleteByUserId(userID string) error
|
||||
DeleteOlderThan(minCreatedAt int64) error
|
||||
}
|
||||
|
||||
@@ -749,9 +749,9 @@ type ReactionStore interface {
|
||||
Save(reaction *model.Reaction) (*model.Reaction, error)
|
||||
Delete(reaction *model.Reaction) (*model.Reaction, error)
|
||||
GetForPost(postID string, allowFromCache bool) ([]*model.Reaction, error)
|
||||
GetForPostSince(postId string, since int64, excludeRemoteId string, inclDeleted bool) ([]*model.Reaction, error)
|
||||
GetUniqueCountForPost(postId string) (int, error)
|
||||
ExistsOnPost(postId string, emojiName string) (bool, error)
|
||||
GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.Reaction, error)
|
||||
GetUniqueCountForPost(postID string) (int, error)
|
||||
ExistsOnPost(postID string, emojiName string) (bool, error)
|
||||
DeleteAllWithEmojiName(emojiName string) error
|
||||
BulkGetForPosts(postIds []string) ([]*model.Reaction, error)
|
||||
GetSingle(userID, postID, remoteID, emojiName string) (*model.Reaction, error)
|
||||
@@ -856,7 +856,7 @@ type ProductNoticesStore interface {
|
||||
type UserTermsOfServiceStore interface {
|
||||
GetByUser(userID string) (*model.UserTermsOfService, error)
|
||||
Save(userTermsOfService *model.UserTermsOfService) (*model.UserTermsOfService, error)
|
||||
Delete(userID, termsOfServiceId string) error
|
||||
Delete(userID, termsOfServiceID string) error
|
||||
}
|
||||
|
||||
type GroupStore interface {
|
||||
@@ -972,31 +972,31 @@ type LinkMetadataStore interface {
|
||||
|
||||
type NotifyAdminStore interface {
|
||||
Save(data *model.NotifyAdminData) (*model.NotifyAdminData, error)
|
||||
GetDataByUserIdAndFeature(userId string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error)
|
||||
GetDataByUserIdAndFeature(userID string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error)
|
||||
Get(trial bool) ([]*model.NotifyAdminData, error)
|
||||
DeleteBefore(trial bool, now int64) error
|
||||
Update(userId string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error
|
||||
Update(userID string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error
|
||||
}
|
||||
|
||||
type SharedChannelStore interface {
|
||||
Save(sc *model.SharedChannel) (*model.SharedChannel, error)
|
||||
Get(channelId string) (*model.SharedChannel, error)
|
||||
Get(channelID string) (*model.SharedChannel, error)
|
||||
HasChannel(channelID string) (bool, error)
|
||||
GetAll(offset, limit int, opts model.SharedChannelFilterOpts) ([]*model.SharedChannel, error)
|
||||
GetAllCount(opts model.SharedChannelFilterOpts) (int64, error)
|
||||
Update(sc *model.SharedChannel) (*model.SharedChannel, error)
|
||||
Delete(channelId string) (bool, error)
|
||||
Delete(channelID string) (bool, error)
|
||||
|
||||
SaveRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error)
|
||||
UpdateRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error)
|
||||
GetRemote(id string) (*model.SharedChannelRemote, error)
|
||||
HasRemote(channelID string, remoteId string) (bool, error)
|
||||
GetRemoteForUser(remoteId string, userId string) (*model.RemoteCluster, error)
|
||||
GetRemoteByIds(channelId string, remoteId string) (*model.SharedChannelRemote, error)
|
||||
HasRemote(channelID string, remoteID string) (bool, error)
|
||||
GetRemoteForUser(remoteID string, userID string) (*model.RemoteCluster, error)
|
||||
GetRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error)
|
||||
GetRemotes(offset, limit int, opts model.SharedChannelRemoteFilterOpts) ([]*model.SharedChannelRemote, error)
|
||||
UpdateRemoteCursor(id string, cursor model.GetPostsSinceForSyncCursor) error
|
||||
DeleteRemote(remoteId string) (bool, error)
|
||||
GetRemotesStatus(channelId string) ([]*model.SharedChannelRemoteStatus, error)
|
||||
DeleteRemote(remoteID string) (bool, error)
|
||||
GetRemotesStatus(channelID string) ([]*model.SharedChannelRemoteStatus, error)
|
||||
|
||||
SaveUser(remote *model.SharedChannelUser) (*model.SharedChannelUser, error)
|
||||
GetSingleUser(userID string, channelID string, remoteID string) (*model.SharedChannelUser, error)
|
||||
@@ -1006,12 +1006,12 @@ type SharedChannelStore interface {
|
||||
|
||||
SaveAttachment(remote *model.SharedChannelAttachment) (*model.SharedChannelAttachment, error)
|
||||
UpsertAttachment(remote *model.SharedChannelAttachment) (string, error)
|
||||
GetAttachment(fileId string, remoteId string) (*model.SharedChannelAttachment, error)
|
||||
GetAttachment(fileID string, remoteID string) (*model.SharedChannelAttachment, error)
|
||||
UpdateAttachmentLastSyncAt(id string, syncTime int64) error
|
||||
}
|
||||
|
||||
type PostPriorityStore interface {
|
||||
GetForPost(postId string) (*model.PostPriority, error)
|
||||
GetForPost(postID string) (*model.PostPriority, error)
|
||||
GetForPosts(ids []string) ([]*model.PostPriority, error)
|
||||
}
|
||||
|
||||
@@ -1021,9 +1021,9 @@ type DraftStore interface {
|
||||
Delete(userID, channelID, rootID string) error
|
||||
DeleteDraftsAssociatedWithPost(channelID, rootID string) error
|
||||
GetDraftsForUser(userID, teamID string) ([]*model.Draft, error)
|
||||
GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userId string) (int64, string, error)
|
||||
DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userId string) error
|
||||
DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userId string) error
|
||||
GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userID string) (int64, string, error)
|
||||
DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userID string) error
|
||||
DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userID string) error
|
||||
}
|
||||
|
||||
type PostAcknowledgementStore interface {
|
||||
@@ -1044,13 +1044,13 @@ type PostPersistentNotificationStore interface {
|
||||
DeleteByTeam(teamIds []string) error
|
||||
}
|
||||
type ChannelBookmarkStore interface {
|
||||
ErrorIfBookmarkFileInfoAlreadyAttached(fileId string) error
|
||||
ErrorIfBookmarkFileInfoAlreadyAttached(fileID string) error
|
||||
Get(Id string, includeDeleted bool) (b *model.ChannelBookmarkWithFileInfo, err error)
|
||||
Save(bookmark *model.ChannelBookmark, increaseSortOrder bool) (b *model.ChannelBookmarkWithFileInfo, err error)
|
||||
Update(bookmark *model.ChannelBookmark) error
|
||||
UpdateSortOrder(bookmarkId, channelId string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error)
|
||||
Delete(bookmarkId string, deleteFile bool) error
|
||||
GetBookmarksForChannelSince(channelId string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error)
|
||||
UpdateSortOrder(bookmarkID, channelID string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error)
|
||||
Delete(bookmarkID string, deleteFile bool) error
|
||||
GetBookmarksForChannelSince(channelID string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error)
|
||||
}
|
||||
|
||||
// ChannelSearchOpts contains options for searching channels.
|
||||
@@ -1058,7 +1058,7 @@ type ChannelBookmarkStore interface {
|
||||
// NotAssociatedToGroup will exclude channels that have associated, active GroupChannels records.
|
||||
// IncludeDeleted will include channel records where DeleteAt != 0.
|
||||
// ExcludeChannelNames will exclude channels from the results by name.
|
||||
// IncludeSearchById will include searching matches against channel IDs in the results
|
||||
// IncludeSearchByID will include searching matches against channel IDs in the results
|
||||
// Paginate whether to paginate the results.
|
||||
// Page page requested, if results are paginated.
|
||||
// PerPage number of results per page, if paginated.
|
||||
@@ -1075,7 +1075,7 @@ type ChannelSearchOpts struct {
|
||||
ExcludePolicyConstrained bool
|
||||
IncludePolicyID bool
|
||||
IncludeTeamInfo bool
|
||||
IncludeSearchById bool
|
||||
IncludeSearchByID bool
|
||||
ExcludeRemote bool
|
||||
CountOnly bool
|
||||
Public bool
|
||||
@@ -1125,7 +1125,7 @@ type ThreadMembershipOpts struct {
|
||||
// PostReminderMetadata contains some info needed to send
|
||||
// the reminder message to the user.
|
||||
type PostReminderMetadata struct {
|
||||
ChannelId string
|
||||
ChannelID string
|
||||
TeamName string
|
||||
UserLocale string
|
||||
Username string
|
||||
|
||||
@@ -119,13 +119,13 @@ func testBotStoreGet(t *testing.T, rctx request.CTX, ss store.Store, s SqlStore)
|
||||
}
|
||||
|
||||
func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlStore) {
|
||||
OwnerId1 := model.NewId()
|
||||
OwnerId2 := model.NewId()
|
||||
OwnerID1 := model.NewId()
|
||||
OwnerID2 := model.NewId()
|
||||
|
||||
deletedBot, _ := makeBotWithUser(t, rctx, ss, &model.Bot{
|
||||
Username: "deleted_bot",
|
||||
Description: "A deleted bot",
|
||||
OwnerId: OwnerId1,
|
||||
OwnerId: OwnerID1,
|
||||
LastIconUpdate: model.GetMillis(),
|
||||
})
|
||||
deletedBot.DeleteAt = 1
|
||||
@@ -137,7 +137,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
permanentlyDeletedBot, _ := makeBotWithUser(t, rctx, ss, &model.Bot{
|
||||
Username: "permanently_deleted_bot",
|
||||
Description: "A permanently deleted bot",
|
||||
OwnerId: OwnerId1,
|
||||
OwnerId: OwnerID1,
|
||||
LastIconUpdate: model.GetMillis(),
|
||||
DeleteAt: 0,
|
||||
})
|
||||
@@ -147,7 +147,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
b1, _ := makeBotWithUser(t, rctx, ss, &model.Bot{
|
||||
Username: "b1",
|
||||
Description: "The first bot",
|
||||
OwnerId: OwnerId1,
|
||||
OwnerId: OwnerID1,
|
||||
LastIconUpdate: model.GetMillis(),
|
||||
})
|
||||
defer func() { require.NoError(t, ss.Bot().PermanentDelete(b1.UserId)) }()
|
||||
@@ -156,7 +156,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
b2, _ := makeBotWithUser(t, rctx, ss, &model.Bot{
|
||||
Username: "b2",
|
||||
Description: "The second bot",
|
||||
OwnerId: OwnerId1,
|
||||
OwnerId: OwnerID1,
|
||||
LastIconUpdate: 0,
|
||||
})
|
||||
defer func() { require.NoError(t, ss.Bot().PermanentDelete(b2.UserId)) }()
|
||||
@@ -178,7 +178,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
b3, _ := makeBotWithUser(t, rctx, ss, &model.Bot{
|
||||
Username: "b3",
|
||||
Description: "The third bot",
|
||||
OwnerId: OwnerId1,
|
||||
OwnerId: OwnerID1,
|
||||
})
|
||||
defer func() { require.NoError(t, ss.Bot().PermanentDelete(b3.UserId)) }()
|
||||
defer func() { require.NoError(t, ss.User().PermanentDelete(rctx, b3.UserId)) }()
|
||||
@@ -186,7 +186,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
b4, _ := makeBotWithUser(t, rctx, ss, &model.Bot{
|
||||
Username: "b4",
|
||||
Description: "The fourth bot",
|
||||
OwnerId: OwnerId2,
|
||||
OwnerId: OwnerID2,
|
||||
})
|
||||
defer func() { require.NoError(t, ss.Bot().PermanentDelete(b4.UserId)) }()
|
||||
defer func() { require.NoError(t, ss.User().PermanentDelete(rctx, b4.UserId)) }()
|
||||
@@ -274,7 +274,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
})
|
||||
|
||||
t.Run("get offset=0, limit=10, creator id 1", func(t *testing.T) {
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, OwnerId: OwnerId1})
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, OwnerId: OwnerID1})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, []*model.Bot{
|
||||
b1,
|
||||
@@ -284,7 +284,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
})
|
||||
|
||||
t.Run("get offset=0, limit=10, creator id 2", func(t *testing.T) {
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, OwnerId: OwnerId2})
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, OwnerId: OwnerID2})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, []*model.Bot{
|
||||
b4,
|
||||
@@ -292,7 +292,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
})
|
||||
|
||||
t.Run("get offset=0, limit=10, include deleted, creator id 1", func(t *testing.T) {
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, IncludeDeleted: true, OwnerId: OwnerId1})
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, IncludeDeleted: true, OwnerId: OwnerID1})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, []*model.Bot{
|
||||
deletedBot,
|
||||
@@ -303,7 +303,7 @@ func testBotStoreGetAll(t *testing.T, rctx request.CTX, ss store.Store, s SqlSto
|
||||
})
|
||||
|
||||
t.Run("get offset=0, limit=10, include deleted, creator id 2", func(t *testing.T) {
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, IncludeDeleted: true, OwnerId: OwnerId2})
|
||||
bots, err := ss.Bot().GetAll(&model.BotGetOptions{Page: 0, PerPage: 10, IncludeDeleted: true, OwnerId: OwnerID2})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, []*model.Bot{
|
||||
b4,
|
||||
|
||||
@@ -33,12 +33,12 @@ func TestChannelBookmarkStore(t *testing.T, rctx request.CTX, ss store.Store, s
|
||||
}
|
||||
|
||||
func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
channelId := model.NewId()
|
||||
userId := model.NewId()
|
||||
channelID := model.NewId()
|
||||
userID := model.NewId()
|
||||
|
||||
bookmark1 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Link bookmark test",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
@@ -61,8 +61,8 @@ func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
bookmark2 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "file bookmark test",
|
||||
FileId: file.Id,
|
||||
Type: model.ChannelBookmarkFile,
|
||||
@@ -70,8 +70,8 @@ func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
bookmark3 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "file already attached",
|
||||
FileId: file.Id,
|
||||
Type: model.ChannelBookmarkFile,
|
||||
@@ -80,7 +80,7 @@ func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
file2 := &model.FileInfo{
|
||||
Id: model.NewId(),
|
||||
CreatorId: userId,
|
||||
CreatorId: userID,
|
||||
Path: "somepath",
|
||||
ThumbnailPath: "thumbpath",
|
||||
PreviewPath: "prevPath",
|
||||
@@ -94,8 +94,8 @@ func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
bookmark4 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "file already attached to a post",
|
||||
FileId: file2.Id,
|
||||
Type: model.ChannelBookmarkFile,
|
||||
@@ -110,7 +110,7 @@ func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
defer ss.FileInfo().PermanentDelete(rctx, file2.Id)
|
||||
|
||||
err = ss.FileInfo().AttachToPost(rctx, file2.Id, model.NewId(), channelId, userId)
|
||||
err = ss.FileInfo().AttachToPost(rctx, file2.Id, model.NewId(), channelID, userID)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("save bookmarks", func(t *testing.T) {
|
||||
@@ -128,7 +128,7 @@ func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
assert.Equal(t, bookmark2.ChannelId, bookmarkResp.ChannelId)
|
||||
assert.NotNil(t, bookmarkResp.FileInfo)
|
||||
|
||||
bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelId, 0)
|
||||
bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelID, 0)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, bookmarks, 2)
|
||||
|
||||
@@ -141,12 +141,12 @@ func testSaveChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
func testUpdateChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
channelId := model.NewId()
|
||||
userId := model.NewId()
|
||||
channelID := model.NewId()
|
||||
userID := model.NewId()
|
||||
|
||||
bookmark1 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Link bookmark test",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
@@ -167,7 +167,7 @@ func testUpdateChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
err = ss.ChannelBookmark().Update(bookmark2.Clone())
|
||||
assert.NoError(t, err)
|
||||
|
||||
bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelId, now)
|
||||
bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelID, now)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, bookmarks, 1)
|
||||
|
||||
@@ -190,12 +190,12 @@ func testUpdateChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
channelId := model.NewId()
|
||||
userId := model.NewId()
|
||||
channelID := model.NewId()
|
||||
userID := model.NewId()
|
||||
|
||||
bookmark0 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Bookmark 0",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
@@ -218,8 +218,8 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
}
|
||||
|
||||
bookmark1 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Bookmark 1",
|
||||
FileId: file.Id,
|
||||
Type: model.ChannelBookmarkFile,
|
||||
@@ -231,24 +231,24 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
defer ss.FileInfo().PermanentDelete(rctx, file.Id)
|
||||
|
||||
bookmark2 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Bookmark 2",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
}
|
||||
|
||||
bookmark3 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Bookmark 3",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
}
|
||||
|
||||
bookmark4 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Bookmark 4",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
@@ -279,7 +279,7 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
bookmark4 = bookmarkResp.ChannelBookmark.Clone()
|
||||
|
||||
t.Run("change order of bookmarks first to last", func(t *testing.T) {
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelId, 4)
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelID, 4)
|
||||
assert.NoError(t, sortError)
|
||||
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark1.Id).SortOrder, int64(0))
|
||||
@@ -290,7 +290,7 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
})
|
||||
|
||||
t.Run("change order of bookmarks last to first", func(t *testing.T) {
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelId, 0)
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelID, 0)
|
||||
assert.NoError(t, sortError)
|
||||
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark0.Id).SortOrder, int64(0))
|
||||
@@ -301,7 +301,7 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
})
|
||||
|
||||
t.Run("change order of bookmarks first to third", func(t *testing.T) {
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelId, 2)
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelID, 2)
|
||||
assert.NoError(t, sortError)
|
||||
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark1.Id).SortOrder, int64(0))
|
||||
@@ -311,11 +311,11 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark4.Id).SortOrder, int64(4))
|
||||
|
||||
// now reset order
|
||||
ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelId, 0)
|
||||
ss.ChannelBookmark().UpdateSortOrder(bookmark0.Id, channelID, 0)
|
||||
})
|
||||
|
||||
t.Run("change order of bookmarks second to third", func(t *testing.T) {
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark1.Id, channelId, 2)
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark1.Id, channelID, 2)
|
||||
assert.NoError(t, sortError)
|
||||
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark0.Id).SortOrder, int64(0))
|
||||
@@ -326,7 +326,7 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
})
|
||||
|
||||
t.Run("change order of bookmarks third to second", func(t *testing.T) {
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark1.Id, channelId, 1)
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark1.Id, channelID, 1)
|
||||
assert.NoError(t, sortError)
|
||||
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark0.Id).SortOrder, int64(0))
|
||||
@@ -337,7 +337,7 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
})
|
||||
|
||||
t.Run("change order of bookmarks last to previous last", func(t *testing.T) {
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark4.Id, channelId, 3)
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark4.Id, channelID, 3)
|
||||
assert.NoError(t, sortError)
|
||||
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark0.Id).SortOrder, int64(0))
|
||||
@@ -348,7 +348,7 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
})
|
||||
|
||||
t.Run("change order of bookmarks last to second", func(t *testing.T) {
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark3.Id, channelId, 1)
|
||||
bookmarks, sortError := ss.ChannelBookmark().UpdateSortOrder(bookmark3.Id, channelID, 1)
|
||||
assert.NoError(t, sortError)
|
||||
|
||||
assert.Equal(t, find_bookmark(bookmarks, bookmark0.Id).SortOrder, int64(0))
|
||||
@@ -360,16 +360,16 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
|
||||
t.Run("change order of bookmarks error when new index is out of bounds", func(t *testing.T) {
|
||||
var iiErr *store.ErrInvalidInput
|
||||
_, err = ss.ChannelBookmark().UpdateSortOrder(bookmark3.Id, channelId, -1)
|
||||
_, err = ss.ChannelBookmark().UpdateSortOrder(bookmark3.Id, channelID, -1)
|
||||
assert.Error(t, err)
|
||||
assert.ErrorAs(t, err, &iiErr)
|
||||
_, err = ss.ChannelBookmark().UpdateSortOrder(bookmark3.Id, channelId, 5)
|
||||
_, err = ss.ChannelBookmark().UpdateSortOrder(bookmark3.Id, channelID, 5)
|
||||
assert.Error(t, err)
|
||||
assert.ErrorAs(t, err, &iiErr)
|
||||
})
|
||||
|
||||
t.Run("change order of bookmarks error when bookmark not found", func(t *testing.T) {
|
||||
_, err = ss.ChannelBookmark().UpdateSortOrder(model.NewId(), channelId, 0)
|
||||
_, err = ss.ChannelBookmark().UpdateSortOrder(model.NewId(), channelID, 0)
|
||||
assert.Error(t, err)
|
||||
var nfErr *store.ErrNotFound
|
||||
assert.ErrorAs(t, err, &nfErr)
|
||||
@@ -377,12 +377,12 @@ func testUpdateSortOrderChannelBookmark(t *testing.T, rctx request.CTX, ss store
|
||||
}
|
||||
|
||||
func testDeleteChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
channelId := model.NewId()
|
||||
userId := model.NewId()
|
||||
channelID := model.NewId()
|
||||
userID := model.NewId()
|
||||
|
||||
bookmark1 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Link bookmark test",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
@@ -405,8 +405,8 @@ func testDeleteChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
bookmark2 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "file bookmark test",
|
||||
FileId: file.Id,
|
||||
Type: model.ChannelBookmarkFile,
|
||||
@@ -439,7 +439,7 @@ func testDeleteChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
var nfErr *store.ErrNotFound
|
||||
assert.ErrorAs(t, err, &nfErr)
|
||||
|
||||
bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelId, now)
|
||||
bookmarks, err := ss.ChannelBookmark().GetBookmarksForChannelSince(channelID, now)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, bookmarks, 2) // we have two as the deleted record also gets returned for sync'ing purposes
|
||||
|
||||
@@ -450,12 +450,12 @@ func testDeleteChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
func testGetChannelBookmark(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
channelId := model.NewId()
|
||||
userId := model.NewId()
|
||||
channelID := model.NewId()
|
||||
userID := model.NewId()
|
||||
|
||||
bookmark1 := &model.ChannelBookmark{
|
||||
ChannelId: channelId,
|
||||
OwnerId: userId,
|
||||
ChannelId: channelID,
|
||||
OwnerId: userID,
|
||||
DisplayName: "Link bookmark test",
|
||||
LinkUrl: "https://mattermost.com",
|
||||
Type: model.ChannelBookmarkLink,
|
||||
|
||||
@@ -31,7 +31,7 @@ func testLogJoinEvent(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
ch := model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.ChannelTypeOpen,
|
||||
}
|
||||
channel, err := ss.Channel().Save(rctx, &ch, -1)
|
||||
@@ -57,7 +57,7 @@ func testLogLeaveEvent(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
ch := model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.ChannelTypeOpen,
|
||||
}
|
||||
channel, err := ss.Channel().Save(rctx, &ch, -1)
|
||||
@@ -86,7 +86,7 @@ func testGetUsersInChannelAtChannelMemberHistory(t *testing.T, rctx request.CTX,
|
||||
ch := &model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.ChannelTypeOpen,
|
||||
}
|
||||
channel, err := ss.Channel().Save(rctx, ch, -1)
|
||||
@@ -182,7 +182,7 @@ func testGetUsersInChannelAtChannelMembers(t *testing.T, rctx request.CTX, ss st
|
||||
channel := &model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.ChannelTypeOpen,
|
||||
}
|
||||
channel, err := ss.Channel().Save(rctx, channel, -1)
|
||||
@@ -294,7 +294,7 @@ func testPermanentDeleteBatch(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
channel := &model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.ChannelTypeOpen,
|
||||
}
|
||||
channel, err := ss.Channel().Save(rctx, channel, -1)
|
||||
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -105,7 +105,7 @@ func testComplianceExport(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
t1 := &model.Team{}
|
||||
t1.DisplayName = "DisplayName"
|
||||
t1.Name = NewTestId()
|
||||
t1.Name = NewTestID()
|
||||
t1.Email = MakeEmail()
|
||||
t1.Type = model.TeamOpen
|
||||
t1, err := ss.Team().Save(t1)
|
||||
@@ -130,7 +130,7 @@ func testComplianceExport(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
c1 := &model.Channel{}
|
||||
c1.TeamId = t1.Id
|
||||
c1.DisplayName = "Channel2"
|
||||
c1.Name = NewTestId()
|
||||
c1.Name = NewTestID()
|
||||
c1.Type = model.ChannelTypeOpen
|
||||
c1, nErr = ss.Channel().Save(rctx, c1, -1)
|
||||
require.NoError(t, nErr)
|
||||
@@ -139,7 +139,7 @@ func testComplianceExport(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1.ChannelId = c1.Id
|
||||
o1.UserId = u1.Id
|
||||
o1.CreateAt = model.GetMillis()
|
||||
o1.Message = NewTestId()
|
||||
o1.Message = NewTestID()
|
||||
o1, nErr = ss.Post().Save(rctx, o1)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -147,7 +147,7 @@ func testComplianceExport(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1a.ChannelId = c1.Id
|
||||
o1a.UserId = u1.Id
|
||||
o1a.CreateAt = o1.CreateAt + 10
|
||||
o1a.Message = NewTestId()
|
||||
o1a.Message = NewTestID()
|
||||
_, nErr = ss.Post().Save(rctx, o1a)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -155,7 +155,7 @@ func testComplianceExport(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o2.ChannelId = c1.Id
|
||||
o2.UserId = u1.Id
|
||||
o2.CreateAt = o1.CreateAt + 20
|
||||
o2.Message = NewTestId()
|
||||
o2.Message = NewTestID()
|
||||
_, nErr = ss.Post().Save(rctx, o2)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -163,7 +163,7 @@ func testComplianceExport(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o2a.ChannelId = c1.Id
|
||||
o2a.UserId = u2.Id
|
||||
o2a.CreateAt = o1.CreateAt + 30
|
||||
o2a.Message = NewTestId()
|
||||
o2a.Message = NewTestID()
|
||||
o2a, nErr = ss.Post().Save(rctx, o2a)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -239,7 +239,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
|
||||
t1 := &model.Team{}
|
||||
t1.DisplayName = "DisplayName"
|
||||
t1.Name = NewTestId()
|
||||
t1.Name = NewTestID()
|
||||
t1.Email = MakeEmail()
|
||||
t1.Type = model.TeamOpen
|
||||
t1, err := ss.Team().Save(t1)
|
||||
@@ -264,7 +264,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
c1 := &model.Channel{}
|
||||
c1.TeamId = t1.Id
|
||||
c1.DisplayName = "Channel2"
|
||||
c1.Name = NewTestId()
|
||||
c1.Name = NewTestID()
|
||||
c1.Type = model.ChannelTypeOpen
|
||||
c1, nErr = ss.Channel().Save(rctx, c1, -1)
|
||||
require.NoError(t, nErr)
|
||||
@@ -275,7 +275,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
o1.ChannelId = c1.Id
|
||||
o1.UserId = u1.Id
|
||||
o1.CreateAt = model.GetMillis()
|
||||
o1.Message = NewTestId()
|
||||
o1.Message = NewTestID()
|
||||
o1, nErr = ss.Post().Save(rctx, o1)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -283,7 +283,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
o1a.ChannelId = c1.Id
|
||||
o1a.UserId = u1.Id
|
||||
o1a.CreateAt = o1.CreateAt + 10
|
||||
o1a.Message = NewTestId()
|
||||
o1a.Message = NewTestID()
|
||||
_, nErr = ss.Post().Save(rctx, o1a)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -291,7 +291,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
o2.ChannelId = c1.Id
|
||||
o2.UserId = u1.Id
|
||||
o2.CreateAt = o1.CreateAt + 20
|
||||
o2.Message = NewTestId()
|
||||
o2.Message = NewTestID()
|
||||
_, nErr = ss.Post().Save(rctx, o2)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -299,7 +299,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
o2a.ChannelId = c1.Id
|
||||
o2a.UserId = u2.Id
|
||||
o2a.CreateAt = o1.CreateAt + 30
|
||||
o2a.Message = NewTestId()
|
||||
o2a.Message = NewTestID()
|
||||
_, nErr = ss.Post().Save(rctx, o2a)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -307,7 +307,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
o3.ChannelId = cDM.Id
|
||||
o3.UserId = u1.Id
|
||||
o3.CreateAt = o1.CreateAt + 40
|
||||
o3.Message = NewTestId()
|
||||
o3.Message = NewTestID()
|
||||
o3, nErr = ss.Post().Save(rctx, o3)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -362,7 +362,7 @@ func testComplianceExportDirectMessages(t *testing.T, rctx request.CTX, ss store
|
||||
post.ChannelId = c1.Id
|
||||
post.UserId = u1.Id
|
||||
post.CreateAt = createAt
|
||||
post.Message = NewTestId()
|
||||
post.Message = NewTestID()
|
||||
_, nErr = ss.Post().Save(rctx, post)
|
||||
require.NoError(t, nErr)
|
||||
}
|
||||
@@ -407,7 +407,7 @@ func testMessageExportPublicChannel(t *testing.T, rctx request.CTX, ss store.Sto
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -454,7 +454,7 @@ func testMessageExportPublicChannel(t *testing.T, rctx request.CTX, ss store.Sto
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post1, err = ss.Post().Save(rctx, post1)
|
||||
require.NoError(t, err)
|
||||
@@ -463,7 +463,7 @@ func testMessageExportPublicChannel(t *testing.T, rctx request.CTX, ss store.Sto
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime + 10,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post2, err = ss.Post().Save(rctx, post2)
|
||||
require.NoError(t, err)
|
||||
@@ -511,7 +511,7 @@ func testMessageExportPrivateChannel(t *testing.T, rctx request.CTX, ss store.St
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -558,7 +558,7 @@ func testMessageExportPrivateChannel(t *testing.T, rctx request.CTX, ss store.St
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post1, err = ss.Post().Save(rctx, post1)
|
||||
require.NoError(t, err)
|
||||
@@ -567,7 +567,7 @@ func testMessageExportPrivateChannel(t *testing.T, rctx request.CTX, ss store.St
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime + 10,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post2, err = ss.Post().Save(rctx, post2)
|
||||
require.NoError(t, err)
|
||||
@@ -617,7 +617,7 @@ func testMessageExportDirectMessageChannel(t *testing.T, rctx request.CTX, ss st
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -658,7 +658,7 @@ func testMessageExportDirectMessageChannel(t *testing.T, rctx request.CTX, ss st
|
||||
ChannelId: directMessageChannel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime + 20,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post, err = ss.Post().Save(rctx, post)
|
||||
require.NoError(t, err)
|
||||
@@ -698,7 +698,7 @@ func testMessageExportGroupMessageChannel(t *testing.T, rctx request.CTX, ss sto
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -756,7 +756,7 @@ func testMessageExportGroupMessageChannel(t *testing.T, rctx request.CTX, ss sto
|
||||
ChannelId: groupMessageChannel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime + 20,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post, err = ss.Post().Save(rctx, post)
|
||||
require.NoError(t, err)
|
||||
@@ -796,7 +796,7 @@ func testEditExportMessage(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -831,7 +831,7 @@ func testEditExportMessage(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post1, err = ss.Post().Save(rctx, post1)
|
||||
require.NoError(t, err)
|
||||
@@ -888,7 +888,7 @@ func testEditAfterExportMessage(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -923,7 +923,7 @@ func testEditAfterExportMessage(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post1, err = ss.Post().Save(rctx, post1)
|
||||
require.NoError(t, err)
|
||||
@@ -999,7 +999,7 @@ func testDeleteExportMessage(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -1034,7 +1034,7 @@ func testDeleteExportMessage(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post1, err = ss.Post().Save(rctx, post1)
|
||||
require.NoError(t, err)
|
||||
@@ -1084,7 +1084,7 @@ func testDeleteAfterExportMessage(t *testing.T, rctx request.CTX, ss store.Store
|
||||
// need a team
|
||||
team := &model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -1119,7 +1119,7 @@ func testDeleteAfterExportMessage(t *testing.T, rctx request.CTX, ss store.Store
|
||||
ChannelId: channel.Id,
|
||||
UserId: user1.Id,
|
||||
CreateAt: startTime,
|
||||
Message: NewTestId(),
|
||||
Message: NewTestID(),
|
||||
}
|
||||
post1, err = ss.Post().Save(rctx, post1)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -13,28 +13,28 @@ import (
|
||||
)
|
||||
|
||||
func TestDesktopTokensStore(t *testing.T, rctx request.CTX, ss store.Store, s SqlStore) {
|
||||
t.Run("GetUserId", func(t *testing.T) { testGetUserId(t, rctx, ss) })
|
||||
t.Run("GetUserId", func(t *testing.T) { testGetUserID(t, rctx, ss) })
|
||||
t.Run("Insert", func(t *testing.T) { testInsert(t, rctx, ss) })
|
||||
t.Run("Delete", func(t *testing.T) { testDeleteToken(t, rctx, ss) })
|
||||
t.Run("DeleteByUserId", func(t *testing.T) { testDeleteByUserId(t, rctx, ss) })
|
||||
t.Run("DeleteByUserId", func(t *testing.T) { testDeleteByUserID(t, rctx, ss) })
|
||||
t.Run("DeleteOlderThan", func(t *testing.T) { testDeleteOlderThan(t, rctx, ss) })
|
||||
}
|
||||
|
||||
func testGetUserId(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testGetUserID(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
err := ss.DesktopTokens().Insert("token_with_id", 1000, "user_id")
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("get user id", func(t *testing.T) {
|
||||
userId, err := ss.DesktopTokens().GetUserId("token_with_id", 1000)
|
||||
userID, err := ss.DesktopTokens().GetUserId("token_with_id", 1000)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "user_id", *userId)
|
||||
assert.Equal(t, "user_id", *userID)
|
||||
})
|
||||
|
||||
t.Run("get user id - expired", func(t *testing.T) {
|
||||
userId, err := ss.DesktopTokens().GetUserId("token_with_id", 10000)
|
||||
userID, err := ss.DesktopTokens().GetUserId("token_with_id", 10000)
|
||||
assert.Error(t, err)
|
||||
assert.IsType(t, &store.ErrNotFound{}, err)
|
||||
assert.Nil(t, userId)
|
||||
assert.Nil(t, userID)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ func testDeleteToken(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("delete", func(t *testing.T) {
|
||||
userId, err := ss.DesktopTokens().GetUserId("deleteable_token", 3000)
|
||||
userID, err := ss.DesktopTokens().GetUserId("deleteable_token", 3000)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "user_id", *userId)
|
||||
assert.Equal(t, "user_id", *userID)
|
||||
|
||||
err = ss.DesktopTokens().Delete("deleteable_token")
|
||||
assert.NoError(t, err)
|
||||
@@ -71,14 +71,14 @@ func testDeleteToken(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
})
|
||||
}
|
||||
|
||||
func testDeleteByUserId(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testDeleteByUserID(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
err := ss.DesktopTokens().Insert("deleteable_token_2", 4000, "deleteable_user_id")
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("delete by user id", func(t *testing.T) {
|
||||
userId, err := ss.DesktopTokens().GetUserId("deleteable_token_2", 3000)
|
||||
userID, err := ss.DesktopTokens().GetUserId("deleteable_token_2", 3000)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "deleteable_user_id", *userId)
|
||||
assert.Equal(t, "deleteable_user_id", *userID)
|
||||
|
||||
err = ss.DesktopTokens().DeleteByUserId("deleteable_user_id")
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -22,9 +22,9 @@ func TestDraftStore(t *testing.T, rctx request.CTX, ss store.Store, s SqlStore)
|
||||
t.Run("DeleteDraftsAssociatedWithPost", func(t *testing.T) { testDeleteDraftsAssociatedWithPost(t, rctx, ss) })
|
||||
t.Run("GetDraft", func(t *testing.T) { testGetDraft(t, rctx, ss) })
|
||||
t.Run("GetDraftsForUser", func(t *testing.T) { testGetDraftsForUser(t, rctx, ss) })
|
||||
t.Run("GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration", func(t *testing.T) { testGetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(t, rctx, ss) })
|
||||
t.Run("DeleteEmptyDraftsByCreateAtAndUserId", func(t *testing.T) { testDeleteEmptyDraftsByCreateAtAndUserId(t, rctx, ss) })
|
||||
t.Run("DeleteOrphanDraftsByCreateAtAndUserId", func(t *testing.T) { testDeleteOrphanDraftsByCreateAtAndUserId(t, rctx, ss) })
|
||||
t.Run("GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration", func(t *testing.T) { testGetLastCreateAtAndUserIDValuesForEmptyDraftsMigration(t, rctx, ss) })
|
||||
t.Run("DeleteEmptyDraftsByCreateAtAndUserId", func(t *testing.T) { testDeleteEmptyDraftsByCreateAtAndUserID(t, rctx, ss) })
|
||||
t.Run("DeleteOrphanDraftsByCreateAtAndUserId", func(t *testing.T) { testDeleteOrphanDraftsByCreateAtAndUserID(t, rctx, ss) })
|
||||
}
|
||||
|
||||
func testSaveDraft(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
@@ -388,26 +388,26 @@ func countDraftPages(t *testing.T, rctx request.CTX, ss store.Store) int {
|
||||
|
||||
pages := 0
|
||||
createAt := int64(0)
|
||||
userId := ""
|
||||
userID := ""
|
||||
|
||||
for {
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
|
||||
if nextCreateAt == 0 && nextUserId == "" {
|
||||
if nextCreateAt == 0 && nextUserID == "" {
|
||||
break
|
||||
}
|
||||
|
||||
// Ensure we're always making progress.
|
||||
if nextCreateAt == createAt {
|
||||
require.Greater(t, nextUserId, userId)
|
||||
require.Greater(t, nextUserID, userID)
|
||||
} else {
|
||||
require.Greater(t, nextCreateAt, createAt)
|
||||
}
|
||||
|
||||
pages++
|
||||
createAt = nextCreateAt
|
||||
userId = nextUserId
|
||||
userID = nextUserID
|
||||
}
|
||||
|
||||
return pages
|
||||
@@ -483,14 +483,14 @@ func makeDraftsWithDeletedPosts(t *testing.T, rctx request.CTX, ss store.Store,
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
}
|
||||
|
||||
func testGetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testGetLastCreateAtAndUserIDValuesForEmptyDraftsMigration(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("no drafts", func(t *testing.T) {
|
||||
clearDrafts(t, rctx, ss)
|
||||
|
||||
createAt, userId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(0, "")
|
||||
createAt, userID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(0, "")
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, createAt)
|
||||
assert.Equal(t, "", userId)
|
||||
assert.Equal(t, "", userID)
|
||||
|
||||
assert.Equal(t, 0, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
})
|
||||
@@ -510,7 +510,7 @@ func testGetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(t *testing.T, rct
|
||||
})
|
||||
}
|
||||
|
||||
func testDeleteEmptyDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testDeleteEmptyDraftsByCreateAtAndUserID(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("nil parameters", func(t *testing.T) {
|
||||
clearDrafts(t, rctx, ss)
|
||||
|
||||
@@ -522,54 +522,54 @@ func testDeleteEmptyDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, ss
|
||||
clearDrafts(t, rctx, ss)
|
||||
makeDrafts(t, ss, 100, "")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 0, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
t.Run("delete multiple pages, all empty", func(t *testing.T) {
|
||||
clearDrafts(t, rctx, ss)
|
||||
makeDrafts(t, ss, 300, "")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 2, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 1, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 0, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
t.Run("delete multiple pages, some empty", func(t *testing.T) {
|
||||
@@ -588,62 +588,62 @@ func testDeleteEmptyDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, ss
|
||||
// Verify initially 5 pages
|
||||
assert.Equal(t, 5, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
createAt, userID := int64(0), ""
|
||||
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Only deleted 50, so still 5 pages
|
||||
assert.Equal(t, 5, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Now deleted 100, so down to 4 pages
|
||||
assert.Equal(t, 4, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Only deleted 150 now, so still 4 pages
|
||||
assert.Equal(t, 4, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Now deleted all 200 empty messages, so down to 3 pages
|
||||
assert.Equal(t, 3, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
// Keep going through all pages to verify nothing else gets deleted.
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Verify we're done iterating
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
}
|
||||
|
||||
func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testDeleteOrphanDraftsByCreateAtAndUserID(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("nil parameters", func(t *testing.T) {
|
||||
clearDrafts(t, rctx, ss)
|
||||
clearPosts(t, rctx, ss)
|
||||
@@ -658,19 +658,19 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
|
||||
makeDrafts(t, ss, 100, "Okay")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 0, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
t.Run("delete multiple pages, drafts with no post", func(t *testing.T) {
|
||||
@@ -679,35 +679,35 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
|
||||
makeDrafts(t, ss, 300, "Okay")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 2, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 1, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 0, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
t.Run("delete single page, drafts with deleted post", func(t *testing.T) {
|
||||
@@ -716,19 +716,19 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
|
||||
makeDraftsWithDeletedPosts(t, rctx, ss, 100, "Okay")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 0, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
t.Run("delete multiple pages, drafts with deleted post", func(t *testing.T) {
|
||||
@@ -737,35 +737,35 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
|
||||
makeDraftsWithDeletedPosts(t, rctx, ss, 300, "Okay")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 2, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 1, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 0, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
t.Run("delete single page, drafts with non deleted post", func(t *testing.T) {
|
||||
@@ -774,20 +774,20 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
|
||||
makeDraftsWithNonDeletedPosts(t, rctx, ss, 100, "Okay")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 100, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
assert.Equal(t, 1, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
t.Run("delete multiple pages, drafts with non deleted post", func(t *testing.T) {
|
||||
@@ -796,38 +796,38 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
|
||||
makeDraftsWithNonDeletedPosts(t, rctx, ss, 300, "Okay")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
createAt, userID := int64(0), ""
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 300, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
assert.Equal(t, 3, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 300, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
assert.Equal(t, 3, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
assert.Equal(t, 300, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
assert.Equal(t, 3, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
|
||||
// This test is a bit more complicated, but it's the most realistic scenario and covers all the remaining cases
|
||||
@@ -859,43 +859,43 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
assert.Equal(t, 5, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
assert.Equal(t, 500, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
|
||||
createAt, userId := int64(0), ""
|
||||
createAt, userID := int64(0), ""
|
||||
|
||||
nextCreateAt, nextUserId, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err := ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Only deleted 50, so still 5 pages
|
||||
assert.Equal(t, 5, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
assert.Equal(t, 450, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Now deleted 150, so down to 4 pages
|
||||
assert.Equal(t, 4, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
assert.Equal(t, 350, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Now deleted 200 now, so down to 3 pages
|
||||
assert.Equal(t, 3, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
assert.Equal(t, 300, countDrafts(t, rctx, ss), "incorrect number of drafts")
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Now deleted 270 empty messages, so still 3 pages
|
||||
assert.Equal(t, 3, countDraftPages(t, rctx, ss), "incorrect number of pages")
|
||||
@@ -903,18 +903,18 @@ func testDeleteOrphanDraftsByCreateAtAndUserId(t *testing.T, rctx request.CTX, s
|
||||
|
||||
// Keep going through all pages to verify nothing else gets deleted.
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err = ss.Draft().DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
createAt, userId = nextCreateAt, nextUserId
|
||||
createAt, userID = nextCreateAt, nextUserID
|
||||
|
||||
// Verify we're done iterating
|
||||
|
||||
nextCreateAt, nextUserId, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
nextCreateAt, nextUserID, err = ss.Draft().GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 0, nextCreateAt, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserId, "should have finished iterating through drafts")
|
||||
assert.Equal(t, "", nextUserID, "should have finished iterating through drafts")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -106,34 +106,34 @@ func testFileInfoSaveGetByPath(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId := model.NewId()
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
userID := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
infos := []*model.FileInfo{
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
DeleteAt: 123,
|
||||
},
|
||||
{
|
||||
PostId: model.NewId(),
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
}
|
||||
@@ -149,7 +149,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
testCases := []struct {
|
||||
Name string
|
||||
PostId string
|
||||
PostID string
|
||||
ReadFromMaster bool
|
||||
IncludeDeleted bool
|
||||
AllowFromCache bool
|
||||
@@ -157,7 +157,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}{
|
||||
{
|
||||
Name: "Fetch from master, without deleted and without cache",
|
||||
PostId: postId,
|
||||
PostID: postID,
|
||||
ReadFromMaster: true,
|
||||
IncludeDeleted: false,
|
||||
AllowFromCache: false,
|
||||
@@ -165,7 +165,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
},
|
||||
{
|
||||
Name: "Fetch from master, with deleted and without cache",
|
||||
PostId: postId,
|
||||
PostID: postID,
|
||||
ReadFromMaster: true,
|
||||
IncludeDeleted: true,
|
||||
AllowFromCache: false,
|
||||
@@ -173,7 +173,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
},
|
||||
{
|
||||
Name: "Fetch from master, with deleted and with cache",
|
||||
PostId: postId,
|
||||
PostID: postID,
|
||||
ReadFromMaster: true,
|
||||
IncludeDeleted: true,
|
||||
AllowFromCache: true,
|
||||
@@ -181,7 +181,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
},
|
||||
{
|
||||
Name: "Fetch from replica, without deleted and without cache",
|
||||
PostId: postId,
|
||||
PostID: postID,
|
||||
ReadFromMaster: false,
|
||||
IncludeDeleted: false,
|
||||
AllowFromCache: false,
|
||||
@@ -189,7 +189,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
},
|
||||
{
|
||||
Name: "Fetch from replica, with deleted and without cache",
|
||||
PostId: postId,
|
||||
PostID: postID,
|
||||
ReadFromMaster: false,
|
||||
IncludeDeleted: true,
|
||||
AllowFromCache: false,
|
||||
@@ -197,7 +197,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
},
|
||||
{
|
||||
Name: "Fetch from replica, with deleted and without cache",
|
||||
PostId: postId,
|
||||
PostID: postID,
|
||||
ReadFromMaster: false,
|
||||
IncludeDeleted: true,
|
||||
AllowFromCache: true,
|
||||
@@ -205,7 +205,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
},
|
||||
{
|
||||
Name: "Fetch from replica, without deleted and with cache",
|
||||
PostId: postId,
|
||||
PostID: postID,
|
||||
ReadFromMaster: true,
|
||||
IncludeDeleted: false,
|
||||
AllowFromCache: true,
|
||||
@@ -216,7 +216,7 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.Name, func(t *testing.T) {
|
||||
postInfos, err := ss.FileInfo().GetForPost(
|
||||
tc.PostId,
|
||||
tc.PostID,
|
||||
tc.ReadFromMaster,
|
||||
tc.IncludeDeleted,
|
||||
tc.AllowFromCache,
|
||||
@@ -228,34 +228,34 @@ func testFileInfoGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
func testFileInfoGetForUser(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId := model.NewId()
|
||||
userId2 := model.NewId()
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
userID := model.NewId()
|
||||
userID2 := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
infos := []*model.FileInfo{
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
{
|
||||
PostId: model.NewId(),
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId2,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID2,
|
||||
Path: "file.txt",
|
||||
},
|
||||
}
|
||||
@@ -269,11 +269,11 @@ func testFileInfoGetForUser(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}(newInfo.Id)
|
||||
}
|
||||
|
||||
userPosts, err := ss.FileInfo().GetForUser(userId)
|
||||
userPosts, err := ss.FileInfo().GetForUser(userID)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, userPosts, 3)
|
||||
|
||||
userPosts, err = ss.FileInfo().GetForUser(userId2)
|
||||
userPosts, err = ss.FileInfo().GetForUser(userID2)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, userPosts, 1)
|
||||
}
|
||||
@@ -308,24 +308,24 @@ func testFileInfoGetWithOptions(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
return fileInfo
|
||||
}
|
||||
|
||||
userId1 := model.NewId()
|
||||
userId2 := model.NewId()
|
||||
userID1 := model.NewId()
|
||||
userID2 := model.NewId()
|
||||
|
||||
channelId1 := model.NewId()
|
||||
channelId2 := model.NewId()
|
||||
channelId3 := model.NewId()
|
||||
channelID1 := model.NewId()
|
||||
channelID2 := model.NewId()
|
||||
channelID3 := model.NewId()
|
||||
|
||||
post1_1 := makePost(channelId1, userId1) // post 1 by user 1
|
||||
post1_2 := makePost(channelId3, userId1) // post 2 by user 1
|
||||
post2_1 := makePost(channelId2, userId2)
|
||||
post2_2 := makePost(channelId3, userId2)
|
||||
post1_1 := makePost(channelID1, userID1) // post 1 by user 1
|
||||
post1_2 := makePost(channelID3, userID1) // post 2 by user 1
|
||||
post2_1 := makePost(channelID2, userID2)
|
||||
post2_2 := makePost(channelID3, userID2)
|
||||
|
||||
epoch := time.Date(2020, 1, 1, 1, 1, 1, 1, time.UTC)
|
||||
file1_1 := makeFile(post1_1, userId1, epoch.AddDate(0, 0, 1).Unix(), "a") // file 1 by user 1
|
||||
file1_2 := makeFile(post1_2, userId1, epoch.AddDate(0, 0, 2).Unix(), "b") // file 2 by user 1
|
||||
file1_3 := makeFile(&model.Post{}, userId1, epoch.AddDate(0, 0, 3).Unix(), "c") // file that is not attached to a post
|
||||
file2_1 := makeFile(post2_1, userId2, epoch.AddDate(0, 0, 4).Unix(), "d") // file 2 by user 1
|
||||
file2_2 := makeFile(post2_2, userId2, epoch.AddDate(0, 0, 5).Unix(), "e")
|
||||
file1_1 := makeFile(post1_1, userID1, epoch.AddDate(0, 0, 1).Unix(), "a") // file 1 by user 1
|
||||
file1_2 := makeFile(post1_2, userID1, epoch.AddDate(0, 0, 2).Unix(), "b") // file 2 by user 1
|
||||
file1_3 := makeFile(&model.Post{}, userID1, epoch.AddDate(0, 0, 3).Unix(), "c") // file that is not attached to a post
|
||||
file2_1 := makeFile(post2_1, userID2, epoch.AddDate(0, 0, 4).Unix(), "d") // file 2 by user 1
|
||||
file2_2 := makeFile(post2_2, userID2, epoch.AddDate(0, 0, 5).Unix(), "e")
|
||||
|
||||
// delete a file
|
||||
_, err := ss.FileInfo().DeleteForPost(rctx, file2_2.PostId)
|
||||
@@ -357,7 +357,7 @@ func testFileInfoGetWithOptions(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
PerPage: 10,
|
||||
Opt: &model.GetFileInfosOptions{
|
||||
IncludeDeleted: true,
|
||||
ChannelIds: []string{channelId3},
|
||||
ChannelIds: []string{channelID3},
|
||||
},
|
||||
ExpectedFileIds: []string{file1_2.Id, file2_2.Id},
|
||||
},
|
||||
@@ -367,8 +367,8 @@ func testFileInfoGetWithOptions(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
PerPage: 10,
|
||||
Opt: &model.GetFileInfosOptions{
|
||||
IncludeDeleted: true,
|
||||
UserIds: []string{userId1},
|
||||
ChannelIds: []string{channelId3},
|
||||
UserIds: []string{userID1},
|
||||
ChannelIds: []string{channelID3},
|
||||
},
|
||||
ExpectedFileIds: []string{file1_2.Id},
|
||||
},
|
||||
@@ -387,7 +387,7 @@ func testFileInfoGetWithOptions(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
Page: 0,
|
||||
PerPage: 10,
|
||||
Opt: &model.GetFileInfosOptions{
|
||||
UserIds: []string{userId1},
|
||||
UserIds: []string{userID1},
|
||||
SortBy: model.FileinfoSortByCreated,
|
||||
SortDescending: true,
|
||||
},
|
||||
@@ -418,25 +418,25 @@ func testFileInfoGetWithOptions(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
}
|
||||
}
|
||||
|
||||
type byFileInfoId []*model.FileInfo
|
||||
type byFileInfoID []*model.FileInfo
|
||||
|
||||
func (a byFileInfoId) Len() int { return len(a) }
|
||||
func (a byFileInfoId) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a byFileInfoId) Less(i, j int) bool { return a[i].Id < a[j].Id }
|
||||
func (a byFileInfoID) Len() int { return len(a) }
|
||||
func (a byFileInfoID) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a byFileInfoID) Less(i, j int) bool { return a[i].Id < a[j].Id }
|
||||
|
||||
func testFileInfoAttachToPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("should attach files", func(t *testing.T) {
|
||||
userId := model.NewId()
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
userID := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
info1, err := ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
CreatorId: userId,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
info2, err := ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
CreatorId: userId,
|
||||
CreatorId: userID,
|
||||
Path: "file2.txt",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -444,49 +444,49 @@ func testFileInfoAttachToPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.Equal(t, "", info1.PostId)
|
||||
require.Equal(t, "", info2.PostId)
|
||||
|
||||
err = ss.FileInfo().AttachToPost(rctx, info1.Id, postId, channelId, userId)
|
||||
err = ss.FileInfo().AttachToPost(rctx, info1.Id, postID, channelID, userID)
|
||||
assert.NoError(t, err)
|
||||
info1.PostId = postId
|
||||
info1.ChannelId = channelId
|
||||
info1.PostId = postID
|
||||
info1.ChannelId = channelID
|
||||
|
||||
err = ss.FileInfo().AttachToPost(rctx, info2.Id, postId, channelId, userId)
|
||||
err = ss.FileInfo().AttachToPost(rctx, info2.Id, postID, channelID, userID)
|
||||
assert.NoError(t, err)
|
||||
info2.PostId = postId
|
||||
info2.ChannelId = channelId
|
||||
info2.PostId = postID
|
||||
info2.ChannelId = channelID
|
||||
|
||||
data, err := ss.FileInfo().GetForPost(postId, true, false, false)
|
||||
data, err := ss.FileInfo().GetForPost(postID, true, false, false)
|
||||
require.NoError(t, err)
|
||||
|
||||
expected := []*model.FileInfo{info1, info2}
|
||||
sort.Sort(byFileInfoId(expected))
|
||||
sort.Sort(byFileInfoId(data))
|
||||
sort.Sort(byFileInfoID(expected))
|
||||
sort.Sort(byFileInfoID(data))
|
||||
assert.EqualValues(t, expected, data)
|
||||
})
|
||||
|
||||
t.Run("should not attach files to multiple posts", func(t *testing.T) {
|
||||
userId := model.NewId()
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
userID := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
info, err := ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
CreatorId: userId,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, "", info.PostId)
|
||||
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, model.NewId(), channelId, userId)
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, model.NewId(), channelID, userID)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, postId, channelId, userId)
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, postID, channelID, userID)
|
||||
require.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("should not attach files owned from a different user", func(t *testing.T) {
|
||||
userId := model.NewId()
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
userID := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
info, err := ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
CreatorId: model.NewId(),
|
||||
@@ -496,13 +496,13 @@ func testFileInfoAttachToPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
require.Equal(t, "", info.PostId)
|
||||
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, postId, channelId, userId)
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, postID, channelID, userID)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("should attach files uploaded by nouser", func(t *testing.T) {
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
info, err := ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
CreatorId: "nouser",
|
||||
@@ -511,46 +511,46 @@ func testFileInfoAttachToPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "", info.PostId)
|
||||
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, postId, channelId, model.NewId())
|
||||
err = ss.FileInfo().AttachToPost(rctx, info.Id, postID, channelID, model.NewId())
|
||||
require.NoError(t, err)
|
||||
|
||||
data, err := ss.FileInfo().GetForPost(postId, true, false, false)
|
||||
data, err := ss.FileInfo().GetForPost(postID, true, false, false)
|
||||
require.NoError(t, err)
|
||||
info.PostId = postId
|
||||
info.ChannelId = channelId
|
||||
info.PostId = postID
|
||||
info.ChannelId = channelID
|
||||
assert.EqualValues(t, []*model.FileInfo{info}, data)
|
||||
})
|
||||
}
|
||||
|
||||
func testFileInfoDeleteForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId := model.NewId()
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
userID := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
infos := []*model.FileInfo{
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
DeleteAt: 123,
|
||||
},
|
||||
{
|
||||
PostId: model.NewId(),
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
},
|
||||
}
|
||||
@@ -564,10 +564,10 @@ func testFileInfoDeleteForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}(newInfo.Id)
|
||||
}
|
||||
|
||||
_, err := ss.FileInfo().DeleteForPost(rctx, postId)
|
||||
_, err := ss.FileInfo().DeleteForPost(rctx, postID)
|
||||
require.NoError(t, err)
|
||||
|
||||
infos, err = ss.FileInfo().GetForPost(postId, true, false, false)
|
||||
infos, err = ss.FileInfo().GetForPost(postID, true, false, false)
|
||||
require.NoError(t, err)
|
||||
assert.Empty(t, infos)
|
||||
}
|
||||
@@ -586,12 +586,12 @@ func testFileInfoPermanentDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
}
|
||||
|
||||
func testFileInfoPermanentDeleteBatch(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
_, err := ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: model.NewId(),
|
||||
Path: "file.txt",
|
||||
CreateAt: 1000,
|
||||
@@ -599,8 +599,8 @@ func testFileInfoPermanentDeleteBatch(t *testing.T, rctx request.CTX, ss store.S
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: model.NewId(),
|
||||
Path: "file.txt",
|
||||
CreateAt: 1200,
|
||||
@@ -608,8 +608,8 @@ func testFileInfoPermanentDeleteBatch(t *testing.T, rctx request.CTX, ss store.S
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: model.NewId(),
|
||||
Path: "file.txt",
|
||||
CreateAt: 2000,
|
||||
@@ -617,8 +617,8 @@ func testFileInfoPermanentDeleteBatch(t *testing.T, rctx request.CTX, ss store.S
|
||||
require.NoError(t, err)
|
||||
|
||||
bookmarkFile, err := ss.FileInfo().Save(rctx, &model.FileInfo{ // should not be deleted
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: model.BookmarkFileOwner,
|
||||
Path: "file.txt",
|
||||
CreateAt: 1000,
|
||||
@@ -626,32 +626,32 @@ func testFileInfoPermanentDeleteBatch(t *testing.T, rctx request.CTX, ss store.S
|
||||
defer ss.FileInfo().PermanentDelete(rctx, bookmarkFile.Id)
|
||||
require.NoError(t, err)
|
||||
|
||||
postFiles, err := ss.FileInfo().GetForPost(postId, true, false, false)
|
||||
postFiles, err := ss.FileInfo().GetForPost(postID, true, false, false)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, postFiles, 4)
|
||||
|
||||
_, err = ss.FileInfo().PermanentDeleteBatch(rctx, 1500, 1000)
|
||||
require.NoError(t, err)
|
||||
|
||||
postFiles, err = ss.FileInfo().GetForPost(postId, true, false, false)
|
||||
postFiles, err = ss.FileInfo().GetForPost(postID, true, false, false)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, postFiles, 2)
|
||||
}
|
||||
|
||||
func testFileInfoPermanentDeleteByUser(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId := model.NewId()
|
||||
postId := model.NewId()
|
||||
channelId := model.NewId()
|
||||
userID := model.NewId()
|
||||
postID := model.NewId()
|
||||
channelID := model.NewId()
|
||||
|
||||
_, err := ss.FileInfo().Save(rctx, &model.FileInfo{
|
||||
PostId: postId,
|
||||
ChannelId: channelId,
|
||||
CreatorId: userId,
|
||||
PostId: postID,
|
||||
ChannelId: channelID,
|
||||
CreatorId: userID,
|
||||
Path: "file.txt",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = ss.FileInfo().PermanentDeleteByUser(rctx, userId)
|
||||
_, err = ss.FileInfo().PermanentDeleteByUser(rctx, userID)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
|
||||
@@ -2975,7 +2975,7 @@ func testGetGroupsAssociatedToChannelsByTeam(t *testing.T, rctx request.CTX, ss
|
||||
CompanyName: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -3218,7 +3218,7 @@ func testGetGroupsByTeam(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
CompanyName: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -3272,7 +3272,7 @@ func testGetGroupsByTeam(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
CompanyName: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamInvite,
|
||||
}
|
||||
@@ -3464,7 +3464,7 @@ func testGetGroups(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
CompanyName: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamOpen,
|
||||
GroupConstrained: model.NewPointer(true),
|
||||
@@ -3531,7 +3531,7 @@ func testGetGroups(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
CompanyName: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamInvite,
|
||||
}
|
||||
@@ -3656,7 +3656,7 @@ func testGetGroups(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
CompanyName: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamInvite,
|
||||
}
|
||||
@@ -4007,7 +4007,7 @@ func testTeamMembersMinusGroupMembers(t *testing.T, rctx request.CTX, ss store.S
|
||||
CompanyName: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamOpen,
|
||||
GroupConstrained: model.NewPointer(true),
|
||||
@@ -4475,7 +4475,7 @@ func groupTestAdminRoleGroupsForSyncableMemberTeam(t *testing.T, rctx request.CT
|
||||
|
||||
team := &model.Team{
|
||||
DisplayName: "A Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
team, nErr := ss.Team().Save(team)
|
||||
@@ -4578,7 +4578,7 @@ func groupTestPermittedSyncableAdminsTeam(t *testing.T, rctx request.CTX, ss sto
|
||||
|
||||
team := &model.Team{
|
||||
DisplayName: "A Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
team, nErr := ss.Team().Save(team)
|
||||
@@ -5034,7 +5034,7 @@ func groupTestGroupTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
Description: model.NewId(),
|
||||
AllowOpenInvite: false,
|
||||
InviteId: model.NewId(),
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: model.NewId() + "@simulator.amazonses.com",
|
||||
Type: model.TeamOpen,
|
||||
})
|
||||
|
||||
@@ -14,9 +14,9 @@ type AuditStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: user_id, offset, limit
|
||||
func (_m *AuditStore) Get(user_id string, offset int, limit int) (model.Audits, error) {
|
||||
ret := _m.Called(user_id, offset, limit)
|
||||
// Get provides a mock function with given fields: userID, offset, limit
|
||||
func (_m *AuditStore) Get(userID string, offset int, limit int) (model.Audits, error) {
|
||||
ret := _m.Called(userID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
@@ -25,10 +25,10 @@ func (_m *AuditStore) Get(user_id string, offset int, limit int) (model.Audits,
|
||||
var r0 model.Audits
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) (model.Audits, error)); ok {
|
||||
return rf(user_id, offset, limit)
|
||||
return rf(userID, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) model.Audits); ok {
|
||||
r0 = rf(user_id, offset, limit)
|
||||
r0 = rf(userID, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.Audits)
|
||||
@@ -36,7 +36,7 @@ func (_m *AuditStore) Get(user_id string, offset int, limit int) (model.Audits,
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(user_id, offset, limit)
|
||||
r1 = rf(userID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ type ChannelBookmarkStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: bookmarkId, deleteFile
|
||||
func (_m *ChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) error {
|
||||
ret := _m.Called(bookmarkId, deleteFile)
|
||||
// Delete provides a mock function with given fields: bookmarkID, deleteFile
|
||||
func (_m *ChannelBookmarkStore) Delete(bookmarkID string, deleteFile bool) error {
|
||||
ret := _m.Called(bookmarkID, deleteFile)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
@@ -24,7 +24,7 @@ func (_m *ChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) error
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) error); ok {
|
||||
r0 = rf(bookmarkId, deleteFile)
|
||||
r0 = rf(bookmarkID, deleteFile)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -32,9 +32,9 @@ func (_m *ChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) error
|
||||
return r0
|
||||
}
|
||||
|
||||
// ErrorIfBookmarkFileInfoAlreadyAttached provides a mock function with given fields: fileId
|
||||
func (_m *ChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileId string) error {
|
||||
ret := _m.Called(fileId)
|
||||
// ErrorIfBookmarkFileInfoAlreadyAttached provides a mock function with given fields: fileID
|
||||
func (_m *ChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileID string) error {
|
||||
ret := _m.Called(fileID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ErrorIfBookmarkFileInfoAlreadyAttached")
|
||||
@@ -42,7 +42,7 @@ func (_m *ChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileId st
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(fileId)
|
||||
r0 = rf(fileID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -80,9 +80,9 @@ func (_m *ChannelBookmarkStore) Get(Id string, includeDeleted bool) (*model.Chan
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetBookmarksForChannelSince provides a mock function with given fields: channelId, since
|
||||
func (_m *ChannelBookmarkStore) GetBookmarksForChannelSince(channelId string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(channelId, since)
|
||||
// GetBookmarksForChannelSince provides a mock function with given fields: channelID, since
|
||||
func (_m *ChannelBookmarkStore) GetBookmarksForChannelSince(channelID string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(channelID, since)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetBookmarksForChannelSince")
|
||||
@@ -91,10 +91,10 @@ func (_m *ChannelBookmarkStore) GetBookmarksForChannelSince(channelId string, si
|
||||
var r0 []*model.ChannelBookmarkWithFileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) ([]*model.ChannelBookmarkWithFileInfo, error)); ok {
|
||||
return rf(channelId, since)
|
||||
return rf(channelID, since)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64) []*model.ChannelBookmarkWithFileInfo); ok {
|
||||
r0 = rf(channelId, since)
|
||||
r0 = rf(channelID, since)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelBookmarkWithFileInfo)
|
||||
@@ -102,7 +102,7 @@ func (_m *ChannelBookmarkStore) GetBookmarksForChannelSince(channelId string, si
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64) error); ok {
|
||||
r1 = rf(channelId, since)
|
||||
r1 = rf(channelID, since)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -158,9 +158,9 @@ func (_m *ChannelBookmarkStore) Update(bookmark *model.ChannelBookmark) error {
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateSortOrder provides a mock function with given fields: bookmarkId, channelId, newIndex
|
||||
func (_m *ChannelBookmarkStore) UpdateSortOrder(bookmarkId string, channelId string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(bookmarkId, channelId, newIndex)
|
||||
// UpdateSortOrder provides a mock function with given fields: bookmarkID, channelID, newIndex
|
||||
func (_m *ChannelBookmarkStore) UpdateSortOrder(bookmarkID string, channelID string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
ret := _m.Called(bookmarkID, channelID, newIndex)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateSortOrder")
|
||||
@@ -169,10 +169,10 @@ func (_m *ChannelBookmarkStore) UpdateSortOrder(bookmarkId string, channelId str
|
||||
var r0 []*model.ChannelBookmarkWithFileInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) ([]*model.ChannelBookmarkWithFileInfo, error)); ok {
|
||||
return rf(bookmarkId, channelId, newIndex)
|
||||
return rf(bookmarkID, channelID, newIndex)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, int64) []*model.ChannelBookmarkWithFileInfo); ok {
|
||||
r0 = rf(bookmarkId, channelId, newIndex)
|
||||
r0 = rf(bookmarkID, channelID, newIndex)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ChannelBookmarkWithFileInfo)
|
||||
@@ -180,7 +180,7 @@ func (_m *ChannelBookmarkStore) UpdateSortOrder(bookmarkId string, channelId str
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, int64) error); ok {
|
||||
r1 = rf(bookmarkId, channelId, newIndex)
|
||||
r1 = rf(bookmarkID, channelID, newIndex)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -712,9 +712,9 @@ func (_m *ChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterID st
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByName provides a mock function with given fields: team_id, name, allowFromCache
|
||||
func (_m *ChannelStore) GetByName(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
ret := _m.Called(team_id, name, allowFromCache)
|
||||
// GetByName provides a mock function with given fields: teamID, name, allowFromCache
|
||||
func (_m *ChannelStore) GetByName(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
ret := _m.Called(teamID, name, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByName")
|
||||
@@ -723,10 +723,10 @@ func (_m *ChannelStore) GetByName(team_id string, name string, allowFromCache bo
|
||||
var r0 *model.Channel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, error)); ok {
|
||||
return rf(team_id, name, allowFromCache)
|
||||
return rf(teamID, name, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok {
|
||||
r0 = rf(team_id, name, allowFromCache)
|
||||
r0 = rf(teamID, name, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Channel)
|
||||
@@ -734,7 +734,7 @@ func (_m *ChannelStore) GetByName(team_id string, name string, allowFromCache bo
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) error); ok {
|
||||
r1 = rf(team_id, name, allowFromCache)
|
||||
r1 = rf(teamID, name, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -742,9 +742,9 @@ func (_m *ChannelStore) GetByName(team_id string, name string, allowFromCache bo
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByNameIncludeDeleted provides a mock function with given fields: team_id, name, allowFromCache
|
||||
func (_m *ChannelStore) GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
ret := _m.Called(team_id, name, allowFromCache)
|
||||
// GetByNameIncludeDeleted provides a mock function with given fields: teamID, name, allowFromCache
|
||||
func (_m *ChannelStore) GetByNameIncludeDeleted(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
ret := _m.Called(teamID, name, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByNameIncludeDeleted")
|
||||
@@ -753,10 +753,10 @@ func (_m *ChannelStore) GetByNameIncludeDeleted(team_id string, name string, all
|
||||
var r0 *model.Channel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, error)); ok {
|
||||
return rf(team_id, name, allowFromCache)
|
||||
return rf(teamID, name, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok {
|
||||
r0 = rf(team_id, name, allowFromCache)
|
||||
r0 = rf(teamID, name, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Channel)
|
||||
@@ -764,7 +764,7 @@ func (_m *ChannelStore) GetByNameIncludeDeleted(team_id string, name string, all
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool) error); ok {
|
||||
r1 = rf(team_id, name, allowFromCache)
|
||||
r1 = rf(teamID, name, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -772,9 +772,9 @@ func (_m *ChannelStore) GetByNameIncludeDeleted(team_id string, name string, all
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByNames provides a mock function with given fields: team_id, names, allowFromCache
|
||||
func (_m *ChannelStore) GetByNames(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
ret := _m.Called(team_id, names, allowFromCache)
|
||||
// GetByNames provides a mock function with given fields: teamID, names, allowFromCache
|
||||
func (_m *ChannelStore) GetByNames(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
ret := _m.Called(teamID, names, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByNames")
|
||||
@@ -783,10 +783,10 @@ func (_m *ChannelStore) GetByNames(team_id string, names []string, allowFromCach
|
||||
var r0 []*model.Channel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string, bool) ([]*model.Channel, error)); ok {
|
||||
return rf(team_id, names, allowFromCache)
|
||||
return rf(teamID, names, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string, bool) []*model.Channel); ok {
|
||||
r0 = rf(team_id, names, allowFromCache)
|
||||
r0 = rf(teamID, names, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Channel)
|
||||
@@ -794,7 +794,7 @@ func (_m *ChannelStore) GetByNames(team_id string, names []string, allowFromCach
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string, bool) error); ok {
|
||||
r1 = rf(team_id, names, allowFromCache)
|
||||
r1 = rf(teamID, names, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -802,9 +802,9 @@ func (_m *ChannelStore) GetByNames(team_id string, names []string, allowFromCach
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetByNamesIncludeDeleted provides a mock function with given fields: team_id, names, allowFromCache
|
||||
func (_m *ChannelStore) GetByNamesIncludeDeleted(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
ret := _m.Called(team_id, names, allowFromCache)
|
||||
// GetByNamesIncludeDeleted provides a mock function with given fields: teamID, names, allowFromCache
|
||||
func (_m *ChannelStore) GetByNamesIncludeDeleted(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
ret := _m.Called(teamID, names, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetByNamesIncludeDeleted")
|
||||
@@ -813,10 +813,10 @@ func (_m *ChannelStore) GetByNamesIncludeDeleted(team_id string, names []string,
|
||||
var r0 []*model.Channel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string, bool) ([]*model.Channel, error)); ok {
|
||||
return rf(team_id, names, allowFromCache)
|
||||
return rf(teamID, names, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string, bool) []*model.Channel); ok {
|
||||
r0 = rf(team_id, names, allowFromCache)
|
||||
r0 = rf(teamID, names, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Channel)
|
||||
@@ -824,7 +824,7 @@ func (_m *ChannelStore) GetByNamesIncludeDeleted(team_id string, names []string,
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string, bool) error); ok {
|
||||
r1 = rf(team_id, names, allowFromCache)
|
||||
r1 = rf(teamID, names, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -1210,9 +1210,9 @@ func (_m *ChannelStore) GetChannelsWithUnreadsAndWithMentions(ctx context.Contex
|
||||
return r0, r1, r2, r3
|
||||
}
|
||||
|
||||
// GetDeleted provides a mock function with given fields: team_id, offset, limit, userID
|
||||
func (_m *ChannelStore) GetDeleted(team_id string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
ret := _m.Called(team_id, offset, limit, userID)
|
||||
// GetDeleted provides a mock function with given fields: teamID, offset, limit, userID
|
||||
func (_m *ChannelStore) GetDeleted(teamID string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
ret := _m.Called(teamID, offset, limit, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetDeleted")
|
||||
@@ -1221,10 +1221,10 @@ func (_m *ChannelStore) GetDeleted(team_id string, offset int, limit int, userID
|
||||
var r0 model.ChannelList
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int, int, string) (model.ChannelList, error)); ok {
|
||||
return rf(team_id, offset, limit, userID)
|
||||
return rf(teamID, offset, limit, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int, int, string) model.ChannelList); ok {
|
||||
r0 = rf(team_id, offset, limit, userID)
|
||||
r0 = rf(teamID, offset, limit, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.ChannelList)
|
||||
@@ -1232,7 +1232,7 @@ func (_m *ChannelStore) GetDeleted(team_id string, offset int, limit int, userID
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int, string) error); ok {
|
||||
r1 = rf(team_id, offset, limit, userID)
|
||||
r1 = rf(teamID, offset, limit, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -1240,9 +1240,9 @@ func (_m *ChannelStore) GetDeleted(team_id string, offset int, limit int, userID
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetDeletedByName provides a mock function with given fields: team_id, name
|
||||
func (_m *ChannelStore) GetDeletedByName(team_id string, name string) (*model.Channel, error) {
|
||||
ret := _m.Called(team_id, name)
|
||||
// GetDeletedByName provides a mock function with given fields: teamID, name
|
||||
func (_m *ChannelStore) GetDeletedByName(teamID string, name string) (*model.Channel, error) {
|
||||
ret := _m.Called(teamID, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetDeletedByName")
|
||||
@@ -1251,10 +1251,10 @@ func (_m *ChannelStore) GetDeletedByName(team_id string, name string) (*model.Ch
|
||||
var r0 *model.Channel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.Channel, error)); ok {
|
||||
return rf(team_id, name)
|
||||
return rf(teamID, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok {
|
||||
r0 = rf(team_id, name)
|
||||
r0 = rf(teamID, name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Channel)
|
||||
@@ -1262,7 +1262,7 @@ func (_m *ChannelStore) GetDeletedByName(team_id string, name string) (*model.Ch
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(team_id, name)
|
||||
r1 = rf(teamID, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -2802,9 +2802,9 @@ func (_m *ChannelStore) SetDeleteAt(channelID string, deleteAt int64, updateAt i
|
||||
return r0
|
||||
}
|
||||
|
||||
// SetShared provides a mock function with given fields: channelId, shared
|
||||
func (_m *ChannelStore) SetShared(channelId string, shared bool) error {
|
||||
ret := _m.Called(channelId, shared)
|
||||
// SetShared provides a mock function with given fields: channelID, shared
|
||||
func (_m *ChannelStore) SetShared(channelID string, shared bool) error {
|
||||
ret := _m.Called(channelID, shared)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetShared")
|
||||
@@ -2812,7 +2812,7 @@ func (_m *ChannelStore) SetShared(channelId string, shared bool) error {
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) error); ok {
|
||||
r0 = rf(channelId, shared)
|
||||
r0 = rf(channelID, shared)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ func (_m *DesktopTokensStore) Delete(token string) error {
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteByUserId provides a mock function with given fields: userId
|
||||
func (_m *DesktopTokensStore) DeleteByUserId(userId string) error {
|
||||
ret := _m.Called(userId)
|
||||
// DeleteByUserId provides a mock function with given fields: userID
|
||||
func (_m *DesktopTokensStore) DeleteByUserId(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteByUserId")
|
||||
@@ -39,7 +39,7 @@ func (_m *DesktopTokensStore) DeleteByUserId(userId string) error {
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userId)
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -95,9 +95,9 @@ func (_m *DesktopTokensStore) GetUserId(token string, minCreatedAt int64) (*stri
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Insert provides a mock function with given fields: token, createAt, userId
|
||||
func (_m *DesktopTokensStore) Insert(token string, createAt int64, userId string) error {
|
||||
ret := _m.Called(token, createAt, userId)
|
||||
// Insert provides a mock function with given fields: token, createAt, userID
|
||||
func (_m *DesktopTokensStore) Insert(token string, createAt int64, userID string) error {
|
||||
ret := _m.Called(token, createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Insert")
|
||||
@@ -105,7 +105,7 @@ func (_m *DesktopTokensStore) Insert(token string, createAt int64, userId string
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64, string) error); ok {
|
||||
r0 = rf(token, createAt, userId)
|
||||
r0 = rf(token, createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ func (_m *DraftStore) DeleteDraftsAssociatedWithPost(channelID string, rootID st
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteEmptyDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userId
|
||||
func (_m *DraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
ret := _m.Called(createAt, userId)
|
||||
// DeleteEmptyDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userID
|
||||
func (_m *DraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
ret := _m.Called(createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteEmptyDraftsByCreateAtAndUserId")
|
||||
@@ -60,7 +60,7 @@ func (_m *DraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userI
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int64, string) error); ok {
|
||||
r0 = rf(createAt, userId)
|
||||
r0 = rf(createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -68,9 +68,9 @@ func (_m *DraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userI
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOrphanDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userId
|
||||
func (_m *DraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
ret := _m.Called(createAt, userId)
|
||||
// DeleteOrphanDraftsByCreateAtAndUserId provides a mock function with given fields: createAt, userID
|
||||
func (_m *DraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
ret := _m.Called(createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteOrphanDraftsByCreateAtAndUserId")
|
||||
@@ -78,7 +78,7 @@ func (_m *DraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, user
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(int64, string) error); ok {
|
||||
r0 = rf(createAt, userId)
|
||||
r0 = rf(createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -146,9 +146,9 @@ func (_m *DraftStore) GetDraftsForUser(userID string, teamID string) ([]*model.D
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration provides a mock function with given fields: createAt, userId
|
||||
func (_m *DraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userId string) (int64, string, error) {
|
||||
ret := _m.Called(createAt, userId)
|
||||
// GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration provides a mock function with given fields: createAt, userID
|
||||
func (_m *DraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userID string) (int64, string, error) {
|
||||
ret := _m.Called(createAt, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration")
|
||||
@@ -158,22 +158,22 @@ func (_m *DraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(crea
|
||||
var r1 string
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(int64, string) (int64, string, error)); ok {
|
||||
return rf(createAt, userId)
|
||||
return rf(createAt, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, string) int64); ok {
|
||||
r0 = rf(createAt, userId)
|
||||
r0 = rf(createAt, userID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(int64, string) string); ok {
|
||||
r1 = rf(createAt, userId)
|
||||
r1 = rf(createAt, userID)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(int64, string) error); ok {
|
||||
r2 = rf(createAt, userId)
|
||||
r2 = rf(createAt, userID)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@ func (_m *NotifyAdminStore) Get(trial bool) ([]*model.NotifyAdminData, error) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetDataByUserIdAndFeature provides a mock function with given fields: userId, feature
|
||||
func (_m *NotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
ret := _m.Called(userId, feature)
|
||||
// GetDataByUserIdAndFeature provides a mock function with given fields: userID, feature
|
||||
func (_m *NotifyAdminStore) GetDataByUserIdAndFeature(userID string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
ret := _m.Called(userID, feature)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetDataByUserIdAndFeature")
|
||||
@@ -73,10 +73,10 @@ func (_m *NotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature mod
|
||||
var r0 []*model.NotifyAdminData
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, model.MattermostFeature) ([]*model.NotifyAdminData, error)); ok {
|
||||
return rf(userId, feature)
|
||||
return rf(userID, feature)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, model.MattermostFeature) []*model.NotifyAdminData); ok {
|
||||
r0 = rf(userId, feature)
|
||||
r0 = rf(userID, feature)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.NotifyAdminData)
|
||||
@@ -84,7 +84,7 @@ func (_m *NotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature mod
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, model.MattermostFeature) error); ok {
|
||||
r1 = rf(userId, feature)
|
||||
r1 = rf(userID, feature)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -122,9 +122,9 @@ func (_m *NotifyAdminStore) Save(data *model.NotifyAdminData) (*model.NotifyAdmi
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: userId, requiredPlan, requiredFeature, now
|
||||
func (_m *NotifyAdminStore) Update(userId string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
ret := _m.Called(userId, requiredPlan, requiredFeature, now)
|
||||
// Update provides a mock function with given fields: userID, requiredPlan, requiredFeature, now
|
||||
func (_m *NotifyAdminStore) Update(userID string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
ret := _m.Called(userID, requiredPlan, requiredFeature, now)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Update")
|
||||
@@ -132,7 +132,7 @@ func (_m *NotifyAdminStore) Update(userId string, requiredPlan string, requiredF
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.MattermostFeature, int64) error); ok {
|
||||
r0 = rf(userId, requiredPlan, requiredFeature, now)
|
||||
r0 = rf(userID, requiredPlan, requiredFeature, now)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ func (_m *OAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessDa
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAccessDataByUserForApp provides a mock function with given fields: userID, clientId
|
||||
func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientId string) ([]*model.AccessData, error) {
|
||||
ret := _m.Called(userID, clientId)
|
||||
// GetAccessDataByUserForApp provides a mock function with given fields: userID, clientID
|
||||
func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientID string) ([]*model.AccessData, error) {
|
||||
ret := _m.Called(userID, clientID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAccessDataByUserForApp")
|
||||
@@ -103,10 +103,10 @@ func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientId string)
|
||||
var r0 []*model.AccessData
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) ([]*model.AccessData, error)); ok {
|
||||
return rf(userID, clientId)
|
||||
return rf(userID, clientID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) []*model.AccessData); ok {
|
||||
r0 = rf(userID, clientId)
|
||||
r0 = rf(userID, clientID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.AccessData)
|
||||
@@ -114,7 +114,7 @@ func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientId string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, clientId)
|
||||
r1 = rf(userID, clientID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -272,9 +272,9 @@ func (_m *OAuthStore) GetAuthorizedApps(userID string, offset int, limit int) ([
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetPreviousAccessData provides a mock function with given fields: userID, clientId
|
||||
func (_m *OAuthStore) GetPreviousAccessData(userID string, clientId string) (*model.AccessData, error) {
|
||||
ret := _m.Called(userID, clientId)
|
||||
// GetPreviousAccessData provides a mock function with given fields: userID, clientID
|
||||
func (_m *OAuthStore) GetPreviousAccessData(userID string, clientID string) (*model.AccessData, error) {
|
||||
ret := _m.Called(userID, clientID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPreviousAccessData")
|
||||
@@ -283,10 +283,10 @@ func (_m *OAuthStore) GetPreviousAccessData(userID string, clientId string) (*mo
|
||||
var r0 *model.AccessData
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.AccessData, error)); ok {
|
||||
return rf(userID, clientId)
|
||||
return rf(userID, clientID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.AccessData); ok {
|
||||
r0 = rf(userID, clientId)
|
||||
r0 = rf(userID, clientID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AccessData)
|
||||
@@ -294,7 +294,7 @@ func (_m *OAuthStore) GetPreviousAccessData(userID string, clientId string) (*mo
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userID, clientId)
|
||||
r1 = rf(userID, clientID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -374,9 +374,9 @@ func (_m *OAuthStore) RemoveAuthData(code string) error {
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAuthDataByClientId provides a mock function with given fields: clientId, userId
|
||||
func (_m *OAuthStore) RemoveAuthDataByClientId(clientId string, userId string) error {
|
||||
ret := _m.Called(clientId, userId)
|
||||
// RemoveAuthDataByClientId provides a mock function with given fields: clientID, userID
|
||||
func (_m *OAuthStore) RemoveAuthDataByClientId(clientID string, userID string) error {
|
||||
ret := _m.Called(clientID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAuthDataByClientId")
|
||||
@@ -384,7 +384,7 @@ func (_m *OAuthStore) RemoveAuthDataByClientId(clientId string, userId string) e
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(clientId, userId)
|
||||
r0 = rf(clientID, userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -392,9 +392,9 @@ func (_m *OAuthStore) RemoveAuthDataByClientId(clientId string, userId string) e
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveAuthDataByUserId provides a mock function with given fields: userId
|
||||
func (_m *OAuthStore) RemoveAuthDataByUserId(userId string) error {
|
||||
ret := _m.Called(userId)
|
||||
// RemoveAuthDataByUserId provides a mock function with given fields: userID
|
||||
func (_m *OAuthStore) RemoveAuthDataByUserId(userID string) error {
|
||||
ret := _m.Called(userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAuthDataByUserId")
|
||||
@@ -402,7 +402,7 @@ func (_m *OAuthStore) RemoveAuthDataByUserId(userId string) error {
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userId)
|
||||
r0 = rf(userID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ type PostPriorityStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// GetForPost provides a mock function with given fields: postId
|
||||
func (_m *PostPriorityStore) GetForPost(postId string) (*model.PostPriority, error) {
|
||||
ret := _m.Called(postId)
|
||||
// GetForPost provides a mock function with given fields: postID
|
||||
func (_m *PostPriorityStore) GetForPost(postID string) (*model.PostPriority, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPost")
|
||||
@@ -25,10 +25,10 @@ func (_m *PostPriorityStore) GetForPost(postId string) (*model.PostPriority, err
|
||||
var r0 *model.PostPriority
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.PostPriority, error)); ok {
|
||||
return rf(postId)
|
||||
return rf(postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.PostPriority); ok {
|
||||
r0 = rf(postId)
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.PostPriority)
|
||||
@@ -36,7 +36,7 @@ func (_m *PostPriorityStore) GetForPost(postId string) (*model.PostPriority, err
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postId)
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -191,9 +191,9 @@ func (_m *PostStore) GetDirectPostParentsForExportAfter(limit int, afterID strin
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetEditHistoryForPost provides a mock function with given fields: postId
|
||||
func (_m *PostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error) {
|
||||
ret := _m.Called(postId)
|
||||
// GetEditHistoryForPost provides a mock function with given fields: postID
|
||||
func (_m *PostStore) GetEditHistoryForPost(postID string) ([]*model.Post, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetEditHistoryForPost")
|
||||
@@ -202,10 +202,10 @@ func (_m *PostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error)
|
||||
var r0 []*model.Post
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) ([]*model.Post, error)); ok {
|
||||
return rf(postId)
|
||||
return rf(postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) []*model.Post); ok {
|
||||
r0 = rf(postId)
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Post)
|
||||
@@ -213,7 +213,7 @@ func (_m *PostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postId)
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -946,9 +946,9 @@ func (_m *PostStore) GetSingle(rctx request.CTX, id string, inclDeleted bool) (*
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// HasAutoResponsePostByUserSince provides a mock function with given fields: options, userId
|
||||
func (_m *PostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userId string) (bool, error) {
|
||||
ret := _m.Called(options, userId)
|
||||
// HasAutoResponsePostByUserSince provides a mock function with given fields: options, userID
|
||||
func (_m *PostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userID string) (bool, error) {
|
||||
ret := _m.Called(options, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for HasAutoResponsePostByUserSince")
|
||||
@@ -957,16 +957,16 @@ func (_m *PostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceO
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(model.GetPostsSinceOptions, string) (bool, error)); ok {
|
||||
return rf(options, userId)
|
||||
return rf(options, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(model.GetPostsSinceOptions, string) bool); ok {
|
||||
r0 = rf(options, userId)
|
||||
r0 = rf(options, userID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(model.GetPostsSinceOptions, string) error); ok {
|
||||
r1 = rf(options, userId)
|
||||
r1 = rf(options, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -120,9 +120,9 @@ func (_m *ReactionStore) DeleteOrphanedRowsByIds(r *model.RetentionIdsForDeletio
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ExistsOnPost provides a mock function with given fields: postId, emojiName
|
||||
func (_m *ReactionStore) ExistsOnPost(postId string, emojiName string) (bool, error) {
|
||||
ret := _m.Called(postId, emojiName)
|
||||
// ExistsOnPost provides a mock function with given fields: postID, emojiName
|
||||
func (_m *ReactionStore) ExistsOnPost(postID string, emojiName string) (bool, error) {
|
||||
ret := _m.Called(postID, emojiName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ExistsOnPost")
|
||||
@@ -131,16 +131,16 @@ func (_m *ReactionStore) ExistsOnPost(postId string, emojiName string) (bool, er
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (bool, error)); ok {
|
||||
return rf(postId, emojiName)
|
||||
return rf(postID, emojiName)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) bool); ok {
|
||||
r0 = rf(postId, emojiName)
|
||||
r0 = rf(postID, emojiName)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(postId, emojiName)
|
||||
r1 = rf(postID, emojiName)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -178,9 +178,9 @@ func (_m *ReactionStore) GetForPost(postID string, allowFromCache bool) ([]*mode
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetForPostSince provides a mock function with given fields: postId, since, excludeRemoteId, inclDeleted
|
||||
func (_m *ReactionStore) GetForPostSince(postId string, since int64, excludeRemoteId string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
ret := _m.Called(postId, since, excludeRemoteId, inclDeleted)
|
||||
// GetForPostSince provides a mock function with given fields: postID, since, excludeRemoteID, inclDeleted
|
||||
func (_m *ReactionStore) GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
ret := _m.Called(postID, since, excludeRemoteID, inclDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetForPostSince")
|
||||
@@ -189,10 +189,10 @@ func (_m *ReactionStore) GetForPostSince(postId string, since int64, excludeRemo
|
||||
var r0 []*model.Reaction
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64, string, bool) ([]*model.Reaction, error)); ok {
|
||||
return rf(postId, since, excludeRemoteId, inclDeleted)
|
||||
return rf(postID, since, excludeRemoteID, inclDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int64, string, bool) []*model.Reaction); ok {
|
||||
r0 = rf(postId, since, excludeRemoteId, inclDeleted)
|
||||
r0 = rf(postID, since, excludeRemoteID, inclDeleted)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Reaction)
|
||||
@@ -200,7 +200,7 @@ func (_m *ReactionStore) GetForPostSince(postId string, since int64, excludeRemo
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int64, string, bool) error); ok {
|
||||
r1 = rf(postId, since, excludeRemoteId, inclDeleted)
|
||||
r1 = rf(postID, since, excludeRemoteID, inclDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -238,9 +238,9 @@ func (_m *ReactionStore) GetSingle(userID string, postID string, remoteID string
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUniqueCountForPost provides a mock function with given fields: postId
|
||||
func (_m *ReactionStore) GetUniqueCountForPost(postId string) (int, error) {
|
||||
ret := _m.Called(postId)
|
||||
// GetUniqueCountForPost provides a mock function with given fields: postID
|
||||
func (_m *ReactionStore) GetUniqueCountForPost(postID string) (int, error) {
|
||||
ret := _m.Called(postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUniqueCountForPost")
|
||||
@@ -249,16 +249,16 @@ func (_m *ReactionStore) GetUniqueCountForPost(postId string) (int, error) {
|
||||
var r0 int
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (int, error)); ok {
|
||||
return rf(postId)
|
||||
return rf(postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) int); ok {
|
||||
r0 = rf(postId)
|
||||
r0 = rf(postID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(postId)
|
||||
r1 = rf(postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ type RemoteClusterStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: remoteClusterId
|
||||
func (_m *RemoteClusterStore) Delete(remoteClusterId string) (bool, error) {
|
||||
ret := _m.Called(remoteClusterId)
|
||||
// Delete provides a mock function with given fields: remoteClusterID
|
||||
func (_m *RemoteClusterStore) Delete(remoteClusterID string) (bool, error) {
|
||||
ret := _m.Called(remoteClusterID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
@@ -25,16 +25,16 @@ func (_m *RemoteClusterStore) Delete(remoteClusterId string) (bool, error) {
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
|
||||
return rf(remoteClusterId)
|
||||
return rf(remoteClusterID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) bool); ok {
|
||||
r0 = rf(remoteClusterId)
|
||||
r0 = rf(remoteClusterID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(remoteClusterId)
|
||||
r1 = rf(remoteClusterID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -42,9 +42,9 @@ func (_m *RemoteClusterStore) Delete(remoteClusterId string) (bool, error) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: remoteClusterId, includeDeleted
|
||||
func (_m *RemoteClusterStore) Get(remoteClusterId string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteClusterId, includeDeleted)
|
||||
// Get provides a mock function with given fields: remoteClusterID, includeDeleted
|
||||
func (_m *RemoteClusterStore) Get(remoteClusterID string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteClusterID, includeDeleted)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
@@ -53,10 +53,10 @@ func (_m *RemoteClusterStore) Get(remoteClusterId string, includeDeleted bool) (
|
||||
var r0 *model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, bool) (*model.RemoteCluster, error)); ok {
|
||||
return rf(remoteClusterId, includeDeleted)
|
||||
return rf(remoteClusterID, includeDeleted)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, bool) *model.RemoteCluster); ok {
|
||||
r0 = rf(remoteClusterId, includeDeleted)
|
||||
r0 = rf(remoteClusterID, includeDeleted)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
@@ -64,7 +64,7 @@ func (_m *RemoteClusterStore) Get(remoteClusterId string, includeDeleted bool) (
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(remoteClusterId, includeDeleted)
|
||||
r1 = rf(remoteClusterID, includeDeleted)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -162,9 +162,9 @@ func (_m *RemoteClusterStore) Save(rc *model.RemoteCluster) (*model.RemoteCluste
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SetLastPingAt provides a mock function with given fields: remoteClusterId
|
||||
func (_m *RemoteClusterStore) SetLastPingAt(remoteClusterId string) error {
|
||||
ret := _m.Called(remoteClusterId)
|
||||
// SetLastPingAt provides a mock function with given fields: remoteClusterID
|
||||
func (_m *RemoteClusterStore) SetLastPingAt(remoteClusterID string) error {
|
||||
ret := _m.Called(remoteClusterID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetLastPingAt")
|
||||
@@ -172,7 +172,7 @@ func (_m *RemoteClusterStore) SetLastPingAt(remoteClusterId string) error {
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(remoteClusterId)
|
||||
r0 = rf(remoteClusterID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -210,9 +210,9 @@ func (_m *RemoteClusterStore) Update(rc *model.RemoteCluster) (*model.RemoteClus
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateTopics provides a mock function with given fields: remoteClusterId, topics
|
||||
func (_m *RemoteClusterStore) UpdateTopics(remoteClusterId string, topics string) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteClusterId, topics)
|
||||
// UpdateTopics provides a mock function with given fields: remoteClusterID, topics
|
||||
func (_m *RemoteClusterStore) UpdateTopics(remoteClusterID string, topics string) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteClusterID, topics)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateTopics")
|
||||
@@ -221,10 +221,10 @@ func (_m *RemoteClusterStore) UpdateTopics(remoteClusterId string, topics string
|
||||
var r0 *model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.RemoteCluster, error)); ok {
|
||||
return rf(remoteClusterId, topics)
|
||||
return rf(remoteClusterID, topics)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.RemoteCluster); ok {
|
||||
r0 = rf(remoteClusterId, topics)
|
||||
r0 = rf(remoteClusterID, topics)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
@@ -232,7 +232,7 @@ func (_m *RemoteClusterStore) UpdateTopics(remoteClusterId string, topics string
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(remoteClusterId, topics)
|
||||
r1 = rf(remoteClusterID, topics)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ type RetentionPolicyStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AddChannels provides a mock function with given fields: policyId, channelIds
|
||||
func (_m *RetentionPolicyStore) AddChannels(policyId string, channelIds []string) error {
|
||||
ret := _m.Called(policyId, channelIds)
|
||||
// AddChannels provides a mock function with given fields: policyID, channelIds
|
||||
func (_m *RetentionPolicyStore) AddChannels(policyID string, channelIds []string) error {
|
||||
ret := _m.Called(policyID, channelIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AddChannels")
|
||||
@@ -24,7 +24,7 @@ func (_m *RetentionPolicyStore) AddChannels(policyId string, channelIds []string
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyId, channelIds)
|
||||
r0 = rf(policyID, channelIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -32,9 +32,9 @@ func (_m *RetentionPolicyStore) AddChannels(policyId string, channelIds []string
|
||||
return r0
|
||||
}
|
||||
|
||||
// AddTeams provides a mock function with given fields: policyId, teamIds
|
||||
func (_m *RetentionPolicyStore) AddTeams(policyId string, teamIds []string) error {
|
||||
ret := _m.Called(policyId, teamIds)
|
||||
// AddTeams provides a mock function with given fields: policyID, teamIds
|
||||
func (_m *RetentionPolicyStore) AddTeams(policyID string, teamIds []string) error {
|
||||
ret := _m.Called(policyID, teamIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AddTeams")
|
||||
@@ -42,7 +42,7 @@ func (_m *RetentionPolicyStore) AddTeams(policyId string, teamIds []string) erro
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyId, teamIds)
|
||||
r0 = rf(policyID, teamIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -214,9 +214,9 @@ func (_m *RetentionPolicyStore) GetChannelPoliciesForUser(userID string, offset
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannels provides a mock function with given fields: policyId, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetChannels(policyId string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
ret := _m.Called(policyId, offset, limit)
|
||||
// GetChannels provides a mock function with given fields: policyID, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetChannels(policyID string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
ret := _m.Called(policyID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannels")
|
||||
@@ -225,10 +225,10 @@ func (_m *RetentionPolicyStore) GetChannels(policyId string, offset int, limit i
|
||||
var r0 model.ChannelListWithTeamData
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelListWithTeamData, error)); ok {
|
||||
return rf(policyId, offset, limit)
|
||||
return rf(policyID, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelListWithTeamData); ok {
|
||||
r0 = rf(policyId, offset, limit)
|
||||
r0 = rf(policyID, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(model.ChannelListWithTeamData)
|
||||
@@ -236,7 +236,7 @@ func (_m *RetentionPolicyStore) GetChannels(policyId string, offset int, limit i
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(policyId, offset, limit)
|
||||
r1 = rf(policyID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -244,9 +244,9 @@ func (_m *RetentionPolicyStore) GetChannels(policyId string, offset int, limit i
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetChannelsCount provides a mock function with given fields: policyId
|
||||
func (_m *RetentionPolicyStore) GetChannelsCount(policyId string) (int64, error) {
|
||||
ret := _m.Called(policyId)
|
||||
// GetChannelsCount provides a mock function with given fields: policyID
|
||||
func (_m *RetentionPolicyStore) GetChannelsCount(policyID string) (int64, error) {
|
||||
ret := _m.Called(policyID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetChannelsCount")
|
||||
@@ -255,16 +255,16 @@ func (_m *RetentionPolicyStore) GetChannelsCount(policyId string) (int64, error)
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (int64, error)); ok {
|
||||
return rf(policyId)
|
||||
return rf(policyID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) int64); ok {
|
||||
r0 = rf(policyId)
|
||||
r0 = rf(policyID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(policyId)
|
||||
r1 = rf(policyID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -388,9 +388,9 @@ func (_m *RetentionPolicyStore) GetTeamPoliciesForUser(userID string, offset int
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeams provides a mock function with given fields: policyId, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetTeams(policyId string, offset int, limit int) ([]*model.Team, error) {
|
||||
ret := _m.Called(policyId, offset, limit)
|
||||
// GetTeams provides a mock function with given fields: policyID, offset, limit
|
||||
func (_m *RetentionPolicyStore) GetTeams(policyID string, offset int, limit int) ([]*model.Team, error) {
|
||||
ret := _m.Called(policyID, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeams")
|
||||
@@ -399,10 +399,10 @@ func (_m *RetentionPolicyStore) GetTeams(policyId string, offset int, limit int)
|
||||
var r0 []*model.Team
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Team, error)); ok {
|
||||
return rf(policyId, offset, limit)
|
||||
return rf(policyID, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int, int) []*model.Team); ok {
|
||||
r0 = rf(policyId, offset, limit)
|
||||
r0 = rf(policyID, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Team)
|
||||
@@ -410,7 +410,7 @@ func (_m *RetentionPolicyStore) GetTeams(policyId string, offset int, limit int)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(policyId, offset, limit)
|
||||
r1 = rf(policyID, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -418,9 +418,9 @@ func (_m *RetentionPolicyStore) GetTeams(policyId string, offset int, limit int)
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTeamsCount provides a mock function with given fields: policyId
|
||||
func (_m *RetentionPolicyStore) GetTeamsCount(policyId string) (int64, error) {
|
||||
ret := _m.Called(policyId)
|
||||
// GetTeamsCount provides a mock function with given fields: policyID
|
||||
func (_m *RetentionPolicyStore) GetTeamsCount(policyID string) (int64, error) {
|
||||
ret := _m.Called(policyID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTeamsCount")
|
||||
@@ -429,16 +429,16 @@ func (_m *RetentionPolicyStore) GetTeamsCount(policyId string) (int64, error) {
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (int64, error)); ok {
|
||||
return rf(policyId)
|
||||
return rf(policyID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) int64); ok {
|
||||
r0 = rf(policyId)
|
||||
r0 = rf(policyID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(policyId)
|
||||
r1 = rf(policyID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -476,9 +476,9 @@ func (_m *RetentionPolicyStore) Patch(patch *model.RetentionPolicyWithTeamAndCha
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// RemoveChannels provides a mock function with given fields: policyId, channelIds
|
||||
func (_m *RetentionPolicyStore) RemoveChannels(policyId string, channelIds []string) error {
|
||||
ret := _m.Called(policyId, channelIds)
|
||||
// RemoveChannels provides a mock function with given fields: policyID, channelIds
|
||||
func (_m *RetentionPolicyStore) RemoveChannels(policyID string, channelIds []string) error {
|
||||
ret := _m.Called(policyID, channelIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveChannels")
|
||||
@@ -486,7 +486,7 @@ func (_m *RetentionPolicyStore) RemoveChannels(policyId string, channelIds []str
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyId, channelIds)
|
||||
r0 = rf(policyID, channelIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -494,9 +494,9 @@ func (_m *RetentionPolicyStore) RemoveChannels(policyId string, channelIds []str
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveTeams provides a mock function with given fields: policyId, teamIds
|
||||
func (_m *RetentionPolicyStore) RemoveTeams(policyId string, teamIds []string) error {
|
||||
ret := _m.Called(policyId, teamIds)
|
||||
// RemoveTeams provides a mock function with given fields: policyID, teamIds
|
||||
func (_m *RetentionPolicyStore) RemoveTeams(policyID string, teamIds []string) error {
|
||||
ret := _m.Called(policyID, teamIds)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveTeams")
|
||||
@@ -504,7 +504,7 @@ func (_m *RetentionPolicyStore) RemoveTeams(policyId string, teamIds []string) e
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) error); ok {
|
||||
r0 = rf(policyId, teamIds)
|
||||
r0 = rf(policyID, teamIds)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ type SharedChannelStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: channelId
|
||||
func (_m *SharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
ret := _m.Called(channelId)
|
||||
// Delete provides a mock function with given fields: channelID
|
||||
func (_m *SharedChannelStore) Delete(channelID string) (bool, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
@@ -25,16 +25,16 @@ func (_m *SharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
|
||||
return rf(channelId)
|
||||
return rf(channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) bool); ok {
|
||||
r0 = rf(channelId)
|
||||
r0 = rf(channelID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelId)
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -42,9 +42,9 @@ func (_m *SharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteRemote provides a mock function with given fields: remoteId
|
||||
func (_m *SharedChannelStore) DeleteRemote(remoteId string) (bool, error) {
|
||||
ret := _m.Called(remoteId)
|
||||
// DeleteRemote provides a mock function with given fields: remoteID
|
||||
func (_m *SharedChannelStore) DeleteRemote(remoteID string) (bool, error) {
|
||||
ret := _m.Called(remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteRemote")
|
||||
@@ -53,16 +53,16 @@ func (_m *SharedChannelStore) DeleteRemote(remoteId string) (bool, error) {
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
|
||||
return rf(remoteId)
|
||||
return rf(remoteID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) bool); ok {
|
||||
r0 = rf(remoteId)
|
||||
r0 = rf(remoteID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(remoteId)
|
||||
r1 = rf(remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -70,9 +70,9 @@ func (_m *SharedChannelStore) DeleteRemote(remoteId string) (bool, error) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: channelId
|
||||
func (_m *SharedChannelStore) Get(channelId string) (*model.SharedChannel, error) {
|
||||
ret := _m.Called(channelId)
|
||||
// Get provides a mock function with given fields: channelID
|
||||
func (_m *SharedChannelStore) Get(channelID string) (*model.SharedChannel, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Get")
|
||||
@@ -81,10 +81,10 @@ func (_m *SharedChannelStore) Get(channelId string) (*model.SharedChannel, error
|
||||
var r0 *model.SharedChannel
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*model.SharedChannel, error)); ok {
|
||||
return rf(channelId)
|
||||
return rf(channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *model.SharedChannel); ok {
|
||||
r0 = rf(channelId)
|
||||
r0 = rf(channelID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannel)
|
||||
@@ -92,7 +92,7 @@ func (_m *SharedChannelStore) Get(channelId string) (*model.SharedChannel, error
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelId)
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -158,9 +158,9 @@ func (_m *SharedChannelStore) GetAllCount(opts model.SharedChannelFilterOpts) (i
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAttachment provides a mock function with given fields: fileId, remoteId
|
||||
func (_m *SharedChannelStore) GetAttachment(fileId string, remoteId string) (*model.SharedChannelAttachment, error) {
|
||||
ret := _m.Called(fileId, remoteId)
|
||||
// GetAttachment provides a mock function with given fields: fileID, remoteID
|
||||
func (_m *SharedChannelStore) GetAttachment(fileID string, remoteID string) (*model.SharedChannelAttachment, error) {
|
||||
ret := _m.Called(fileID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAttachment")
|
||||
@@ -169,10 +169,10 @@ func (_m *SharedChannelStore) GetAttachment(fileId string, remoteId string) (*mo
|
||||
var r0 *model.SharedChannelAttachment
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.SharedChannelAttachment, error)); ok {
|
||||
return rf(fileId, remoteId)
|
||||
return rf(fileID, remoteID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.SharedChannelAttachment); ok {
|
||||
r0 = rf(fileId, remoteId)
|
||||
r0 = rf(fileID, remoteID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelAttachment)
|
||||
@@ -180,7 +180,7 @@ func (_m *SharedChannelStore) GetAttachment(fileId string, remoteId string) (*mo
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(fileId, remoteId)
|
||||
r1 = rf(fileID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -218,9 +218,9 @@ func (_m *SharedChannelStore) GetRemote(id string) (*model.SharedChannelRemote,
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemoteByIds provides a mock function with given fields: channelId, remoteId
|
||||
func (_m *SharedChannelStore) GetRemoteByIds(channelId string, remoteId string) (*model.SharedChannelRemote, error) {
|
||||
ret := _m.Called(channelId, remoteId)
|
||||
// GetRemoteByIds provides a mock function with given fields: channelID, remoteID
|
||||
func (_m *SharedChannelStore) GetRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error) {
|
||||
ret := _m.Called(channelID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemoteByIds")
|
||||
@@ -229,10 +229,10 @@ func (_m *SharedChannelStore) GetRemoteByIds(channelId string, remoteId string)
|
||||
var r0 *model.SharedChannelRemote
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.SharedChannelRemote, error)); ok {
|
||||
return rf(channelId, remoteId)
|
||||
return rf(channelID, remoteID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.SharedChannelRemote); ok {
|
||||
r0 = rf(channelId, remoteId)
|
||||
r0 = rf(channelID, remoteID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.SharedChannelRemote)
|
||||
@@ -240,7 +240,7 @@ func (_m *SharedChannelStore) GetRemoteByIds(channelId string, remoteId string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(channelId, remoteId)
|
||||
r1 = rf(channelID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -248,9 +248,9 @@ func (_m *SharedChannelStore) GetRemoteByIds(channelId string, remoteId string)
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemoteForUser provides a mock function with given fields: remoteId, userId
|
||||
func (_m *SharedChannelStore) GetRemoteForUser(remoteId string, userId string) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteId, userId)
|
||||
// GetRemoteForUser provides a mock function with given fields: remoteID, userID
|
||||
func (_m *SharedChannelStore) GetRemoteForUser(remoteID string, userID string) (*model.RemoteCluster, error) {
|
||||
ret := _m.Called(remoteID, userID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemoteForUser")
|
||||
@@ -259,10 +259,10 @@ func (_m *SharedChannelStore) GetRemoteForUser(remoteId string, userId string) (
|
||||
var r0 *model.RemoteCluster
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.RemoteCluster, error)); ok {
|
||||
return rf(remoteId, userId)
|
||||
return rf(remoteID, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.RemoteCluster); ok {
|
||||
r0 = rf(remoteId, userId)
|
||||
r0 = rf(remoteID, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.RemoteCluster)
|
||||
@@ -270,7 +270,7 @@ func (_m *SharedChannelStore) GetRemoteForUser(remoteId string, userId string) (
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(remoteId, userId)
|
||||
r1 = rf(remoteID, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -308,9 +308,9 @@ func (_m *SharedChannelStore) GetRemotes(offset int, limit int, opts model.Share
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRemotesStatus provides a mock function with given fields: channelId
|
||||
func (_m *SharedChannelStore) GetRemotesStatus(channelId string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
ret := _m.Called(channelId)
|
||||
// GetRemotesStatus provides a mock function with given fields: channelID
|
||||
func (_m *SharedChannelStore) GetRemotesStatus(channelID string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
ret := _m.Called(channelID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetRemotesStatus")
|
||||
@@ -319,10 +319,10 @@ func (_m *SharedChannelStore) GetRemotesStatus(channelId string) ([]*model.Share
|
||||
var r0 []*model.SharedChannelRemoteStatus
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) ([]*model.SharedChannelRemoteStatus, error)); ok {
|
||||
return rf(channelId)
|
||||
return rf(channelID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) []*model.SharedChannelRemoteStatus); ok {
|
||||
r0 = rf(channelId)
|
||||
r0 = rf(channelID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.SharedChannelRemoteStatus)
|
||||
@@ -330,7 +330,7 @@ func (_m *SharedChannelStore) GetRemotesStatus(channelId string) ([]*model.Share
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelId)
|
||||
r1 = rf(channelID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -456,9 +456,9 @@ func (_m *SharedChannelStore) HasChannel(channelID string) (bool, error) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// HasRemote provides a mock function with given fields: channelID, remoteId
|
||||
func (_m *SharedChannelStore) HasRemote(channelID string, remoteId string) (bool, error) {
|
||||
ret := _m.Called(channelID, remoteId)
|
||||
// HasRemote provides a mock function with given fields: channelID, remoteID
|
||||
func (_m *SharedChannelStore) HasRemote(channelID string, remoteID string) (bool, error) {
|
||||
ret := _m.Called(channelID, remoteID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for HasRemote")
|
||||
@@ -467,16 +467,16 @@ func (_m *SharedChannelStore) HasRemote(channelID string, remoteId string) (bool
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (bool, error)); ok {
|
||||
return rf(channelID, remoteId)
|
||||
return rf(channelID, remoteID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) bool); ok {
|
||||
r0 = rf(channelID, remoteId)
|
||||
r0 = rf(channelID, remoteID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(channelID, remoteId)
|
||||
r1 = rf(channelID, remoteID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ type ThreadStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// DeleteMembershipForUser provides a mock function with given fields: userId, postID
|
||||
func (_m *ThreadStore) DeleteMembershipForUser(userId string, postID string) error {
|
||||
ret := _m.Called(userId, postID)
|
||||
// DeleteMembershipForUser provides a mock function with given fields: userID, postID
|
||||
func (_m *ThreadStore) DeleteMembershipForUser(userID string, postID string) error {
|
||||
ret := _m.Called(userID, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteMembershipForUser")
|
||||
@@ -25,7 +25,7 @@ func (_m *ThreadStore) DeleteMembershipForUser(userId string, postID string) err
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(userId, postID)
|
||||
r0 = rf(userID, postID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -109,9 +109,9 @@ func (_m *ThreadStore) Get(id string) (*model.Thread, error) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMembershipForUser provides a mock function with given fields: userId, postID
|
||||
func (_m *ThreadStore) GetMembershipForUser(userId string, postID string) (*model.ThreadMembership, error) {
|
||||
ret := _m.Called(userId, postID)
|
||||
// GetMembershipForUser provides a mock function with given fields: userID, postID
|
||||
func (_m *ThreadStore) GetMembershipForUser(userID string, postID string) (*model.ThreadMembership, error) {
|
||||
ret := _m.Called(userID, postID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMembershipForUser")
|
||||
@@ -120,10 +120,10 @@ func (_m *ThreadStore) GetMembershipForUser(userId string, postID string) (*mode
|
||||
var r0 *model.ThreadMembership
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*model.ThreadMembership, error)); ok {
|
||||
return rf(userId, postID)
|
||||
return rf(userID, postID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *model.ThreadMembership); ok {
|
||||
r0 = rf(userId, postID)
|
||||
r0 = rf(userID, postID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.ThreadMembership)
|
||||
@@ -131,7 +131,7 @@ func (_m *ThreadStore) GetMembershipForUser(userId string, postID string) (*mode
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userId, postID)
|
||||
r1 = rf(userID, postID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -139,9 +139,9 @@ func (_m *ThreadStore) GetMembershipForUser(userId string, postID string) (*mode
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetMembershipsForUser provides a mock function with given fields: userId, teamID
|
||||
func (_m *ThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
ret := _m.Called(userId, teamID)
|
||||
// GetMembershipsForUser provides a mock function with given fields: userID, teamID
|
||||
func (_m *ThreadStore) GetMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
ret := _m.Called(userID, teamID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetMembershipsForUser")
|
||||
@@ -150,10 +150,10 @@ func (_m *ThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*m
|
||||
var r0 []*model.ThreadMembership
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) ([]*model.ThreadMembership, error)); ok {
|
||||
return rf(userId, teamID)
|
||||
return rf(userID, teamID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) []*model.ThreadMembership); ok {
|
||||
r0 = rf(userId, teamID)
|
||||
r0 = rf(userID, teamID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ThreadMembership)
|
||||
@@ -161,7 +161,7 @@ func (_m *ThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*m
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(userId, teamID)
|
||||
r1 = rf(userID, teamID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -317,9 +317,9 @@ func (_m *ThreadStore) GetThreadUnreadReplyCount(threadMembership *model.ThreadM
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetThreadsForUser provides a mock function with given fields: userId, teamID, opts
|
||||
func (_m *ThreadStore) GetThreadsForUser(userId string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
ret := _m.Called(userId, teamID, opts)
|
||||
// GetThreadsForUser provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetThreadsForUser(userID string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThreadsForUser")
|
||||
@@ -328,10 +328,10 @@ func (_m *ThreadStore) GetThreadsForUser(userId string, teamID string, opts mode
|
||||
var r0 []*model.ThreadResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) ([]*model.ThreadResponse, error)); ok {
|
||||
return rf(userId, teamID, opts)
|
||||
return rf(userID, teamID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) []*model.ThreadResponse); ok {
|
||||
r0 = rf(userId, teamID, opts)
|
||||
r0 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.ThreadResponse)
|
||||
@@ -339,7 +339,7 @@ func (_m *ThreadStore) GetThreadsForUser(userId string, teamID string, opts mode
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userId, teamID, opts)
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -347,9 +347,9 @@ func (_m *ThreadStore) GetThreadsForUser(userId string, teamID string, opts mode
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalThreads provides a mock function with given fields: userId, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userId, teamID, opts)
|
||||
// GetTotalThreads provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalThreads")
|
||||
@@ -358,16 +358,16 @@ func (_m *ThreadStore) GetTotalThreads(userId string, teamID string, opts model.
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok {
|
||||
return rf(userId, teamID, opts)
|
||||
return rf(userID, teamID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok {
|
||||
r0 = rf(userId, teamID, opts)
|
||||
r0 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userId, teamID, opts)
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -375,9 +375,9 @@ func (_m *ThreadStore) GetTotalThreads(userId string, teamID string, opts model.
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalUnreadMentions provides a mock function with given fields: userId, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userId, teamID, opts)
|
||||
// GetTotalUnreadMentions provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalUnreadMentions")
|
||||
@@ -386,16 +386,16 @@ func (_m *ThreadStore) GetTotalUnreadMentions(userId string, teamID string, opts
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok {
|
||||
return rf(userId, teamID, opts)
|
||||
return rf(userID, teamID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok {
|
||||
r0 = rf(userId, teamID, opts)
|
||||
r0 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userId, teamID, opts)
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -403,9 +403,9 @@ func (_m *ThreadStore) GetTotalUnreadMentions(userId string, teamID string, opts
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalUnreadThreads provides a mock function with given fields: userId, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userId, teamID, opts)
|
||||
// GetTotalUnreadThreads provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalUnreadThreads")
|
||||
@@ -414,16 +414,16 @@ func (_m *ThreadStore) GetTotalUnreadThreads(userId string, teamID string, opts
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok {
|
||||
return rf(userId, teamID, opts)
|
||||
return rf(userID, teamID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok {
|
||||
r0 = rf(userId, teamID, opts)
|
||||
r0 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userId, teamID, opts)
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -431,9 +431,9 @@ func (_m *ThreadStore) GetTotalUnreadThreads(userId string, teamID string, opts
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetTotalUnreadUrgentMentions provides a mock function with given fields: userId, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadUrgentMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userId, teamID, opts)
|
||||
// GetTotalUnreadUrgentMentions provides a mock function with given fields: userID, teamID, opts
|
||||
func (_m *ThreadStore) GetTotalUnreadUrgentMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
ret := _m.Called(userID, teamID, opts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetTotalUnreadUrgentMentions")
|
||||
@@ -442,16 +442,16 @@ func (_m *ThreadStore) GetTotalUnreadUrgentMentions(userId string, teamID string
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) (int64, error)); ok {
|
||||
return rf(userId, teamID, opts)
|
||||
return rf(userID, teamID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, model.GetUserThreadsOpts) int64); ok {
|
||||
r0 = rf(userId, teamID, opts)
|
||||
r0 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, model.GetUserThreadsOpts) error); ok {
|
||||
r1 = rf(userId, teamID, opts)
|
||||
r1 = rf(userID, teamID, opts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -479,9 +479,9 @@ func (_m *UserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.Use
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllProfilesInChannel provides a mock function with given fields: rctx, channelID, allowFromCache
|
||||
func (_m *UserStore) GetAllProfilesInChannel(rctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
ret := _m.Called(rctx, channelID, allowFromCache)
|
||||
// GetAllProfilesInChannel provides a mock function with given fields: ctx, channelID, allowFromCache
|
||||
func (_m *UserStore) GetAllProfilesInChannel(ctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
ret := _m.Called(ctx, channelID, allowFromCache)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllProfilesInChannel")
|
||||
@@ -490,10 +490,10 @@ func (_m *UserStore) GetAllProfilesInChannel(rctx context.Context, channelID str
|
||||
var r0 map[string]*model.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, bool) (map[string]*model.User, error)); ok {
|
||||
return rf(rctx, channelID, allowFromCache)
|
||||
return rf(ctx, channelID, allowFromCache)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, bool) map[string]*model.User); ok {
|
||||
r0 = rf(rctx, channelID, allowFromCache)
|
||||
r0 = rf(ctx, channelID, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(map[string]*model.User)
|
||||
@@ -501,7 +501,7 @@ func (_m *UserStore) GetAllProfilesInChannel(rctx context.Context, channelID str
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok {
|
||||
r1 = rf(rctx, channelID, allowFromCache)
|
||||
r1 = rf(ctx, channelID, allowFromCache)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
@@ -1131,9 +1131,9 @@ func (_m *UserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions)
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetProfilesNotInChannel provides a mock function with given fields: teamID, channelId, groupConstrained, offset, limit, viewRestrictions
|
||||
func (_m *UserStore) GetProfilesNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
ret := _m.Called(teamID, channelId, groupConstrained, offset, limit, viewRestrictions)
|
||||
// GetProfilesNotInChannel provides a mock function with given fields: teamID, channelID, groupConstrained, offset, limit, viewRestrictions
|
||||
func (_m *UserStore) GetProfilesNotInChannel(teamID string, channelID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
ret := _m.Called(teamID, channelID, groupConstrained, offset, limit, viewRestrictions)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetProfilesNotInChannel")
|
||||
@@ -1142,10 +1142,10 @@ func (_m *UserStore) GetProfilesNotInChannel(teamID string, channelId string, gr
|
||||
var r0 []*model.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool, int, int, *model.ViewUsersRestrictions) ([]*model.User, error)); ok {
|
||||
return rf(teamID, channelId, groupConstrained, offset, limit, viewRestrictions)
|
||||
return rf(teamID, channelID, groupConstrained, offset, limit, viewRestrictions)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, bool, int, int, *model.ViewUsersRestrictions) []*model.User); ok {
|
||||
r0 = rf(teamID, channelId, groupConstrained, offset, limit, viewRestrictions)
|
||||
r0 = rf(teamID, channelID, groupConstrained, offset, limit, viewRestrictions)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.User)
|
||||
@@ -1153,7 +1153,7 @@ func (_m *UserStore) GetProfilesNotInChannel(teamID string, channelId string, gr
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string, bool, int, int, *model.ViewUsersRestrictions) error); ok {
|
||||
r1 = rf(teamID, channelId, groupConstrained, offset, limit, viewRestrictions)
|
||||
r1 = rf(teamID, channelID, groupConstrained, offset, limit, viewRestrictions)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ type UserTermsOfServiceStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: userID, termsOfServiceId
|
||||
func (_m *UserTermsOfServiceStore) Delete(userID string, termsOfServiceId string) error {
|
||||
ret := _m.Called(userID, termsOfServiceId)
|
||||
// Delete provides a mock function with given fields: userID, termsOfServiceID
|
||||
func (_m *UserTermsOfServiceStore) Delete(userID string, termsOfServiceID string) error {
|
||||
ret := _m.Called(userID, termsOfServiceID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
@@ -24,7 +24,7 @@ func (_m *UserTermsOfServiceStore) Delete(userID string, termsOfServiceId string
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(userID, termsOfServiceId)
|
||||
r0 = rf(userID, termsOfServiceID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
)
|
||||
|
||||
const PluginIdJenkins = "jenkins"
|
||||
const PluginIDJenkins = "jenkins"
|
||||
|
||||
func TestNotifyAdminStore(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("Save", func(t *testing.T) { testNotifyAdminStoreSave(t, rctx, ss) })
|
||||
t.Run("testGetDataByUserIdAndFeature", func(t *testing.T) { testGetDataByUserIdAndFeature(t, rctx, ss) })
|
||||
t.Run("testGetDataByUserIdAndFeature", func(t *testing.T) { testGetDataByUserIDAndFeature(t, rctx, ss) })
|
||||
t.Run("testGet", func(t *testing.T) { testGet(t, rctx, ss) })
|
||||
t.Run("testDeleteBefore", func(t *testing.T) { testDeleteBefore(t, rctx, ss) })
|
||||
t.Run("testUpdate", func(t *testing.T) { testUpdate(t, rctx, ss) })
|
||||
@@ -62,9 +62,9 @@ func testNotifyAdminStoreSave(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.Error(t, err)
|
||||
|
||||
// same user requesting same feature error
|
||||
singleUserId := model.NewId()
|
||||
singleUserID := model.NewId()
|
||||
d5 := &model.NotifyAdminData{
|
||||
UserId: singleUserId,
|
||||
UserId: singleUserID,
|
||||
RequiredPlan: model.LicenseShortSkuProfessional,
|
||||
RequiredFeature: model.PaidFeatureAllProfessionalfeatures,
|
||||
}
|
||||
@@ -72,7 +72,7 @@ func testNotifyAdminStoreSave(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
|
||||
d6 := &model.NotifyAdminData{
|
||||
UserId: singleUserId,
|
||||
UserId: singleUserID,
|
||||
RequiredPlan: model.LicenseShortSkuProfessional,
|
||||
RequiredFeature: model.PaidFeatureAllProfessionalfeatures,
|
||||
}
|
||||
@@ -83,9 +83,9 @@ func testNotifyAdminStoreSave(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
func testGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId1 := model.NewId()
|
||||
userID1 := model.NewId()
|
||||
d1 := &model.NotifyAdminData{
|
||||
UserId: userId1,
|
||||
UserId: userID1,
|
||||
RequiredPlan: model.LicenseShortSkuProfessional,
|
||||
RequiredFeature: model.PaidFeatureAllProfessionalfeatures,
|
||||
}
|
||||
@@ -94,7 +94,7 @@ func testGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
|
||||
d1Trial := &model.NotifyAdminData{
|
||||
UserId: userId1,
|
||||
UserId: userID1,
|
||||
RequiredPlan: model.LicenseShortSkuEnterprise,
|
||||
RequiredFeature: model.PaidFeatureAllEnterprisefeatures,
|
||||
Trial: true,
|
||||
@@ -122,10 +122,10 @@ func testGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
tearDown(t, rctx, ss)
|
||||
}
|
||||
|
||||
func testGetDataByUserIdAndFeature(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId1 := model.NewId()
|
||||
func testGetDataByUserIDAndFeature(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userID1 := model.NewId()
|
||||
d1 := &model.NotifyAdminData{
|
||||
UserId: userId1,
|
||||
UserId: userID1,
|
||||
RequiredPlan: model.LicenseShortSkuProfessional,
|
||||
RequiredFeature: model.PaidFeatureAllProfessionalfeatures,
|
||||
}
|
||||
@@ -133,9 +133,9 @@ func testGetDataByUserIdAndFeature(t *testing.T, rctx request.CTX, ss store.Stor
|
||||
_, err := ss.NotifyAdmin().Save(d1)
|
||||
require.NoError(t, err)
|
||||
|
||||
userId2 := model.NewId()
|
||||
userID2 := model.NewId()
|
||||
d2 := &model.NotifyAdminData{
|
||||
UserId: userId2,
|
||||
UserId: userID2,
|
||||
RequiredPlan: model.LicenseShortSkuProfessional,
|
||||
RequiredFeature: model.PaidFeatureCustomUsergroups,
|
||||
}
|
||||
@@ -143,7 +143,7 @@ func testGetDataByUserIdAndFeature(t *testing.T, rctx request.CTX, ss store.Stor
|
||||
_, err = ss.NotifyAdmin().Save(d2)
|
||||
require.NoError(t, err)
|
||||
|
||||
user1Request, err := ss.NotifyAdmin().GetDataByUserIdAndFeature(userId1, model.PaidFeatureAllProfessionalfeatures)
|
||||
user1Request, err := ss.NotifyAdmin().GetDataByUserIdAndFeature(userID1, model.PaidFeatureAllProfessionalfeatures)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, len(user1Request), 1)
|
||||
require.Equal(t, user1Request[0].RequiredFeature, model.PaidFeatureAllProfessionalfeatures)
|
||||
@@ -152,10 +152,10 @@ func testGetDataByUserIdAndFeature(t *testing.T, rctx request.CTX, ss store.Stor
|
||||
}
|
||||
|
||||
func testUpdate(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId1 := model.NewId()
|
||||
userID1 := model.NewId()
|
||||
d1 := &model.NotifyAdminData{
|
||||
UserId: userId1,
|
||||
RequiredPlan: PluginIdJenkins,
|
||||
UserId: userID1,
|
||||
RequiredPlan: PluginIDJenkins,
|
||||
RequiredFeature: model.PluginFeature,
|
||||
}
|
||||
_, err := ss.NotifyAdmin().Save(d1)
|
||||
@@ -174,9 +174,9 @@ func testUpdate(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
func testDeleteBefore(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId1 := model.NewId()
|
||||
userID1 := model.NewId()
|
||||
d1 := &model.NotifyAdminData{
|
||||
UserId: userId1,
|
||||
UserId: userID1,
|
||||
RequiredPlan: model.LicenseShortSkuProfessional,
|
||||
RequiredFeature: model.PaidFeatureAllProfessionalfeatures,
|
||||
}
|
||||
@@ -185,7 +185,7 @@ func testDeleteBefore(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
|
||||
d1Trial := &model.NotifyAdminData{
|
||||
UserId: userId1,
|
||||
UserId: userID1,
|
||||
RequiredPlan: model.LicenseShortSkuProfessional,
|
||||
RequiredFeature: model.PaidFeatureAllEnterprisefeatures,
|
||||
Trial: true,
|
||||
|
||||
@@ -269,9 +269,9 @@ func testGetOutgoingOAuthConnection(t *testing.T, ss store.Store) {
|
||||
c := request.TestContext(t)
|
||||
|
||||
t.Run("get non-existing", func(t *testing.T) {
|
||||
nonExistingId := model.NewId()
|
||||
nonExistingID := model.NewId()
|
||||
var expected *store.ErrNotFound
|
||||
_, err := ss.OutgoingOAuthConnection().GetConnection(c, nonExistingId)
|
||||
_, err := ss.OutgoingOAuthConnection().GetConnection(c, nonExistingID)
|
||||
require.ErrorAs(t, err, &expected)
|
||||
})
|
||||
}
|
||||
@@ -311,9 +311,9 @@ func testGetOutgoingOAuthConnectionByAudience(t *testing.T, ss store.Store) {
|
||||
t.Run("get non-existing", func(t *testing.T) {
|
||||
c := request.TestContext(t)
|
||||
|
||||
nonExistingId := model.NewId()
|
||||
nonExistingID := model.NewId()
|
||||
var expected *store.ErrNotFound
|
||||
_, err := ss.OutgoingOAuthConnection().GetConnection(c, nonExistingId)
|
||||
_, err := ss.OutgoingOAuthConnection().GetConnection(c, nonExistingID)
|
||||
require.ErrorAs(t, err, &expected)
|
||||
})
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@ func TestPluginStore(t *testing.T, rctx request.CTX, ss store.Store, s SqlStore)
|
||||
}
|
||||
|
||||
func setupKVs(t *testing.T, rctx request.CTX, ss store.Store) (string, func()) {
|
||||
pluginId := model.NewId()
|
||||
otherPluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
otherPluginID := model.NewId()
|
||||
|
||||
// otherKV is another key value for the current plugin, and used to verify other keys
|
||||
// aren't modified unintentionally.
|
||||
otherKV := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -45,7 +45,7 @@ func setupKVs(t *testing.T, rctx request.CTX, ss store.Store) (string, func()) {
|
||||
// otherPluginKV is a key value for another plugin, and used to verify other plugins' keys
|
||||
// aren't modified unintentionally.
|
||||
otherPluginKV := &model.PluginKeyValue{
|
||||
PluginId: otherPluginId,
|
||||
PluginId: otherPluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -53,7 +53,7 @@ func setupKVs(t *testing.T, rctx request.CTX, ss store.Store) (string, func()) {
|
||||
_, err = ss.Plugin().SaveOrUpdate(otherPluginKV)
|
||||
require.NoError(t, err)
|
||||
|
||||
return pluginId, func() {
|
||||
return pluginID, func() {
|
||||
actualOtherKV, err := ss.Plugin().Get(otherKV.PluginId, otherKV.Key)
|
||||
require.NoError(t, err, "failed to find other key value for same plugin")
|
||||
assert.Equal(t, otherKV, actualOtherKV)
|
||||
@@ -85,7 +85,7 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
})
|
||||
|
||||
t.Run("new key", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -93,7 +93,7 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -104,18 +104,18 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
assert.Equal(t, kv, retKV)
|
||||
// SaveOrUpdate returns the kv passed in, so test each field individually for
|
||||
// completeness. It should probably be changed to not bother doing that.
|
||||
assert.Equal(t, pluginId, kv.PluginId)
|
||||
assert.Equal(t, pluginID, kv.PluginId)
|
||||
assert.Equal(t, key, kv.Key)
|
||||
assert.Equal(t, []byte(value), kv.Value)
|
||||
assert.Equal(t, expireAt, kv.ExpireAt)
|
||||
|
||||
actualKV, nErr := ss.Plugin().Get(pluginId, key)
|
||||
actualKV, nErr := ss.Plugin().Get(pluginID, key)
|
||||
require.NoError(t, nErr)
|
||||
assert.Equal(t, kv, actualKV)
|
||||
})
|
||||
|
||||
t.Run("nil value for new key", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -123,7 +123,7 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: value,
|
||||
ExpireAt: expireAt,
|
||||
@@ -134,12 +134,12 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
assert.Equal(t, kv, retKV)
|
||||
// SaveOrUpdate returns the kv passed in, so test each field individually for
|
||||
// completeness. It should probably be changed to not bother doing that.
|
||||
assert.Equal(t, pluginId, kv.PluginId)
|
||||
assert.Equal(t, pluginID, kv.PluginId)
|
||||
assert.Equal(t, key, kv.Key)
|
||||
assert.Nil(t, kv.Value)
|
||||
assert.Equal(t, expireAt, kv.ExpireAt)
|
||||
|
||||
actualKV, nErr := ss.Plugin().Get(pluginId, key)
|
||||
actualKV, nErr := ss.Plugin().Get(pluginID, key)
|
||||
_, ok := nErr.(*store.ErrNotFound)
|
||||
require.Error(t, nErr)
|
||||
assert.True(t, ok)
|
||||
@@ -147,7 +147,7 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
})
|
||||
|
||||
t.Run("existing key", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -155,7 +155,7 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -172,18 +172,18 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
assert.Equal(t, kv, retKV)
|
||||
// SaveOrUpdate returns the kv passed in, so test each field individually for
|
||||
// completeness. It should probably be changed to not bother doing that.
|
||||
assert.Equal(t, pluginId, kv.PluginId)
|
||||
assert.Equal(t, pluginID, kv.PluginId)
|
||||
assert.Equal(t, key, kv.Key)
|
||||
assert.Equal(t, []byte(newValue), kv.Value)
|
||||
assert.Equal(t, expireAt, kv.ExpireAt)
|
||||
|
||||
actualKV, nErr := ss.Plugin().Get(pluginId, key)
|
||||
actualKV, nErr := ss.Plugin().Get(pluginID, key)
|
||||
require.NoError(t, nErr)
|
||||
assert.Equal(t, kv, actualKV)
|
||||
})
|
||||
|
||||
t.Run("nil value for existing key", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -191,7 +191,7 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -207,12 +207,12 @@ func doTestPluginSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store, do
|
||||
assert.Equal(t, kv, retKV)
|
||||
// SaveOrUpdate returns the kv passed in, so test each field individually for
|
||||
// completeness. It should probably be changed to not bother doing that.
|
||||
assert.Equal(t, pluginId, kv.PluginId)
|
||||
assert.Equal(t, pluginID, kv.PluginId)
|
||||
assert.Equal(t, key, kv.Key)
|
||||
assert.Nil(t, kv.Value)
|
||||
assert.Equal(t, expireAt, kv.ExpireAt)
|
||||
|
||||
actualKV, nErr := ss.Plugin().Get(pluginId, key)
|
||||
actualKV, nErr := ss.Plugin().Get(pluginID, key)
|
||||
_, ok := nErr.(*store.ErrNotFound)
|
||||
require.Error(t, nErr)
|
||||
assert.True(t, ok)
|
||||
@@ -311,10 +311,10 @@ func doTestPluginCompareAndSet(t *testing.T, rctx request.CTX, ss store.Store, c
|
||||
// Non-existent keys and expired keys should behave identically.
|
||||
for description, setup := range map[string]func(t *testing.T) (*model.PluginKeyValue, func()){
|
||||
"non-existent key": func(t *testing.T) (*model.PluginKeyValue, func()) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -323,10 +323,10 @@ func doTestPluginCompareAndSet(t *testing.T, rctx request.CTX, ss store.Store, c
|
||||
return kv, tearDown
|
||||
},
|
||||
"expired key": func(t *testing.T) (*model.PluginKeyValue, func()) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
|
||||
expiredKV := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 1,
|
||||
@@ -399,10 +399,10 @@ func doTestPluginCompareAndSet(t *testing.T, rctx request.CTX, ss store.Store, c
|
||||
|
||||
t.Run("existing key", func(t *testing.T) {
|
||||
setup := func(t *testing.T) (*model.PluginKeyValue, func()) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
|
||||
existingKV := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -552,7 +552,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
})
|
||||
|
||||
t.Run("non-existent key should fail", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -560,7 +560,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -581,7 +581,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
})
|
||||
|
||||
t.Run("expired key should fail", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -589,7 +589,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
expireAt := int64(1)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -613,7 +613,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
})
|
||||
|
||||
t.Run("existing key should fail given different old value", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -621,7 +621,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -637,7 +637,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
})
|
||||
|
||||
t.Run("existing key should succeed given same old value", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -645,7 +645,7 @@ func testPluginCompareAndDelete(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -666,7 +666,7 @@ func testPluginSetWithOptions(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
pluginId := ""
|
||||
pluginID := ""
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
options := model.PluginKVSetOptions{
|
||||
@@ -674,7 +674,7 @@ func testPluginSetWithOptions(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
OldValue: []byte("not-nil"),
|
||||
}
|
||||
|
||||
ok, err := ss.Plugin().SetWithOptions(pluginId, key, []byte(value), options)
|
||||
ok, err := ss.Plugin().SetWithOptions(pluginID, key, []byte(value), options)
|
||||
require.Error(t, err)
|
||||
assert.False(t, ok)
|
||||
appErr, ok := err.(*model.AppError)
|
||||
@@ -686,12 +686,12 @@ func testPluginSetWithOptions(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
pluginId := ""
|
||||
pluginID := ""
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
options := model.PluginKVSetOptions{}
|
||||
|
||||
ok, err := ss.Plugin().SetWithOptions(pluginId, key, []byte(value), options)
|
||||
ok, err := ss.Plugin().SetWithOptions(pluginID, key, []byte(value), options)
|
||||
require.Error(t, err)
|
||||
assert.False(t, ok)
|
||||
appErr, ok := err.(*model.AppError)
|
||||
@@ -737,10 +737,10 @@ func testPluginSetWithOptions(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("no matching key value", func(t *testing.T) {
|
||||
pluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
key := model.NewId()
|
||||
|
||||
kv, nErr := ss.Plugin().Get(pluginId, key)
|
||||
kv, nErr := ss.Plugin().Get(pluginID, key)
|
||||
_, ok := nErr.(*store.ErrNotFound)
|
||||
require.Error(t, nErr)
|
||||
assert.True(t, ok)
|
||||
@@ -748,13 +748,13 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
})
|
||||
|
||||
t.Run("no-matching key value for plugin id", func(t *testing.T) {
|
||||
pluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -771,13 +771,13 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
})
|
||||
|
||||
t.Run("no-matching key value for key", func(t *testing.T) {
|
||||
pluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -786,7 +786,7 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, err := ss.Plugin().SaveOrUpdate(kv)
|
||||
require.NoError(t, err)
|
||||
|
||||
kv, err = ss.Plugin().Get(pluginId, model.NewId())
|
||||
kv, err = ss.Plugin().Get(pluginID, model.NewId())
|
||||
_, ok := err.(*store.ErrNotFound)
|
||||
require.Error(t, err)
|
||||
assert.True(t, ok)
|
||||
@@ -794,13 +794,13 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
})
|
||||
|
||||
t.Run("old expired key value", func(t *testing.T) {
|
||||
pluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
expireAt := int64(1)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -809,7 +809,7 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, err := ss.Plugin().SaveOrUpdate(kv)
|
||||
require.NoError(t, err)
|
||||
|
||||
kv, err = ss.Plugin().Get(pluginId, model.NewId())
|
||||
kv, err = ss.Plugin().Get(pluginID, model.NewId())
|
||||
_, ok := err.(*store.ErrNotFound)
|
||||
require.Error(t, err)
|
||||
assert.True(t, ok)
|
||||
@@ -817,13 +817,13 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
})
|
||||
|
||||
t.Run("recently expired key value", func(t *testing.T) {
|
||||
pluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
expireAt := model.GetMillis() - 15*1000
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -832,7 +832,7 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, err := ss.Plugin().SaveOrUpdate(kv)
|
||||
require.NoError(t, err)
|
||||
|
||||
kv, err = ss.Plugin().Get(pluginId, model.NewId())
|
||||
kv, err = ss.Plugin().Get(pluginID, model.NewId())
|
||||
_, ok := err.(*store.ErrNotFound)
|
||||
require.Error(t, err)
|
||||
assert.True(t, ok)
|
||||
@@ -840,13 +840,13 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
})
|
||||
|
||||
t.Run("matching key value, non-expiring", func(t *testing.T) {
|
||||
pluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
expireAt := int64(0)
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -855,19 +855,19 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, err := ss.Plugin().SaveOrUpdate(kv)
|
||||
require.NoError(t, err)
|
||||
|
||||
actualKV, err := ss.Plugin().Get(pluginId, key)
|
||||
actualKV, err := ss.Plugin().Get(pluginID, key)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, kv, actualKV)
|
||||
})
|
||||
|
||||
t.Run("matching key value, not yet expired", func(t *testing.T) {
|
||||
pluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
key := model.NewId()
|
||||
value := model.NewId()
|
||||
expireAt := model.GetMillis() + 15*1000
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -876,7 +876,7 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, err := ss.Plugin().SaveOrUpdate(kv)
|
||||
require.NoError(t, err)
|
||||
|
||||
actualKV, err := ss.Plugin().Get(pluginId, key)
|
||||
actualKV, err := ss.Plugin().Get(pluginID, key)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, kv, actualKV)
|
||||
})
|
||||
@@ -884,15 +884,15 @@ func testPluginGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
func testPluginDelete(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("no matching key value", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
|
||||
err := ss.Plugin().Delete(pluginId, key)
|
||||
err := ss.Plugin().Delete(pluginID, key)
|
||||
require.NoError(t, err)
|
||||
|
||||
kv, err := ss.Plugin().Get(pluginId, key)
|
||||
kv, err := ss.Plugin().Get(pluginID, key)
|
||||
_, ok := err.(*store.ErrNotFound)
|
||||
require.Error(t, err)
|
||||
assert.True(t, ok)
|
||||
@@ -919,7 +919,7 @@ func testPluginDelete(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
for _, testCase := range testCases {
|
||||
t.Run(testCase.description, func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVs(t, rctx, ss)
|
||||
pluginID, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
key := model.NewId()
|
||||
@@ -927,7 +927,7 @@ func testPluginDelete(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
expireAt := testCase.expireAt
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(value),
|
||||
ExpireAt: expireAt,
|
||||
@@ -936,10 +936,10 @@ func testPluginDelete(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, err := ss.Plugin().SaveOrUpdate(kv)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = ss.Plugin().Delete(pluginId, key)
|
||||
err = ss.Plugin().Delete(pluginID, key)
|
||||
require.NoError(t, err)
|
||||
|
||||
kv, err = ss.Plugin().Get(pluginId, key)
|
||||
kv, err = ss.Plugin().Get(pluginID, key)
|
||||
_, ok := err.(*store.ErrNotFound)
|
||||
require.Error(t, err)
|
||||
assert.True(t, ok)
|
||||
@@ -950,13 +950,13 @@ func testPluginDelete(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
func testPluginDeleteAllForPlugin(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
setupKVsForDeleteAll := func(t *testing.T) (string, func()) {
|
||||
pluginId := model.NewId()
|
||||
otherPluginId := model.NewId()
|
||||
pluginID := model.NewId()
|
||||
otherPluginID := model.NewId()
|
||||
|
||||
// otherPluginKV is another key value for another plugin, and used to verify other
|
||||
// keys aren't modified unintentionally.
|
||||
otherPluginKV := &model.PluginKeyValue{
|
||||
PluginId: otherPluginId,
|
||||
PluginId: otherPluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -964,7 +964,7 @@ func testPluginDeleteAllForPlugin(t *testing.T, rctx request.CTX, ss store.Store
|
||||
_, err := ss.Plugin().SaveOrUpdate(otherPluginKV)
|
||||
require.NoError(t, err)
|
||||
|
||||
return pluginId, func() {
|
||||
return pluginID, func() {
|
||||
actualOtherPluginKV, err := ss.Plugin().Get(otherPluginKV.PluginId, otherPluginKV.Key)
|
||||
require.NoError(t, err, "failed to find other key value from different plugin")
|
||||
assert.Equal(t, otherPluginKV, actualOtherPluginKV)
|
||||
@@ -972,19 +972,19 @@ func testPluginDeleteAllForPlugin(t *testing.T, rctx request.CTX, ss store.Store
|
||||
}
|
||||
|
||||
t.Run("no keys to delete", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVsForDeleteAll(t)
|
||||
pluginID, tearDown := setupKVsForDeleteAll(t)
|
||||
defer tearDown()
|
||||
|
||||
err := ss.Plugin().DeleteAllForPlugin(pluginId)
|
||||
err := ss.Plugin().DeleteAllForPlugin(pluginID)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("multiple keys to delete", func(t *testing.T) {
|
||||
pluginId, tearDown := setupKVsForDeleteAll(t)
|
||||
pluginID, tearDown := setupKVsForDeleteAll(t)
|
||||
defer tearDown()
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -993,7 +993,7 @@ func testPluginDeleteAllForPlugin(t *testing.T, rctx request.CTX, ss store.Store
|
||||
require.NoError(t, err)
|
||||
|
||||
kv2 := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1001,7 +1001,7 @@ func testPluginDeleteAllForPlugin(t *testing.T, rctx request.CTX, ss store.Store
|
||||
_, err = ss.Plugin().SaveOrUpdate(kv2)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = ss.Plugin().DeleteAllForPlugin(pluginId)
|
||||
err = ss.Plugin().DeleteAllForPlugin(pluginID)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = ss.Plugin().Get(kv.PluginId, kv.Key)
|
||||
@@ -1023,11 +1023,11 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
})
|
||||
|
||||
t.Run("no expiring keys to delete", func(t *testing.T) {
|
||||
pluginIdA := model.NewId()
|
||||
pluginIdB := model.NewId()
|
||||
pluginIDA := model.NewId()
|
||||
pluginIDB := model.NewId()
|
||||
|
||||
kvA1 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdA,
|
||||
PluginId: pluginIDA,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1036,7 +1036,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
kvA2 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdA,
|
||||
PluginId: pluginIDA,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1045,7 +1045,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
kvB1 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdB,
|
||||
PluginId: pluginIDB,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1054,7 +1054,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
kvB2 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdB,
|
||||
PluginId: pluginIDB,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1065,29 +1065,29 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
err = ss.Plugin().DeleteAllExpired()
|
||||
require.NoError(t, err)
|
||||
|
||||
actualKVA1, err := ss.Plugin().Get(pluginIdA, kvA1.Key)
|
||||
actualKVA1, err := ss.Plugin().Get(pluginIDA, kvA1.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvA1, actualKVA1)
|
||||
|
||||
actualKVA2, err := ss.Plugin().Get(pluginIdA, kvA2.Key)
|
||||
actualKVA2, err := ss.Plugin().Get(pluginIDA, kvA2.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvA2, actualKVA2)
|
||||
|
||||
actualKVB1, err := ss.Plugin().Get(pluginIdB, kvB1.Key)
|
||||
actualKVB1, err := ss.Plugin().Get(pluginIDB, kvB1.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvB1, actualKVB1)
|
||||
|
||||
actualKVB2, err := ss.Plugin().Get(pluginIdB, kvB2.Key)
|
||||
actualKVB2, err := ss.Plugin().Get(pluginIDB, kvB2.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvB2, actualKVB2)
|
||||
})
|
||||
|
||||
t.Run("no expired keys to delete", func(t *testing.T) {
|
||||
pluginIdA := model.NewId()
|
||||
pluginIdB := model.NewId()
|
||||
pluginIDA := model.NewId()
|
||||
pluginIDB := model.NewId()
|
||||
|
||||
kvA1 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdA,
|
||||
PluginId: pluginIDA,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() + 15*1000,
|
||||
@@ -1096,7 +1096,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
kvA2 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdA,
|
||||
PluginId: pluginIDA,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() + 15*1000,
|
||||
@@ -1105,7 +1105,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
kvB1 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdB,
|
||||
PluginId: pluginIDB,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() + 15*1000,
|
||||
@@ -1114,7 +1114,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
kvB2 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdB,
|
||||
PluginId: pluginIDB,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() + 15*1000,
|
||||
@@ -1125,29 +1125,29 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
err = ss.Plugin().DeleteAllExpired()
|
||||
require.NoError(t, err)
|
||||
|
||||
actualKVA1, err := ss.Plugin().Get(pluginIdA, kvA1.Key)
|
||||
actualKVA1, err := ss.Plugin().Get(pluginIDA, kvA1.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvA1, actualKVA1)
|
||||
|
||||
actualKVA2, err := ss.Plugin().Get(pluginIdA, kvA2.Key)
|
||||
actualKVA2, err := ss.Plugin().Get(pluginIDA, kvA2.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvA2, actualKVA2)
|
||||
|
||||
actualKVB1, err := ss.Plugin().Get(pluginIdB, kvB1.Key)
|
||||
actualKVB1, err := ss.Plugin().Get(pluginIDB, kvB1.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvB1, actualKVB1)
|
||||
|
||||
actualKVB2, err := ss.Plugin().Get(pluginIdB, kvB2.Key)
|
||||
actualKVB2, err := ss.Plugin().Get(pluginIDB, kvB2.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvB2, actualKVB2)
|
||||
})
|
||||
|
||||
t.Run("some expired keys to delete", func(t *testing.T) {
|
||||
pluginIdA := model.NewId()
|
||||
pluginIdB := model.NewId()
|
||||
pluginIDA := model.NewId()
|
||||
pluginIDB := model.NewId()
|
||||
|
||||
kvA1 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdA,
|
||||
PluginId: pluginIDA,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() + 15*1000,
|
||||
@@ -1156,7 +1156,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
expiredKVA2 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdA,
|
||||
PluginId: pluginIDA,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() - 15*1000,
|
||||
@@ -1165,7 +1165,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
kvB1 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdB,
|
||||
PluginId: pluginIDB,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() + 15*1000,
|
||||
@@ -1174,7 +1174,7 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
expiredKVB2 := &model.PluginKeyValue{
|
||||
PluginId: pluginIdB,
|
||||
PluginId: pluginIDB,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: model.GetMillis() - 15*1000,
|
||||
@@ -1185,21 +1185,21 @@ func testPluginDeleteAllExpired(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
err = ss.Plugin().DeleteAllExpired()
|
||||
require.NoError(t, err)
|
||||
|
||||
actualKVA1, err := ss.Plugin().Get(pluginIdA, kvA1.Key)
|
||||
actualKVA1, err := ss.Plugin().Get(pluginIDA, kvA1.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvA1, actualKVA1)
|
||||
|
||||
actualKVA2, err := ss.Plugin().Get(pluginIdA, expiredKVA2.Key)
|
||||
actualKVA2, err := ss.Plugin().Get(pluginIDA, expiredKVA2.Key)
|
||||
_, ok := err.(*store.ErrNotFound)
|
||||
require.Error(t, err)
|
||||
assert.True(t, ok)
|
||||
assert.Nil(t, actualKVA2)
|
||||
|
||||
actualKVB1, err := ss.Plugin().Get(pluginIdB, kvB1.Key)
|
||||
actualKVB1, err := ss.Plugin().Get(pluginIDB, kvB1.Key)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, kvB1, actualKVB1)
|
||||
|
||||
actualKVB2, err := ss.Plugin().Get(pluginIdB, expiredKVB2.Key)
|
||||
actualKVB2, err := ss.Plugin().Get(pluginIDB, expiredKVB2.Key)
|
||||
_, ok = err.(*store.ErrNotFound)
|
||||
require.Error(t, err)
|
||||
assert.True(t, ok)
|
||||
@@ -1212,9 +1212,9 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
// Ignore the pluginId setup by setupKVs
|
||||
pluginId := model.NewId()
|
||||
keys, err := ss.Plugin().List(pluginId, 0, 100)
|
||||
// Ignore the pluginID setup by setupKVs
|
||||
pluginID := model.NewId()
|
||||
keys, err := ss.Plugin().List(pluginID, 0, 100)
|
||||
require.NoError(t, err)
|
||||
assert.Empty(t, keys)
|
||||
})
|
||||
@@ -1223,11 +1223,11 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
// Ignore the pluginId setup by setupKVs
|
||||
pluginId := model.NewId()
|
||||
// Ignore the pluginID setup by setupKVs
|
||||
pluginID := model.NewId()
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: model.NewId(),
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1235,7 +1235,7 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, err := ss.Plugin().SaveOrUpdate(kv)
|
||||
require.NoError(t, err)
|
||||
|
||||
keys, err := ss.Plugin().List(pluginId, 0, 100)
|
||||
keys, err := ss.Plugin().List(pluginID, 0, 100)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys, 1)
|
||||
assert.Equal(t, kv.Key, keys[0])
|
||||
@@ -1245,14 +1245,14 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
// Ignore the pluginId setup by setupKVs
|
||||
pluginId := model.NewId()
|
||||
// Ignore the pluginID setup by setupKVs
|
||||
pluginID := model.NewId()
|
||||
|
||||
var keys []string
|
||||
for i := 0; i < 150; i++ {
|
||||
key := model.NewId()
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1264,11 +1264,11 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
keys1, err := ss.Plugin().List(pluginId, 0, 100)
|
||||
keys1, err := ss.Plugin().List(pluginID, 0, 100)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys1, 100)
|
||||
|
||||
keys2, err := ss.Plugin().List(pluginId, 100, 100)
|
||||
keys2, err := ss.Plugin().List(pluginID, 100, 100)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys2, 50)
|
||||
|
||||
@@ -1282,8 +1282,8 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
// Ignore the pluginId setup by setupKVs
|
||||
pluginId := model.NewId()
|
||||
// Ignore the pluginID setup by setupKVs
|
||||
pluginID := model.NewId()
|
||||
|
||||
var keys []string
|
||||
now := model.GetMillis()
|
||||
@@ -1300,7 +1300,7 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: expireAt,
|
||||
@@ -1314,11 +1314,11 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
keys1, err := ss.Plugin().List(pluginId, 0, 100)
|
||||
keys1, err := ss.Plugin().List(pluginID, 0, 100)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys1, 100)
|
||||
|
||||
keys2, err := ss.Plugin().List(pluginId, 100, 100)
|
||||
keys2, err := ss.Plugin().List(pluginID, 100, 100)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys2, 35)
|
||||
|
||||
@@ -1332,14 +1332,14 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
_, tearDown := setupKVs(t, rctx, ss)
|
||||
defer tearDown()
|
||||
|
||||
// Ignore the pluginId setup by setupKVs
|
||||
pluginId := model.NewId()
|
||||
// Ignore the pluginID setup by setupKVs
|
||||
pluginID := model.NewId()
|
||||
|
||||
var keys []string
|
||||
for i := 0; i < 150; i++ {
|
||||
key := model.NewId()
|
||||
kv := &model.PluginKeyValue{
|
||||
PluginId: pluginId,
|
||||
PluginId: pluginID,
|
||||
Key: key,
|
||||
Value: []byte(model.NewId()),
|
||||
ExpireAt: 0,
|
||||
@@ -1352,19 +1352,19 @@ func testPluginList(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
sort.Strings(keys)
|
||||
|
||||
t.Run("default limit", func(t *testing.T) {
|
||||
keys1, err := ss.Plugin().List(pluginId, 0, 0)
|
||||
keys1, err := ss.Plugin().List(pluginID, 0, 0)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys1, 10)
|
||||
})
|
||||
|
||||
t.Run("offset 0, limit 1", func(t *testing.T) {
|
||||
keys2, err := ss.Plugin().List(pluginId, 0, 1)
|
||||
keys2, err := ss.Plugin().List(pluginID, 0, 1)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys2, 1)
|
||||
})
|
||||
|
||||
t.Run("offset 1, limit 1", func(t *testing.T) {
|
||||
keys2, err := ss.Plugin().List(pluginId, 1, 1)
|
||||
keys2, err := ss.Plugin().List(pluginID, 1, 1)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, keys2, 1)
|
||||
})
|
||||
|
||||
@@ -20,12 +20,12 @@ func TestPostAcknowledgementsStore(t *testing.T, rctx request.CTX, ss store.Stor
|
||||
}
|
||||
|
||||
func testPostAcknowledgementsStoreSave(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId1 := model.NewId()
|
||||
userID1 := model.NewId()
|
||||
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
Priority: model.NewPointer("important"),
|
||||
@@ -37,13 +37,13 @@ func testPostAcknowledgementsStoreSave(t *testing.T, rctx request.CTX, ss store.
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("consecutive saves should just update the acknowledged at", func(t *testing.T) {
|
||||
_, err := ss.PostAcknowledgement().Save(post.Id, userId1, 0)
|
||||
_, err := ss.PostAcknowledgement().Save(post.Id, userID1, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = ss.PostAcknowledgement().Save(post.Id, userId1, 0)
|
||||
_, err = ss.PostAcknowledgement().Save(post.Id, userID1, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
ack1, err := ss.PostAcknowledgement().Save(post.Id, userId1, 0)
|
||||
ack1, err := ss.PostAcknowledgement().Save(post.Id, userID1, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
acknowledgements, err := ss.PostAcknowledgement().GetForPost(post.Id)
|
||||
@@ -53,7 +53,7 @@ func testPostAcknowledgementsStoreSave(t *testing.T, rctx request.CTX, ss store.
|
||||
|
||||
t.Run("saving should update the update at of the post", func(t *testing.T) {
|
||||
oldUpdateAt := post.UpdateAt
|
||||
_, err := ss.PostAcknowledgement().Save(post.Id, userId1, 0)
|
||||
_, err := ss.PostAcknowledgement().Save(post.Id, userID1, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
post, err = ss.Post().GetSingle(rctx, post.Id, false)
|
||||
@@ -63,14 +63,14 @@ func testPostAcknowledgementsStoreSave(t *testing.T, rctx request.CTX, ss store.
|
||||
}
|
||||
|
||||
func testPostAcknowledgementsStoreGetForPost(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId1 := model.NewId()
|
||||
userId2 := model.NewId()
|
||||
userId3 := model.NewId()
|
||||
userID1 := model.NewId()
|
||||
userID2 := model.NewId()
|
||||
userID3 := model.NewId()
|
||||
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
Priority: model.NewPointer("important"),
|
||||
@@ -82,11 +82,11 @@ func testPostAcknowledgementsStoreGetForPost(t *testing.T, rctx request.CTX, ss
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("get acknowledgements for post", func(t *testing.T) {
|
||||
ack1, err := ss.PostAcknowledgement().Save(p1.Id, userId1, 0)
|
||||
ack1, err := ss.PostAcknowledgement().Save(p1.Id, userID1, 0)
|
||||
require.NoError(t, err)
|
||||
ack2, err := ss.PostAcknowledgement().Save(p1.Id, userId2, 0)
|
||||
ack2, err := ss.PostAcknowledgement().Save(p1.Id, userID2, 0)
|
||||
require.NoError(t, err)
|
||||
ack3, err := ss.PostAcknowledgement().Save(p1.Id, userId3, 0)
|
||||
ack3, err := ss.PostAcknowledgement().Save(p1.Id, userID3, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
acknowledgements, err := ss.PostAcknowledgement().GetForPost(p1.Id)
|
||||
@@ -114,14 +114,14 @@ func testPostAcknowledgementsStoreGetForPost(t *testing.T, rctx request.CTX, ss
|
||||
}
|
||||
|
||||
func testPostAcknowledgementsStoreGetForPosts(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userId1 := model.NewId()
|
||||
userId2 := model.NewId()
|
||||
userId3 := model.NewId()
|
||||
userID1 := model.NewId()
|
||||
userID2 := model.NewId()
|
||||
userID3 := model.NewId()
|
||||
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
Priority: model.NewPointer("important"),
|
||||
@@ -132,7 +132,7 @@ func testPostAcknowledgementsStoreGetForPosts(t *testing.T, rctx request.CTX, ss
|
||||
p2 := model.Post{}
|
||||
p2.ChannelId = model.NewId()
|
||||
p2.UserId = model.NewId()
|
||||
p2.Message = NewTestId()
|
||||
p2.Message = NewTestID()
|
||||
p2.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
Priority: model.NewPointer(""),
|
||||
@@ -145,13 +145,13 @@ func testPostAcknowledgementsStoreGetForPosts(t *testing.T, rctx request.CTX, ss
|
||||
require.Equal(t, -1, errIdx)
|
||||
|
||||
t.Run("get acknowledgements for post", func(t *testing.T) {
|
||||
ack1, err := ss.PostAcknowledgement().Save(p1.Id, userId1, 0)
|
||||
ack1, err := ss.PostAcknowledgement().Save(p1.Id, userID1, 0)
|
||||
require.NoError(t, err)
|
||||
ack2, err := ss.PostAcknowledgement().Save(p1.Id, userId2, 0)
|
||||
ack2, err := ss.PostAcknowledgement().Save(p1.Id, userID2, 0)
|
||||
require.NoError(t, err)
|
||||
ack3, err := ss.PostAcknowledgement().Save(p2.Id, userId2, 0)
|
||||
ack3, err := ss.PostAcknowledgement().Save(p2.Id, userID2, 0)
|
||||
require.NoError(t, err)
|
||||
ack4, err := ss.PostAcknowledgement().Save(p2.Id, userId3, 0)
|
||||
ack4, err := ss.PostAcknowledgement().Save(p2.Id, userID3, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
acknowledgements, err := ss.PostAcknowledgement().GetForPosts([]string{p1.Id})
|
||||
|
||||
@@ -24,7 +24,7 @@ func testPostPersistentNotificationStoreGet(t *testing.T, rctx request.CTX, ss s
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.CreateAt = 10
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -37,7 +37,7 @@ func testPostPersistentNotificationStoreGet(t *testing.T, rctx request.CTX, ss s
|
||||
p2 := model.Post{}
|
||||
p2.ChannelId = p1.ChannelId
|
||||
p2.UserId = model.NewId()
|
||||
p2.Message = NewTestId()
|
||||
p2.Message = NewTestID()
|
||||
p2.CreateAt = 20
|
||||
p2.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -51,14 +51,14 @@ func testPostPersistentNotificationStoreGet(t *testing.T, rctx request.CTX, ss s
|
||||
p3 := model.Post{}
|
||||
p3.ChannelId = p1.ChannelId
|
||||
p3.UserId = model.NewId()
|
||||
p3.Message = NewTestId()
|
||||
p3.Message = NewTestID()
|
||||
p3.CreateAt = 30
|
||||
|
||||
// Invalid - Notification is false
|
||||
p4 := model.Post{}
|
||||
p4.ChannelId = p1.ChannelId
|
||||
p4.UserId = model.NewId()
|
||||
p4.Message = NewTestId()
|
||||
p4.Message = NewTestID()
|
||||
p4.CreateAt = 40
|
||||
p4.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -71,7 +71,7 @@ func testPostPersistentNotificationStoreGet(t *testing.T, rctx request.CTX, ss s
|
||||
p5 := model.Post{}
|
||||
p5.ChannelId = p1.ChannelId
|
||||
p5.UserId = model.NewId()
|
||||
p5.Message = NewTestId()
|
||||
p5.Message = NewTestID()
|
||||
p5.CreateAt = 50
|
||||
p5.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -146,7 +146,7 @@ func testPostPersistentNotificationStoreUpdateLastSentAt(t *testing.T, rctx requ
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.CreateAt = 10
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -199,7 +199,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.CreateAt = 10
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -212,7 +212,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p2 := model.Post{}
|
||||
p2.ChannelId = p1.ChannelId
|
||||
p2.UserId = model.NewId()
|
||||
p2.Message = NewTestId()
|
||||
p2.Message = NewTestID()
|
||||
p2.CreateAt = 20
|
||||
p2.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -225,7 +225,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p3 := model.Post{}
|
||||
p3.ChannelId = p1.ChannelId
|
||||
p3.UserId = model.NewId()
|
||||
p3.Message = NewTestId()
|
||||
p3.Message = NewTestID()
|
||||
p3.CreateAt = 30
|
||||
p3.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -259,7 +259,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.CreateAt = 10
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -272,7 +272,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p2 := model.Post{}
|
||||
p2.ChannelId = p1.ChannelId
|
||||
p2.UserId = model.NewId()
|
||||
p2.Message = NewTestId()
|
||||
p2.Message = NewTestID()
|
||||
p2.CreateAt = 20
|
||||
p2.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -285,7 +285,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p3 := model.Post{}
|
||||
p3.ChannelId = p1.ChannelId
|
||||
p3.UserId = model.NewId()
|
||||
p3.Message = NewTestId()
|
||||
p3.Message = NewTestID()
|
||||
p3.CreateAt = 30
|
||||
p3.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -298,7 +298,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p4 := model.Post{}
|
||||
p4.ChannelId = model.NewId()
|
||||
p4.UserId = model.NewId()
|
||||
p4.Message = NewTestId()
|
||||
p4.Message = NewTestID()
|
||||
p4.CreateAt = 40
|
||||
p4.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -311,7 +311,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p5 := model.Post{}
|
||||
p5.ChannelId = p4.ChannelId
|
||||
p5.UserId = model.NewId()
|
||||
p5.Message = NewTestId()
|
||||
p5.Message = NewTestID()
|
||||
p5.CreateAt = 50
|
||||
p5.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -343,10 +343,10 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
})
|
||||
|
||||
t.Run("Delete By Team", func(t *testing.T) {
|
||||
t1 := &model.Team{DisplayName: "t1", Name: NewTestId(), Email: MakeEmail(), Type: model.TeamOpen}
|
||||
t1 := &model.Team{DisplayName: "t1", Name: NewTestID(), Email: MakeEmail(), Type: model.TeamOpen}
|
||||
_, err := ss.Team().Save(t1)
|
||||
require.NoError(t, err)
|
||||
t2 := &model.Team{DisplayName: "t2", Name: NewTestId(), Email: MakeEmail(), Type: model.TeamOpen}
|
||||
t2 := &model.Team{DisplayName: "t2", Name: NewTestID(), Email: MakeEmail(), Type: model.TeamOpen}
|
||||
_, err = ss.Team().Save(t2)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -363,7 +363,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = c1.Id
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.CreateAt = 10
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -376,7 +376,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p2 := model.Post{}
|
||||
p2.ChannelId = p1.ChannelId
|
||||
p2.UserId = model.NewId()
|
||||
p2.Message = NewTestId()
|
||||
p2.Message = NewTestID()
|
||||
p2.CreateAt = 20
|
||||
p2.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -389,7 +389,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p3 := model.Post{}
|
||||
p3.ChannelId = c2.Id
|
||||
p3.UserId = model.NewId()
|
||||
p3.Message = NewTestId()
|
||||
p3.Message = NewTestID()
|
||||
p3.CreateAt = 30
|
||||
p3.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -402,7 +402,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p4 := model.Post{}
|
||||
p4.ChannelId = c3.Id
|
||||
p4.UserId = model.NewId()
|
||||
p4.Message = NewTestId()
|
||||
p4.Message = NewTestID()
|
||||
p4.CreateAt = 40
|
||||
p4.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
@@ -415,7 +415,7 @@ func testPostPersistentNotificationStoreDelete(t *testing.T, rctx request.CTX, s
|
||||
p5 := model.Post{}
|
||||
p5.ChannelId = p4.ChannelId
|
||||
p5.UserId = model.NewId()
|
||||
p5.Message = NewTestId()
|
||||
p5.Message = NewTestID()
|
||||
p5.CreateAt = 50
|
||||
p5.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
|
||||
@@ -25,7 +25,7 @@ func testPostPriorityStoreGetForPost(t *testing.T, rctx request.CTX, ss store.St
|
||||
p1 := model.Post{}
|
||||
p1.ChannelId = model.NewId()
|
||||
p1.UserId = model.NewId()
|
||||
p1.Message = NewTestId()
|
||||
p1.Message = NewTestID()
|
||||
p1.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
Priority: model.NewPointer("important"),
|
||||
@@ -37,7 +37,7 @@ func testPostPriorityStoreGetForPost(t *testing.T, rctx request.CTX, ss store.St
|
||||
p2 := model.Post{}
|
||||
p2.ChannelId = model.NewId()
|
||||
p2.UserId = model.NewId()
|
||||
p2.Message = NewTestId()
|
||||
p2.Message = NewTestID()
|
||||
p2.Metadata = &model.PostMetadata{
|
||||
Priority: &model.PostPriority{
|
||||
Priority: model.NewPointer(model.PostPriorityUrgent),
|
||||
@@ -49,7 +49,7 @@ func testPostPriorityStoreGetForPost(t *testing.T, rctx request.CTX, ss store.St
|
||||
p3 := model.Post{}
|
||||
p3.ChannelId = model.NewId()
|
||||
p3.UserId = model.NewId()
|
||||
p3.Message = NewTestId()
|
||||
p3.Message = NewTestID()
|
||||
|
||||
_, errIdx, err := ss.Post().SaveMultiple([]*model.Post{&p1, &p2, &p3})
|
||||
require.NoError(t, err)
|
||||
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -66,7 +66,7 @@ func (s ByUserId) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
func (s ByUserId) Less(i, j int) bool { return s[i].UserId < s[j].UserId }
|
||||
|
||||
func testUpdateExpiredDNDStatuses(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
userID := NewTestId()
|
||||
userID := NewTestID()
|
||||
|
||||
status := &model.Status{UserId: userID, Status: model.StatusDnd, Manual: true,
|
||||
DNDEndTime: time.Now().Add(5 * time.Second).Unix(), PrevStatus: model.StatusOnline}
|
||||
|
||||
@@ -80,7 +80,7 @@ func TestTeamStore(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testTeamStoreSave(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
|
||||
@@ -98,7 +98,7 @@ func testTeamStoreSave(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testTeamStoreUpdate(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
_, err := ss.Team().Save(&o1)
|
||||
@@ -121,7 +121,7 @@ func testTeamStoreUpdate(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testTeamStoreGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
_, err := ss.Team().Save(&o1)
|
||||
@@ -138,7 +138,7 @@ func testTeamStoreGet(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testTeamStoreGetMany(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1, err := ss.Team().Save(&model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
})
|
||||
@@ -146,7 +146,7 @@ func testTeamStoreGetMany(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o2, err := ss.Team().Save(&model.Team{
|
||||
DisplayName: "DisplayName2",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
})
|
||||
@@ -169,7 +169,7 @@ func testTeamStoreGetMany(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testTeamStoreGetByNames(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
|
||||
@@ -178,7 +178,7 @@ func testTeamStoreGetByNames(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName2"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
|
||||
@@ -222,7 +222,7 @@ func testTeamStoreGetByNames(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testTeamStoreGetByName(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
|
||||
@@ -251,8 +251,8 @@ func testTeamStoreSearchAll(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
cleanupTeamStore(t, rctx, ss)
|
||||
|
||||
o := model.Team{}
|
||||
o.DisplayName = "ADisplayName" + NewTestId()
|
||||
o.Name = "searchterm-" + NewTestId()
|
||||
o.DisplayName = "ADisplayName" + NewTestID()
|
||||
o.Name = "searchterm-" + NewTestID()
|
||||
o.Email = MakeEmail()
|
||||
o.Type = model.TeamOpen
|
||||
o.AllowOpenInvite = true
|
||||
@@ -261,8 +261,8 @@ func testTeamStoreSearchAll(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
|
||||
p := model.Team{}
|
||||
p.DisplayName = "BDisplayName" + NewTestId()
|
||||
p.Name = "searchterm-" + NewTestId()
|
||||
p.DisplayName = "BDisplayName" + NewTestID()
|
||||
p.Name = "searchterm-" + NewTestID()
|
||||
p.Email = MakeEmail()
|
||||
p.Type = model.TeamOpen
|
||||
p.AllowOpenInvite = false
|
||||
@@ -271,8 +271,8 @@ func testTeamStoreSearchAll(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
|
||||
g := model.Team{}
|
||||
g.DisplayName = "CDisplayName" + NewTestId()
|
||||
g.Name = "searchterm-" + NewTestId()
|
||||
g.DisplayName = "CDisplayName" + NewTestID()
|
||||
g.Name = "searchterm-" + NewTestID()
|
||||
g.Email = MakeEmail()
|
||||
g.Type = model.TeamOpen
|
||||
g.AllowOpenInvite = false
|
||||
@@ -438,8 +438,8 @@ func testTeamStoreSearchAll(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
func testTeamStoreSearchOpen(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o := model.Team{}
|
||||
o.DisplayName = "ADisplayName" + NewTestId()
|
||||
o.Name = NewTestId()
|
||||
o.DisplayName = "ADisplayName" + NewTestID()
|
||||
o.Name = NewTestID()
|
||||
o.Email = MakeEmail()
|
||||
o.Type = model.TeamOpen
|
||||
o.AllowOpenInvite = true
|
||||
@@ -448,8 +448,8 @@ func testTeamStoreSearchOpen(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
require.NoError(t, err)
|
||||
|
||||
p := model.Team{}
|
||||
p.DisplayName = "ADisplayName" + NewTestId()
|
||||
p.Name = NewTestId()
|
||||
p.DisplayName = "ADisplayName" + NewTestID()
|
||||
p.Name = NewTestID()
|
||||
p.Email = MakeEmail()
|
||||
p.Type = model.TeamOpen
|
||||
p.AllowOpenInvite = false
|
||||
@@ -544,8 +544,8 @@ func testTeamStoreSearchOpen(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
func testTeamStoreSearchPrivate(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o := model.Team{}
|
||||
o.DisplayName = "ADisplayName" + NewTestId()
|
||||
o.Name = NewTestId()
|
||||
o.DisplayName = "ADisplayName" + NewTestID()
|
||||
o.Name = NewTestID()
|
||||
o.Email = MakeEmail()
|
||||
o.Type = model.TeamOpen
|
||||
o.AllowOpenInvite = true
|
||||
@@ -554,8 +554,8 @@ func testTeamStoreSearchPrivate(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
require.NoError(t, err)
|
||||
|
||||
p := model.Team{}
|
||||
p.DisplayName = "ADisplayName" + NewTestId()
|
||||
p.Name = NewTestId()
|
||||
p.DisplayName = "ADisplayName" + NewTestID()
|
||||
p.Name = NewTestID()
|
||||
p.Email = MakeEmail()
|
||||
p.Type = model.TeamOpen
|
||||
p.AllowOpenInvite = false
|
||||
@@ -651,7 +651,7 @@ func testTeamStoreSearchPrivate(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
func testTeamStoreGetByInviteId(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.InviteId = model.NewId()
|
||||
@@ -670,7 +670,7 @@ func testTeamStoreGetByInviteId(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
func testTeamStoreByUserId(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := &model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.InviteId = model.NewId()
|
||||
@@ -748,7 +748,7 @@ func testTeamStoreGetAllPage(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testGetAllTeamListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -757,7 +757,7 @@ func testGetAllTeamListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
_, err = ss.Team().Save(&o2)
|
||||
@@ -765,7 +765,7 @@ func testGetAllTeamListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o3 := model.Team{}
|
||||
o3.DisplayName = "DisplayName"
|
||||
o3.Name = NewTestId()
|
||||
o3.Name = NewTestID()
|
||||
o3.Email = MakeEmail()
|
||||
o3.Type = model.TeamInvite
|
||||
o3.AllowOpenInvite = true
|
||||
@@ -774,7 +774,7 @@ func testGetAllTeamListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o4 := model.Team{}
|
||||
o4.DisplayName = "DisplayName"
|
||||
o4.Name = NewTestId()
|
||||
o4.Name = NewTestID()
|
||||
o4.Email = MakeEmail()
|
||||
o4.Type = model.TeamInvite
|
||||
_, err = ss.Team().Save(&o4)
|
||||
@@ -792,7 +792,7 @@ func testGetAllTeamListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testGetAllTeamPageListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -801,7 +801,7 @@ func testGetAllTeamPageListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
o2.AllowOpenInvite = false
|
||||
@@ -810,7 +810,7 @@ func testGetAllTeamPageListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o3 := model.Team{}
|
||||
o3.DisplayName = "DisplayName"
|
||||
o3.Name = NewTestId()
|
||||
o3.Name = NewTestID()
|
||||
o3.Email = MakeEmail()
|
||||
o3.Type = model.TeamInvite
|
||||
o3.AllowOpenInvite = true
|
||||
@@ -819,7 +819,7 @@ func testGetAllTeamPageListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o4 := model.Team{}
|
||||
o4.DisplayName = "DisplayName"
|
||||
o4.Name = NewTestId()
|
||||
o4.Name = NewTestID()
|
||||
o4.Email = MakeEmail()
|
||||
o4.Type = model.TeamInvite
|
||||
o4.AllowOpenInvite = false
|
||||
@@ -839,7 +839,7 @@ func testGetAllTeamPageListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o5 := model.Team{}
|
||||
o5.DisplayName = "DisplayName"
|
||||
o5.Name = NewTestId()
|
||||
o5.Name = NewTestID()
|
||||
o5.Email = MakeEmail()
|
||||
o5.Type = model.TeamOpen
|
||||
o5.AllowOpenInvite = true
|
||||
@@ -868,7 +868,7 @@ func testGetAllTeamPageListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testGetAllPrivateTeamListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -877,7 +877,7 @@ func testGetAllPrivateTeamListing(t *testing.T, rctx request.CTX, ss store.Store
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
_, err = ss.Team().Save(&o2)
|
||||
@@ -885,7 +885,7 @@ func testGetAllPrivateTeamListing(t *testing.T, rctx request.CTX, ss store.Store
|
||||
|
||||
o3 := model.Team{}
|
||||
o3.DisplayName = "DisplayName"
|
||||
o3.Name = NewTestId()
|
||||
o3.Name = NewTestID()
|
||||
o3.Email = MakeEmail()
|
||||
o3.Type = model.TeamInvite
|
||||
o3.AllowOpenInvite = true
|
||||
@@ -894,7 +894,7 @@ func testGetAllPrivateTeamListing(t *testing.T, rctx request.CTX, ss store.Store
|
||||
|
||||
o4 := model.Team{}
|
||||
o4.DisplayName = "DisplayName"
|
||||
o4.Name = NewTestId()
|
||||
o4.Name = NewTestID()
|
||||
o4.Email = MakeEmail()
|
||||
o4.Type = model.TeamInvite
|
||||
_, err = ss.Team().Save(&o4)
|
||||
@@ -912,7 +912,7 @@ func testGetAllPrivateTeamListing(t *testing.T, rctx request.CTX, ss store.Store
|
||||
func testGetAllPrivateTeamPageListing(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -921,7 +921,7 @@ func testGetAllPrivateTeamPageListing(t *testing.T, rctx request.CTX, ss store.S
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
o2.AllowOpenInvite = false
|
||||
@@ -930,7 +930,7 @@ func testGetAllPrivateTeamPageListing(t *testing.T, rctx request.CTX, ss store.S
|
||||
|
||||
o3 := model.Team{}
|
||||
o3.DisplayName = "DisplayName"
|
||||
o3.Name = NewTestId()
|
||||
o3.Name = NewTestID()
|
||||
o3.Email = MakeEmail()
|
||||
o3.Type = model.TeamInvite
|
||||
o3.AllowOpenInvite = true
|
||||
@@ -939,7 +939,7 @@ func testGetAllPrivateTeamPageListing(t *testing.T, rctx request.CTX, ss store.S
|
||||
|
||||
o4 := model.Team{}
|
||||
o4.DisplayName = "DisplayName"
|
||||
o4.Name = NewTestId()
|
||||
o4.Name = NewTestID()
|
||||
o4.Email = MakeEmail()
|
||||
o4.Type = model.TeamInvite
|
||||
o4.AllowOpenInvite = false
|
||||
@@ -958,7 +958,7 @@ func testGetAllPrivateTeamPageListing(t *testing.T, rctx request.CTX, ss store.S
|
||||
|
||||
o5 := model.Team{}
|
||||
o5.DisplayName = "DisplayName"
|
||||
o5.Name = NewTestId()
|
||||
o5.Name = NewTestID()
|
||||
o5.Email = MakeEmail()
|
||||
o5.Type = model.TeamOpen
|
||||
o5.AllowOpenInvite = true
|
||||
@@ -987,7 +987,7 @@ func testGetAllPublicTeamPageListing(t *testing.T, rctx request.CTX, ss store.St
|
||||
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName1"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -996,7 +996,7 @@ func testGetAllPublicTeamPageListing(t *testing.T, rctx request.CTX, ss store.St
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName2"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
o2.AllowOpenInvite = false
|
||||
@@ -1005,7 +1005,7 @@ func testGetAllPublicTeamPageListing(t *testing.T, rctx request.CTX, ss store.St
|
||||
|
||||
o3 := model.Team{}
|
||||
o3.DisplayName = "DisplayName3"
|
||||
o3.Name = NewTestId()
|
||||
o3.Name = NewTestID()
|
||||
o3.Email = MakeEmail()
|
||||
o3.Type = model.TeamInvite
|
||||
o3.AllowOpenInvite = true
|
||||
@@ -1014,7 +1014,7 @@ func testGetAllPublicTeamPageListing(t *testing.T, rctx request.CTX, ss store.St
|
||||
|
||||
o4 := model.Team{}
|
||||
o4.DisplayName = "DisplayName4"
|
||||
o4.Name = NewTestId()
|
||||
o4.Name = NewTestID()
|
||||
o4.Email = MakeEmail()
|
||||
o4.Type = model.TeamInvite
|
||||
o4.AllowOpenInvite = false
|
||||
@@ -1029,7 +1029,7 @@ func testGetAllPublicTeamPageListing(t *testing.T, rctx request.CTX, ss store.St
|
||||
|
||||
o5 := model.Team{}
|
||||
o5.DisplayName = "DisplayName5"
|
||||
o5.Name = NewTestId()
|
||||
o5.Name = NewTestID()
|
||||
o5.Email = MakeEmail()
|
||||
o5.Type = model.TeamOpen
|
||||
o5.AllowOpenInvite = true
|
||||
@@ -1047,7 +1047,7 @@ func testGetAllPublicTeamPageListing(t *testing.T, rctx request.CTX, ss store.St
|
||||
func testDelete(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -1056,7 +1056,7 @@ func testDelete(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
_, err = ss.Team().Save(&o2)
|
||||
@@ -1071,7 +1071,7 @@ func testPublicTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -1080,7 +1080,7 @@ func testPublicTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
o2.AllowOpenInvite = false
|
||||
@@ -1089,7 +1089,7 @@ func testPublicTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o3 := model.Team{}
|
||||
o3.DisplayName = "DisplayName"
|
||||
o3.Name = NewTestId()
|
||||
o3.Name = NewTestID()
|
||||
o3.Email = MakeEmail()
|
||||
o3.Type = model.TeamOpen
|
||||
o3.AllowOpenInvite = true
|
||||
@@ -1106,7 +1106,7 @@ func testPrivateTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = false
|
||||
@@ -1115,7 +1115,7 @@ func testPrivateTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o2 := model.Team{}
|
||||
o2.DisplayName = "DisplayName"
|
||||
o2.Name = NewTestId()
|
||||
o2.Name = NewTestID()
|
||||
o2.Email = MakeEmail()
|
||||
o2.Type = model.TeamOpen
|
||||
o2.AllowOpenInvite = true
|
||||
@@ -1124,7 +1124,7 @@ func testPrivateTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
o3 := model.Team{}
|
||||
o3.DisplayName = "DisplayName"
|
||||
o3.Name = NewTestId()
|
||||
o3.Name = NewTestID()
|
||||
o3.Email = MakeEmail()
|
||||
o3.Type = model.TeamOpen
|
||||
o3.AllowOpenInvite = false
|
||||
@@ -1139,7 +1139,7 @@ func testPrivateTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
func testTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Team{}
|
||||
o1.DisplayName = "DisplayName"
|
||||
o1.Name = NewTestId()
|
||||
o1.Name = NewTestID()
|
||||
o1.Email = MakeEmail()
|
||||
o1.Type = model.TeamOpen
|
||||
o1.AllowOpenInvite = true
|
||||
@@ -1422,7 +1422,7 @@ func testTeamSaveMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("insert member correctly (in team without scheme)", func(t *testing.T) {
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -1562,9 +1562,9 @@ func testTeamSaveMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
t.Run("insert member correctly (in team with scheme)", func(t *testing.T) {
|
||||
ts := &model.Scheme{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
ts, nErr := ss.Scheme().Save(ts)
|
||||
@@ -1572,7 +1572,7 @@ func testTeamSaveMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &ts.Id,
|
||||
@@ -1778,7 +1778,7 @@ func testTeamSaveMultipleMembers(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
t.Run("insert members correctly (in team without scheme)", func(t *testing.T) {
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -1930,9 +1930,9 @@ func testTeamSaveMultipleMembers(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
|
||||
t.Run("insert members correctly (in team with scheme)", func(t *testing.T) {
|
||||
ts := &model.Scheme{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
ts, nErr := ss.Scheme().Save(ts)
|
||||
@@ -1940,7 +1940,7 @@ func testTeamSaveMultipleMembers(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &ts.Id,
|
||||
@@ -2107,7 +2107,7 @@ func testTeamUpdateMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("insert member correctly (in team without scheme)", func(t *testing.T) {
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -2247,9 +2247,9 @@ func testTeamUpdateMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
t.Run("insert member correctly (in team with scheme)", func(t *testing.T) {
|
||||
ts := &model.Scheme{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
ts, nErr := ss.Scheme().Save(ts)
|
||||
@@ -2257,7 +2257,7 @@ func testTeamUpdateMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &ts.Id,
|
||||
@@ -2416,7 +2416,7 @@ func testTeamUpdateMultipleMembers(t *testing.T, rctx request.CTX, ss store.Stor
|
||||
t.Run("update members correctly (in team without scheme)", func(t *testing.T) {
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -2564,9 +2564,9 @@ func testTeamUpdateMultipleMembers(t *testing.T, rctx request.CTX, ss store.Stor
|
||||
|
||||
t.Run("insert members correctly (in team with scheme)", func(t *testing.T) {
|
||||
ts := &model.Scheme{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
ts, nErr := ss.Scheme().Save(ts)
|
||||
@@ -2574,7 +2574,7 @@ func testTeamUpdateMultipleMembers(t *testing.T, rctx request.CTX, ss store.Stor
|
||||
|
||||
team := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &ts.Id,
|
||||
@@ -2876,7 +2876,7 @@ func testSaveTeamMemberMaxMembers(t *testing.T, rctx request.CTX, ss store.Store
|
||||
|
||||
team, errSave := ss.Team().Save(&model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.TeamOpen,
|
||||
})
|
||||
require.NoError(t, errSave)
|
||||
@@ -2888,7 +2888,7 @@ func testSaveTeamMemberMaxMembers(t *testing.T, rctx request.CTX, ss store.Store
|
||||
|
||||
for i := 0; i < maxUsersPerTeam; i++ {
|
||||
user, err := ss.User().Save(rctx, &model.User{
|
||||
Username: "a" + NewTestId(),
|
||||
Username: "a" + NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -2914,7 +2914,7 @@ func testSaveTeamMemberMaxMembers(t *testing.T, rctx request.CTX, ss store.Store
|
||||
require.Equal(t, int(totalMemberCount), maxUsersPerTeam, "should start with 5 team members, had %v instead", totalMemberCount)
|
||||
|
||||
user, nErr := ss.User().Save(rctx, &model.User{
|
||||
Username: "a" + NewTestId(),
|
||||
Username: "a" + NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
})
|
||||
require.NoError(t, nErr)
|
||||
@@ -2962,7 +2962,7 @@ func testSaveTeamMemberMaxMembers(t *testing.T, rctx request.CTX, ss store.Store
|
||||
require.NoError(t, nErr)
|
||||
|
||||
user, nErr = ss.User().Save(rctx, &model.User{
|
||||
Username: "a" + NewTestId(),
|
||||
Username: "a" + NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
})
|
||||
require.NoError(t, nErr)
|
||||
@@ -2996,9 +2996,9 @@ func testGetTeamMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
// Test with a custom team scheme.
|
||||
s2 := &model.Scheme{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
s2, nErr = ss.Scheme().Save(s2)
|
||||
@@ -3007,7 +3007,7 @@ func testGetTeamMember(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
t2, nErr := ss.Team().Save(&model.Team{
|
||||
DisplayName: "DisplayName",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s2.Id,
|
||||
})
|
||||
@@ -3224,16 +3224,16 @@ func testUpdateLastTeamIconUpdate(t *testing.T, rctx request.CTX, ss store.Store
|
||||
func testGetTeamsByScheme(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
// Create some schemes.
|
||||
s1 := &model.Scheme{
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
DisplayName: NewTestID(),
|
||||
Name: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
|
||||
s2 := &model.Scheme{
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
DisplayName: NewTestID(),
|
||||
Name: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
|
||||
@@ -3244,24 +3244,24 @@ func testGetTeamsByScheme(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
|
||||
// Create and save some teams.
|
||||
t1 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s1.Id,
|
||||
}
|
||||
|
||||
t2 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s1.Id,
|
||||
}
|
||||
|
||||
t3 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -3295,7 +3295,7 @@ func testTeamStoreMigrateTeamMembers(t *testing.T, rctx request.CTX, ss store.St
|
||||
s1 := model.NewId()
|
||||
t1 := &model.Team{
|
||||
DisplayName: "Name",
|
||||
Name: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
InviteId: model.NewId(),
|
||||
@@ -3306,17 +3306,17 @@ func testTeamStoreMigrateTeamMembers(t *testing.T, rctx request.CTX, ss store.St
|
||||
|
||||
tm1 := &model.TeamMember{
|
||||
TeamId: t1.Id,
|
||||
UserId: NewTestId(),
|
||||
UserId: NewTestID(),
|
||||
ExplicitRoles: "team_admin team_user",
|
||||
}
|
||||
tm2 := &model.TeamMember{
|
||||
TeamId: t1.Id,
|
||||
UserId: NewTestId(),
|
||||
UserId: NewTestID(),
|
||||
ExplicitRoles: "team_user",
|
||||
}
|
||||
tm3 := &model.TeamMember{
|
||||
TeamId: t1.Id,
|
||||
UserId: NewTestId(),
|
||||
UserId: NewTestID(),
|
||||
ExplicitRoles: "something_else",
|
||||
}
|
||||
|
||||
@@ -3362,25 +3362,25 @@ func testTeamStoreMigrateTeamMembers(t *testing.T, rctx request.CTX, ss store.St
|
||||
|
||||
func testResetAllTeamSchemes(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
s1 := &model.Scheme{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
s1, err := ss.Scheme().Save(s1)
|
||||
require.NoError(t, err)
|
||||
|
||||
t1 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s1.Id,
|
||||
}
|
||||
|
||||
t2 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s1.Id,
|
||||
@@ -3453,9 +3453,9 @@ func testTeamStoreClearAllCustomRoleAssignments(t *testing.T, rctx request.CTX,
|
||||
|
||||
func testTeamStoreAnalyticsGetTeamCountForScheme(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
s1 := &model.Scheme{
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestId(),
|
||||
Description: NewTestId(),
|
||||
DisplayName: NewTestID(),
|
||||
Name: NewTestID(),
|
||||
Description: NewTestID(),
|
||||
Scope: model.SchemeScopeTeam,
|
||||
}
|
||||
s1, err := ss.Scheme().Save(s1)
|
||||
@@ -3466,8 +3466,8 @@ func testTeamStoreAnalyticsGetTeamCountForScheme(t *testing.T, rctx request.CTX,
|
||||
assert.Equal(t, int64(0), count1)
|
||||
|
||||
t1 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s1.Id,
|
||||
@@ -3480,8 +3480,8 @@ func testTeamStoreAnalyticsGetTeamCountForScheme(t *testing.T, rctx request.CTX,
|
||||
assert.Equal(t, int64(1), count2)
|
||||
|
||||
t2 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s1.Id,
|
||||
@@ -3494,8 +3494,8 @@ func testTeamStoreAnalyticsGetTeamCountForScheme(t *testing.T, rctx request.CTX,
|
||||
assert.Equal(t, int64(2), count3)
|
||||
|
||||
t3 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
}
|
||||
@@ -3507,8 +3507,8 @@ func testTeamStoreAnalyticsGetTeamCountForScheme(t *testing.T, rctx request.CTX,
|
||||
assert.Equal(t, int64(2), count4)
|
||||
|
||||
t4 := &model.Team{
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestID(),
|
||||
DisplayName: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamOpen,
|
||||
SchemeId: &s1.Id,
|
||||
@@ -3525,7 +3525,7 @@ func testTeamStoreAnalyticsGetTeamCountForScheme(t *testing.T, rctx request.CTX,
|
||||
func testTeamStoreGetAllForExportAfter(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t1 := model.Team{}
|
||||
t1.DisplayName = "Name"
|
||||
t1.Name = NewTestId()
|
||||
t1.Name = NewTestID()
|
||||
t1.Email = MakeEmail()
|
||||
t1.Type = model.TeamOpen
|
||||
_, err := ss.Team().Save(&t1)
|
||||
@@ -3549,7 +3549,7 @@ func testTeamStoreGetAllForExportAfter(t *testing.T, rctx request.CTX, ss store.
|
||||
func testTeamStoreGetTeamMembersForExport(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t1 := model.Team{}
|
||||
t1.DisplayName = "Name"
|
||||
t1.Name = NewTestId()
|
||||
t1.Name = NewTestID()
|
||||
t1.Email = MakeEmail()
|
||||
t1.Type = model.TeamOpen
|
||||
_, err := ss.Team().Save(&t1)
|
||||
@@ -3557,13 +3557,13 @@ func testTeamStoreGetTeamMembersForExport(t *testing.T, rctx request.CTX, ss sto
|
||||
|
||||
u1 := model.User{}
|
||||
u1.Email = MakeEmail()
|
||||
u1.Nickname = NewTestId()
|
||||
u1.Nickname = NewTestID()
|
||||
_, err = ss.User().Save(rctx, &u1)
|
||||
require.NoError(t, err)
|
||||
|
||||
u2 := model.User{}
|
||||
u2.Email = MakeEmail()
|
||||
u2.Nickname = NewTestId()
|
||||
u2.Nickname = NewTestID()
|
||||
_, err = ss.User().Save(rctx, &u2)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -3585,8 +3585,8 @@ func testTeamStoreGetTeamMembersForExport(t *testing.T, rctx request.CTX, ss sto
|
||||
|
||||
func testGroupSyncedTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
team1, err := ss.Team().Save(&model.Team{
|
||||
DisplayName: NewTestId(),
|
||||
Name: NewTestId(),
|
||||
DisplayName: NewTestID(),
|
||||
Name: NewTestID(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamInvite,
|
||||
GroupConstrained: model.NewPointer(true),
|
||||
@@ -3596,7 +3596,7 @@ func testGroupSyncedTeamCount(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
defer ss.Team().PermanentDelete(team1.Id)
|
||||
|
||||
team2, err := ss.Team().Save(&model.Team{
|
||||
DisplayName: NewTestId(),
|
||||
DisplayName: NewTestID(),
|
||||
Name: "zz" + model.NewId(),
|
||||
Email: MakeEmail(),
|
||||
Type: model.TeamInvite,
|
||||
@@ -3625,7 +3625,7 @@ func testGetCommonTeamIDsForMultipleUsers(t *testing.T, rctx request.CTX, ss sto
|
||||
// Team 1
|
||||
t1 := model.Team{}
|
||||
t1.DisplayName = "Team 1"
|
||||
t1.Name = NewTestId()
|
||||
t1.Name = NewTestID()
|
||||
t1.Email = MakeEmail()
|
||||
t1.Type = model.TeamOpen
|
||||
_, err := ss.Team().Save(&t1)
|
||||
@@ -3634,7 +3634,7 @@ func testGetCommonTeamIDsForMultipleUsers(t *testing.T, rctx request.CTX, ss sto
|
||||
// Team 2
|
||||
t2 := model.Team{}
|
||||
t2.DisplayName = "Team 2"
|
||||
t2.Name = NewTestId()
|
||||
t2.Name = NewTestID()
|
||||
t2.Email = MakeEmail()
|
||||
t2.Type = model.TeamOpen
|
||||
_, err = ss.Team().Save(&t2)
|
||||
@@ -3643,7 +3643,7 @@ func testGetCommonTeamIDsForMultipleUsers(t *testing.T, rctx request.CTX, ss sto
|
||||
// Team 3
|
||||
t3 := model.Team{}
|
||||
t3.DisplayName = "Team 3"
|
||||
t3.Name = NewTestId()
|
||||
t3.Name = NewTestID()
|
||||
t3.Email = MakeEmail()
|
||||
t3.Type = model.TeamOpen
|
||||
_, err = ss.Team().Save(&t3)
|
||||
@@ -3654,14 +3654,14 @@ func testGetCommonTeamIDsForMultipleUsers(t *testing.T, rctx request.CTX, ss sto
|
||||
// User 1
|
||||
u1 := model.User{}
|
||||
u1.Email = MakeEmail()
|
||||
u1.Nickname = NewTestId()
|
||||
u1.Nickname = NewTestID()
|
||||
_, err = ss.User().Save(rctx, &u1)
|
||||
require.NoError(t, err)
|
||||
|
||||
// User 2
|
||||
u2 := model.User{}
|
||||
u2.Email = MakeEmail()
|
||||
u2.Nickname = NewTestId()
|
||||
u2.Nickname = NewTestID()
|
||||
_, err = ss.User().Save(rctx, &u2)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -3771,14 +3771,14 @@ func testGetCommonTeamIDsForMultipleUsers(t *testing.T, rctx request.CTX, ss sto
|
||||
// User 3
|
||||
u3 := model.User{}
|
||||
u3.Email = MakeEmail()
|
||||
u3.Nickname = NewTestId()
|
||||
u3.Nickname = NewTestID()
|
||||
_, err = ss.User().Save(rctx, &u3)
|
||||
require.NoError(t, err)
|
||||
|
||||
// User 4
|
||||
u4 := model.User{}
|
||||
u4.Email = MakeEmail()
|
||||
u4.Nickname = NewTestId()
|
||||
u4.Nickname = NewTestID()
|
||||
_, err = ss.User().Save(rctx, &u4)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o := model.Post{}
|
||||
o.ChannelId = c.Id
|
||||
o.UserId = u.Id
|
||||
o.Message = NewTestId()
|
||||
o.Message = NewTestID()
|
||||
|
||||
if urgent {
|
||||
o.Metadata = &model.PostMetadata{
|
||||
@@ -79,18 +79,18 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o2.ChannelId = c.Id
|
||||
o2.UserId = model.NewId()
|
||||
o2.RootId = otmp.Id
|
||||
o2.Message = NewTestId()
|
||||
o2.Message = NewTestID()
|
||||
|
||||
o3 := model.Post{}
|
||||
o3.ChannelId = c.Id
|
||||
o3.UserId = u.Id
|
||||
o3.RootId = otmp.Id
|
||||
o3.Message = NewTestId()
|
||||
o3.Message = NewTestID()
|
||||
|
||||
o4 := model.Post{}
|
||||
o4.ChannelId = c.Id
|
||||
o4.UserId = model.NewId()
|
||||
o4.Message = NewTestId()
|
||||
o4.Message = NewTestID()
|
||||
|
||||
newPosts, errIdx, err3 := ss.Post().SaveMultiple([]*model.Post{&o2, &o3, &o4})
|
||||
|
||||
@@ -132,7 +132,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o5.ChannelId = channel.Id
|
||||
o5.UserId = model.NewId()
|
||||
o5.RootId = newPosts[0].Id
|
||||
o5.Message = NewTestId()
|
||||
o5.Message = NewTestID()
|
||||
|
||||
_, _, err = ss.Post().SaveMultiple([]*model.Post{&o5})
|
||||
require.NoError(t, err, "couldn't save item")
|
||||
@@ -176,12 +176,12 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
rootPost.RootId = model.NewId()
|
||||
rootPost.ChannelId = channel.Id
|
||||
rootPost.UserId = model.NewId()
|
||||
rootPost.Message = NewTestId()
|
||||
rootPost.Message = NewTestID()
|
||||
|
||||
replyPost := model.Post{}
|
||||
replyPost.ChannelId = rootPost.ChannelId
|
||||
replyPost.UserId = model.NewId()
|
||||
replyPost.Message = NewTestId()
|
||||
replyPost.Message = NewTestID()
|
||||
replyPost.RootId = rootPost.RootId
|
||||
|
||||
newPosts, _, err := ss.Post().SaveMultiple([]*model.Post{&rootPost, &replyPost})
|
||||
@@ -197,13 +197,13 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
replyPost2 := model.Post{}
|
||||
replyPost2.ChannelId = rootPost.ChannelId
|
||||
replyPost2.UserId = model.NewId()
|
||||
replyPost2.Message = NewTestId()
|
||||
replyPost2.Message = NewTestID()
|
||||
replyPost2.RootId = rootPost.Id
|
||||
|
||||
replyPost3 := model.Post{}
|
||||
replyPost3.ChannelId = rootPost.ChannelId
|
||||
replyPost3.UserId = model.NewId()
|
||||
replyPost3.Message = NewTestId()
|
||||
replyPost3.Message = NewTestID()
|
||||
replyPost3.RootId = rootPost.Id
|
||||
|
||||
_, _, err = ss.Post().SaveMultiple([]*model.Post{&replyPost2, &replyPost3})
|
||||
@@ -231,7 +231,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o1 := model.Post{}
|
||||
o1.ChannelId = channel.Id
|
||||
o1.UserId = model.NewId()
|
||||
o1.Message = NewTestId()
|
||||
o1.Message = NewTestID()
|
||||
rootPost, err := ss.Post().Save(rctx, &o1)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -239,7 +239,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o2.RootId = rootPost.Id
|
||||
o2.ChannelId = rootPost.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = NewTestId()
|
||||
o2.Message = NewTestID()
|
||||
replyPost, err := ss.Post().Save(rctx, &o2)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -247,7 +247,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o3.RootId = rootPost.Id
|
||||
o3.ChannelId = rootPost.ChannelId
|
||||
o3.UserId = o2.UserId
|
||||
o3.Message = NewTestId()
|
||||
o3.Message = NewTestID()
|
||||
replyPost2, err := ss.Post().Save(rctx, &o3)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -255,7 +255,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
o4.RootId = rootPost.Id
|
||||
o4.ChannelId = rootPost.ChannelId
|
||||
o4.UserId = model.NewId()
|
||||
o4.Message = NewTestId()
|
||||
o4.Message = NewTestID()
|
||||
replyPost3, err := ss.Post().Save(rctx, &o4)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -292,7 +292,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
rootPost := model.Post{}
|
||||
rootPost.ChannelId = channel.Id
|
||||
rootPost.UserId = model.NewId()
|
||||
rootPost.Message = NewTestId()
|
||||
rootPost.Message = NewTestID()
|
||||
|
||||
newPosts1, _, err := ss.Post().SaveMultiple([]*model.Post{&rootPost})
|
||||
require.NoError(t, err)
|
||||
@@ -300,7 +300,7 @@ func testThreadStorePopulation(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
replyPost := model.Post{}
|
||||
replyPost.ChannelId = rootPost.ChannelId
|
||||
replyPost.UserId = model.NewId()
|
||||
replyPost.Message = NewTestId()
|
||||
replyPost.Message = NewTestID()
|
||||
replyPost.RootId = newPosts1[0].Id
|
||||
|
||||
_, _, err = ss.Post().SaveMultiple([]*model.Post{&replyPost})
|
||||
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -8,14 +8,14 @@ import (
|
||||
)
|
||||
|
||||
// This function has a copy of it in app/helper_test
|
||||
// NewTestId is used for testing as a replacement for model.NewId(). It is a [A-Z0-9] string 26
|
||||
// NewTestID is used for testing as a replacement for model.NewId(). It is a [A-Z0-9] string 26
|
||||
// characters long. It replaces every odd character with a digit.
|
||||
func NewTestId() string {
|
||||
newId := []byte(model.NewId())
|
||||
func NewTestID() string {
|
||||
newID := []byte(model.NewId())
|
||||
|
||||
for i := 1; i < len(newId); i = i + 2 {
|
||||
newId[i] = 48 + newId[i-1]%10
|
||||
for i := 1; i < len(newID); i = i + 2 {
|
||||
newID[i] = 48 + newID[i-1]%10
|
||||
}
|
||||
|
||||
return string(newId)
|
||||
return string(newID)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ func TestNewTestId(t *testing.T) {
|
||||
rg := regexp.MustCompile(`(\S\d){13}`)
|
||||
|
||||
for i := 0; i < 1000; i++ {
|
||||
id := NewTestId()
|
||||
id := NewTestID()
|
||||
require.LessOrEqual(t, len(id), 26, "test ids shouldn't be longer than 26 chars")
|
||||
require.Regexp(t, rg, id, "test ids should have pattern e.g a1b2c3...")
|
||||
}
|
||||
|
||||
@@ -471,10 +471,10 @@ type TimerLayerWebhookStore struct {
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
func (s *TimerLayerAuditStore) Get(user_id string, offset int, limit int) (model.Audits, error) {
|
||||
func (s *TimerLayerAuditStore) Get(userID string, offset int, limit int) (model.Audits, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.AuditStore.Get(user_id, offset, limit)
|
||||
result, err := s.AuditStore.Get(userID, offset, limit)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -1029,10 +1029,10 @@ func (s *TimerLayerChannelStore) GetAllDirectChannelsForExportAfter(limit int, a
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetByName(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
func (s *TimerLayerChannelStore) GetByName(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelStore.GetByName(team_id, name, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByName(teamID, name, allowFromCache)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -1045,10 +1045,10 @@ func (s *TimerLayerChannelStore) GetByName(team_id string, name string, allowFro
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
func (s *TimerLayerChannelStore) GetByNameIncludeDeleted(teamID string, name string, allowFromCache bool) (*model.Channel, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelStore.GetByNameIncludeDeleted(team_id, name, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNameIncludeDeleted(teamID, name, allowFromCache)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -1061,10 +1061,10 @@ func (s *TimerLayerChannelStore) GetByNameIncludeDeleted(team_id string, name st
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetByNames(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
func (s *TimerLayerChannelStore) GetByNames(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelStore.GetByNames(team_id, names, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNames(teamID, names, allowFromCache)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -1077,10 +1077,10 @@ func (s *TimerLayerChannelStore) GetByNames(team_id string, names []string, allo
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetByNamesIncludeDeleted(team_id string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
func (s *TimerLayerChannelStore) GetByNamesIncludeDeleted(teamID string, names []string, allowFromCache bool) ([]*model.Channel, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelStore.GetByNamesIncludeDeleted(team_id, names, allowFromCache)
|
||||
result, err := s.ChannelStore.GetByNamesIncludeDeleted(teamID, names, allowFromCache)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -1285,10 +1285,10 @@ func (s *TimerLayerChannelStore) GetChannelsWithUnreadsAndWithMentions(ctx conte
|
||||
return result, resultVar1, resultVar2, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetDeleted(team_id string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
func (s *TimerLayerChannelStore) GetDeleted(teamID string, offset int, limit int, userID string) (model.ChannelList, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelStore.GetDeleted(team_id, offset, limit, userID)
|
||||
result, err := s.ChannelStore.GetDeleted(teamID, offset, limit, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -1301,10 +1301,10 @@ func (s *TimerLayerChannelStore) GetDeleted(team_id string, offset int, limit in
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetDeletedByName(team_id string, name string) (*model.Channel, error) {
|
||||
func (s *TimerLayerChannelStore) GetDeletedByName(teamID string, name string) (*model.Channel, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelStore.GetDeletedByName(team_id, name)
|
||||
result, err := s.ChannelStore.GetDeletedByName(teamID, name)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -2302,10 +2302,10 @@ func (s *TimerLayerChannelStore) SetDeleteAt(channelID string, deleteAt int64, u
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) SetShared(channelId string, shared bool) error {
|
||||
func (s *TimerLayerChannelStore) SetShared(channelID string, shared bool) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.ChannelStore.SetShared(channelId, shared)
|
||||
err := s.ChannelStore.SetShared(channelID, shared)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -2510,10 +2510,10 @@ func (s *TimerLayerChannelStore) UserBelongsToChannels(userID string, channelIds
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelBookmarkStore) Delete(bookmarkId string, deleteFile bool) error {
|
||||
func (s *TimerLayerChannelBookmarkStore) Delete(bookmarkID string, deleteFile bool) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.ChannelBookmarkStore.Delete(bookmarkId, deleteFile)
|
||||
err := s.ChannelBookmarkStore.Delete(bookmarkID, deleteFile)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -2526,10 +2526,10 @@ func (s *TimerLayerChannelBookmarkStore) Delete(bookmarkId string, deleteFile bo
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileId string) error {
|
||||
func (s *TimerLayerChannelBookmarkStore) ErrorIfBookmarkFileInfoAlreadyAttached(fileID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.ChannelBookmarkStore.ErrorIfBookmarkFileInfoAlreadyAttached(fileId)
|
||||
err := s.ChannelBookmarkStore.ErrorIfBookmarkFileInfoAlreadyAttached(fileID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -2558,10 +2558,10 @@ func (s *TimerLayerChannelBookmarkStore) Get(Id string, includeDeleted bool) (*m
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelBookmarkStore) GetBookmarksForChannelSince(channelId string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
func (s *TimerLayerChannelBookmarkStore) GetBookmarksForChannelSince(channelID string, since int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelBookmarkStore.GetBookmarksForChannelSince(channelId, since)
|
||||
result, err := s.ChannelBookmarkStore.GetBookmarksForChannelSince(channelID, since)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -2606,10 +2606,10 @@ func (s *TimerLayerChannelBookmarkStore) Update(bookmark *model.ChannelBookmark)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelBookmarkStore) UpdateSortOrder(bookmarkId string, channelId string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
func (s *TimerLayerChannelBookmarkStore) UpdateSortOrder(bookmarkID string, channelID string, newIndex int64) ([]*model.ChannelBookmarkWithFileInfo, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ChannelBookmarkStore.UpdateSortOrder(bookmarkId, channelId, newIndex)
|
||||
result, err := s.ChannelBookmarkStore.UpdateSortOrder(bookmarkID, channelID, newIndex)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -3149,10 +3149,10 @@ func (s *TimerLayerDesktopTokensStore) Delete(token string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerDesktopTokensStore) DeleteByUserId(userId string) error {
|
||||
func (s *TimerLayerDesktopTokensStore) DeleteByUserId(userID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.DesktopTokensStore.DeleteByUserId(userId)
|
||||
err := s.DesktopTokensStore.DeleteByUserId(userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -3197,10 +3197,10 @@ func (s *TimerLayerDesktopTokensStore) GetUserId(token string, minCreatedAt int6
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerDesktopTokensStore) Insert(token string, createAt int64, userId string) error {
|
||||
func (s *TimerLayerDesktopTokensStore) Insert(token string, createAt int64, userID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.DesktopTokensStore.Insert(token, createAt, userId)
|
||||
err := s.DesktopTokensStore.Insert(token, createAt, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -3245,10 +3245,10 @@ func (s *TimerLayerDraftStore) DeleteDraftsAssociatedWithPost(channelID string,
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
func (s *TimerLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.DraftStore.DeleteEmptyDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err := s.DraftStore.DeleteEmptyDraftsByCreateAtAndUserId(createAt, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -3261,10 +3261,10 @@ func (s *TimerLayerDraftStore) DeleteEmptyDraftsByCreateAtAndUserId(createAt int
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerDraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userId string) error {
|
||||
func (s *TimerLayerDraftStore) DeleteOrphanDraftsByCreateAtAndUserId(createAt int64, userID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.DraftStore.DeleteOrphanDraftsByCreateAtAndUserId(createAt, userId)
|
||||
err := s.DraftStore.DeleteOrphanDraftsByCreateAtAndUserId(createAt, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -3309,10 +3309,10 @@ func (s *TimerLayerDraftStore) GetDraftsForUser(userID string, teamID string) ([
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerDraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userId string) (int64, string, error) {
|
||||
func (s *TimerLayerDraftStore) GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt int64, userID string) (int64, string, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, resultVar1, err := s.DraftStore.GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userId)
|
||||
result, resultVar1, err := s.DraftStore.GetLastCreateAtAndUserIdValuesForEmptyDraftsMigration(createAt, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -5067,10 +5067,10 @@ func (s *TimerLayerNotifyAdminStore) Get(trial bool) ([]*model.NotifyAdminData,
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerNotifyAdminStore) GetDataByUserIdAndFeature(userId string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
func (s *TimerLayerNotifyAdminStore) GetDataByUserIdAndFeature(userID string, feature model.MattermostFeature) ([]*model.NotifyAdminData, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.NotifyAdminStore.GetDataByUserIdAndFeature(userId, feature)
|
||||
result, err := s.NotifyAdminStore.GetDataByUserIdAndFeature(userID, feature)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -5099,10 +5099,10 @@ func (s *TimerLayerNotifyAdminStore) Save(data *model.NotifyAdminData) (*model.N
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerNotifyAdminStore) Update(userId string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
func (s *TimerLayerNotifyAdminStore) Update(userID string, requiredPlan string, requiredFeature model.MattermostFeature, now int64) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.NotifyAdminStore.Update(userId, requiredPlan, requiredFeature, now)
|
||||
err := s.NotifyAdminStore.Update(userID, requiredPlan, requiredFeature, now)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -5163,10 +5163,10 @@ func (s *TimerLayerOAuthStore) GetAccessDataByRefreshToken(token string) (*model
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerOAuthStore) GetAccessDataByUserForApp(userID string, clientId string) ([]*model.AccessData, error) {
|
||||
func (s *TimerLayerOAuthStore) GetAccessDataByUserForApp(userID string, clientID string) ([]*model.AccessData, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.OAuthStore.GetAccessDataByUserForApp(userID, clientId)
|
||||
result, err := s.OAuthStore.GetAccessDataByUserForApp(userID, clientID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -5259,10 +5259,10 @@ func (s *TimerLayerOAuthStore) GetAuthorizedApps(userID string, offset int, limi
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerOAuthStore) GetPreviousAccessData(userID string, clientId string) (*model.AccessData, error) {
|
||||
func (s *TimerLayerOAuthStore) GetPreviousAccessData(userID string, clientID string) (*model.AccessData, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.OAuthStore.GetPreviousAccessData(userID, clientId)
|
||||
result, err := s.OAuthStore.GetPreviousAccessData(userID, clientID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -5339,10 +5339,10 @@ func (s *TimerLayerOAuthStore) RemoveAuthData(code string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerOAuthStore) RemoveAuthDataByClientId(clientId string, userId string) error {
|
||||
func (s *TimerLayerOAuthStore) RemoveAuthDataByClientId(clientID string, userID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.OAuthStore.RemoveAuthDataByClientId(clientId, userId)
|
||||
err := s.OAuthStore.RemoveAuthDataByClientId(clientID, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -5355,10 +5355,10 @@ func (s *TimerLayerOAuthStore) RemoveAuthDataByClientId(clientId string, userId
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerOAuthStore) RemoveAuthDataByUserId(userId string) error {
|
||||
func (s *TimerLayerOAuthStore) RemoveAuthDataByUserId(userID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.OAuthStore.RemoveAuthDataByUserId(userId)
|
||||
err := s.OAuthStore.RemoveAuthDataByUserId(userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -5786,10 +5786,10 @@ func (s *TimerLayerPostStore) GetDirectPostParentsForExportAfter(limit int, afte
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerPostStore) GetEditHistoryForPost(postId string) ([]*model.Post, error) {
|
||||
func (s *TimerLayerPostStore) GetEditHistoryForPost(postID string) ([]*model.Post, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.PostStore.GetEditHistoryForPost(postId)
|
||||
result, err := s.PostStore.GetEditHistoryForPost(postID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -6202,10 +6202,10 @@ func (s *TimerLayerPostStore) GetSingle(rctx request.CTX, id string, inclDeleted
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerPostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userId string) (bool, error) {
|
||||
func (s *TimerLayerPostStore) HasAutoResponsePostByUserSince(options model.GetPostsSinceOptions, userID string) (bool, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.PostStore.HasAutoResponsePostByUserSince(options, userId)
|
||||
result, err := s.PostStore.HasAutoResponsePostByUserSince(options, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -6633,10 +6633,10 @@ func (s *TimerLayerPostPersistentNotificationStore) UpdateLastActivity(postIds [
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerPostPriorityStore) GetForPost(postId string) (*model.PostPriority, error) {
|
||||
func (s *TimerLayerPostPriorityStore) GetForPost(postID string) (*model.PostPriority, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.PostPriorityStore.GetForPost(postId)
|
||||
result, err := s.PostPriorityStore.GetForPost(postID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -6985,10 +6985,10 @@ func (s *TimerLayerReactionStore) DeleteOrphanedRowsByIds(r *model.RetentionIdsF
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerReactionStore) ExistsOnPost(postId string, emojiName string) (bool, error) {
|
||||
func (s *TimerLayerReactionStore) ExistsOnPost(postID string, emojiName string) (bool, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ReactionStore.ExistsOnPost(postId, emojiName)
|
||||
result, err := s.ReactionStore.ExistsOnPost(postID, emojiName)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7017,10 +7017,10 @@ func (s *TimerLayerReactionStore) GetForPost(postID string, allowFromCache bool)
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerReactionStore) GetForPostSince(postId string, since int64, excludeRemoteId string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
func (s *TimerLayerReactionStore) GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.Reaction, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ReactionStore.GetForPostSince(postId, since, excludeRemoteId, inclDeleted)
|
||||
result, err := s.ReactionStore.GetForPostSince(postID, since, excludeRemoteID, inclDeleted)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7049,10 +7049,10 @@ func (s *TimerLayerReactionStore) GetSingle(userID string, postID string, remote
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerReactionStore) GetUniqueCountForPost(postId string) (int, error) {
|
||||
func (s *TimerLayerReactionStore) GetUniqueCountForPost(postID string) (int, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ReactionStore.GetUniqueCountForPost(postId)
|
||||
result, err := s.ReactionStore.GetUniqueCountForPost(postID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7113,10 +7113,10 @@ func (s *TimerLayerReactionStore) Save(reaction *model.Reaction) (*model.Reactio
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRemoteClusterStore) Delete(remoteClusterId string) (bool, error) {
|
||||
func (s *TimerLayerRemoteClusterStore) Delete(remoteClusterID string) (bool, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.RemoteClusterStore.Delete(remoteClusterId)
|
||||
result, err := s.RemoteClusterStore.Delete(remoteClusterID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7129,10 +7129,10 @@ func (s *TimerLayerRemoteClusterStore) Delete(remoteClusterId string) (bool, err
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRemoteClusterStore) Get(remoteClusterId string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
func (s *TimerLayerRemoteClusterStore) Get(remoteClusterID string, includeDeleted bool) (*model.RemoteCluster, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.RemoteClusterStore.Get(remoteClusterId, includeDeleted)
|
||||
result, err := s.RemoteClusterStore.Get(remoteClusterID, includeDeleted)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7193,10 +7193,10 @@ func (s *TimerLayerRemoteClusterStore) Save(rc *model.RemoteCluster) (*model.Rem
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRemoteClusterStore) SetLastPingAt(remoteClusterId string) error {
|
||||
func (s *TimerLayerRemoteClusterStore) SetLastPingAt(remoteClusterID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.RemoteClusterStore.SetLastPingAt(remoteClusterId)
|
||||
err := s.RemoteClusterStore.SetLastPingAt(remoteClusterID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7225,10 +7225,10 @@ func (s *TimerLayerRemoteClusterStore) Update(rc *model.RemoteCluster) (*model.R
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRemoteClusterStore) UpdateTopics(remoteClusterId string, topics string) (*model.RemoteCluster, error) {
|
||||
func (s *TimerLayerRemoteClusterStore) UpdateTopics(remoteClusterID string, topics string) (*model.RemoteCluster, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.RemoteClusterStore.UpdateTopics(remoteClusterId, topics)
|
||||
result, err := s.RemoteClusterStore.UpdateTopics(remoteClusterID, topics)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7241,10 +7241,10 @@ func (s *TimerLayerRemoteClusterStore) UpdateTopics(remoteClusterId string, topi
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) AddChannels(policyId string, channelIds []string) error {
|
||||
func (s *TimerLayerRetentionPolicyStore) AddChannels(policyID string, channelIds []string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.RetentionPolicyStore.AddChannels(policyId, channelIds)
|
||||
err := s.RetentionPolicyStore.AddChannels(policyID, channelIds)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7257,10 +7257,10 @@ func (s *TimerLayerRetentionPolicyStore) AddChannels(policyId string, channelIds
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) AddTeams(policyId string, teamIds []string) error {
|
||||
func (s *TimerLayerRetentionPolicyStore) AddTeams(policyID string, teamIds []string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.RetentionPolicyStore.AddTeams(policyId, teamIds)
|
||||
err := s.RetentionPolicyStore.AddTeams(policyID, teamIds)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7369,10 +7369,10 @@ func (s *TimerLayerRetentionPolicyStore) GetChannelPoliciesForUser(userID string
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) GetChannels(policyId string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
func (s *TimerLayerRetentionPolicyStore) GetChannels(policyID string, offset int, limit int) (model.ChannelListWithTeamData, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.RetentionPolicyStore.GetChannels(policyId, offset, limit)
|
||||
result, err := s.RetentionPolicyStore.GetChannels(policyID, offset, limit)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7385,10 +7385,10 @@ func (s *TimerLayerRetentionPolicyStore) GetChannels(policyId string, offset int
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) GetChannelsCount(policyId string) (int64, error) {
|
||||
func (s *TimerLayerRetentionPolicyStore) GetChannelsCount(policyID string) (int64, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.RetentionPolicyStore.GetChannelsCount(policyId)
|
||||
result, err := s.RetentionPolicyStore.GetChannelsCount(policyID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7465,10 +7465,10 @@ func (s *TimerLayerRetentionPolicyStore) GetTeamPoliciesForUser(userID string, o
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) GetTeams(policyId string, offset int, limit int) ([]*model.Team, error) {
|
||||
func (s *TimerLayerRetentionPolicyStore) GetTeams(policyID string, offset int, limit int) ([]*model.Team, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.RetentionPolicyStore.GetTeams(policyId, offset, limit)
|
||||
result, err := s.RetentionPolicyStore.GetTeams(policyID, offset, limit)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7481,10 +7481,10 @@ func (s *TimerLayerRetentionPolicyStore) GetTeams(policyId string, offset int, l
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) GetTeamsCount(policyId string) (int64, error) {
|
||||
func (s *TimerLayerRetentionPolicyStore) GetTeamsCount(policyID string) (int64, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.RetentionPolicyStore.GetTeamsCount(policyId)
|
||||
result, err := s.RetentionPolicyStore.GetTeamsCount(policyID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7513,10 +7513,10 @@ func (s *TimerLayerRetentionPolicyStore) Patch(patch *model.RetentionPolicyWithT
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) RemoveChannels(policyId string, channelIds []string) error {
|
||||
func (s *TimerLayerRetentionPolicyStore) RemoveChannels(policyID string, channelIds []string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.RetentionPolicyStore.RemoveChannels(policyId, channelIds)
|
||||
err := s.RetentionPolicyStore.RemoveChannels(policyID, channelIds)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -7529,10 +7529,10 @@ func (s *TimerLayerRetentionPolicyStore) RemoveChannels(policyId string, channel
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerRetentionPolicyStore) RemoveTeams(policyId string, teamIds []string) error {
|
||||
func (s *TimerLayerRetentionPolicyStore) RemoveTeams(policyID string, teamIds []string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.RetentionPolicyStore.RemoveTeams(policyId, teamIds)
|
||||
err := s.RetentionPolicyStore.RemoveTeams(policyID, teamIds)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8137,10 +8137,10 @@ func (s *TimerLayerSessionStore) UpdateRoles(userID string, roles string) (strin
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
func (s *TimerLayerSharedChannelStore) Delete(channelID string) (bool, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.Delete(channelId)
|
||||
result, err := s.SharedChannelStore.Delete(channelID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8153,10 +8153,10 @@ func (s *TimerLayerSharedChannelStore) Delete(channelId string) (bool, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) DeleteRemote(remoteId string) (bool, error) {
|
||||
func (s *TimerLayerSharedChannelStore) DeleteRemote(remoteID string) (bool, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.DeleteRemote(remoteId)
|
||||
result, err := s.SharedChannelStore.DeleteRemote(remoteID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8169,10 +8169,10 @@ func (s *TimerLayerSharedChannelStore) DeleteRemote(remoteId string) (bool, erro
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) Get(channelId string) (*model.SharedChannel, error) {
|
||||
func (s *TimerLayerSharedChannelStore) Get(channelID string) (*model.SharedChannel, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.Get(channelId)
|
||||
result, err := s.SharedChannelStore.Get(channelID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8217,10 +8217,10 @@ func (s *TimerLayerSharedChannelStore) GetAllCount(opts model.SharedChannelFilte
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) GetAttachment(fileId string, remoteId string) (*model.SharedChannelAttachment, error) {
|
||||
func (s *TimerLayerSharedChannelStore) GetAttachment(fileID string, remoteID string) (*model.SharedChannelAttachment, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.GetAttachment(fileId, remoteId)
|
||||
result, err := s.SharedChannelStore.GetAttachment(fileID, remoteID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8249,10 +8249,10 @@ func (s *TimerLayerSharedChannelStore) GetRemote(id string) (*model.SharedChanne
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) GetRemoteByIds(channelId string, remoteId string) (*model.SharedChannelRemote, error) {
|
||||
func (s *TimerLayerSharedChannelStore) GetRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.GetRemoteByIds(channelId, remoteId)
|
||||
result, err := s.SharedChannelStore.GetRemoteByIds(channelID, remoteID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8265,10 +8265,10 @@ func (s *TimerLayerSharedChannelStore) GetRemoteByIds(channelId string, remoteId
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) GetRemoteForUser(remoteId string, userId string) (*model.RemoteCluster, error) {
|
||||
func (s *TimerLayerSharedChannelStore) GetRemoteForUser(remoteID string, userID string) (*model.RemoteCluster, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.GetRemoteForUser(remoteId, userId)
|
||||
result, err := s.SharedChannelStore.GetRemoteForUser(remoteID, userID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8297,10 +8297,10 @@ func (s *TimerLayerSharedChannelStore) GetRemotes(offset int, limit int, opts mo
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) GetRemotesStatus(channelId string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
func (s *TimerLayerSharedChannelStore) GetRemotesStatus(channelID string) ([]*model.SharedChannelRemoteStatus, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.GetRemotesStatus(channelId)
|
||||
result, err := s.SharedChannelStore.GetRemotesStatus(channelID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -8377,10 +8377,10 @@ func (s *TimerLayerSharedChannelStore) HasChannel(channelID string) (bool, error
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSharedChannelStore) HasRemote(channelID string, remoteId string) (bool, error) {
|
||||
func (s *TimerLayerSharedChannelStore) HasRemote(channelID string, remoteID string) (bool, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SharedChannelStore.HasRemote(channelID, remoteId)
|
||||
result, err := s.SharedChannelStore.HasRemote(channelID, remoteID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9655,10 +9655,10 @@ func (s *TimerLayerTermsOfServiceStore) Save(termsOfService *model.TermsOfServic
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) DeleteMembershipForUser(userId string, postID string) error {
|
||||
func (s *TimerLayerThreadStore) DeleteMembershipForUser(userID string, postID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.ThreadStore.DeleteMembershipForUser(userId, postID)
|
||||
err := s.ThreadStore.DeleteMembershipForUser(userID, postID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9719,10 +9719,10 @@ func (s *TimerLayerThreadStore) Get(id string) (*model.Thread, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetMembershipForUser(userId string, postID string) (*model.ThreadMembership, error) {
|
||||
func (s *TimerLayerThreadStore) GetMembershipForUser(userID string, postID string) (*model.ThreadMembership, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetMembershipForUser(userId, postID)
|
||||
result, err := s.ThreadStore.GetMembershipForUser(userID, postID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9735,10 +9735,10 @@ func (s *TimerLayerThreadStore) GetMembershipForUser(userId string, postID strin
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetMembershipsForUser(userId string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
func (s *TimerLayerThreadStore) GetMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetMembershipsForUser(userId, teamID)
|
||||
result, err := s.ThreadStore.GetMembershipsForUser(userID, teamID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9831,10 +9831,10 @@ func (s *TimerLayerThreadStore) GetThreadUnreadReplyCount(threadMembership *mode
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetThreadsForUser(userId string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
func (s *TimerLayerThreadStore) GetThreadsForUser(userID string, teamID string, opts model.GetUserThreadsOpts) ([]*model.ThreadResponse, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetThreadsForUser(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetThreadsForUser(userID, teamID, opts)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9847,10 +9847,10 @@ func (s *TimerLayerThreadStore) GetThreadsForUser(userId string, teamID string,
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetTotalThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *TimerLayerThreadStore) GetTotalThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetTotalThreads(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalThreads(userID, teamID, opts)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9863,10 +9863,10 @@ func (s *TimerLayerThreadStore) GetTotalThreads(userId string, teamID string, op
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetTotalUnreadMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *TimerLayerThreadStore) GetTotalUnreadMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetTotalUnreadMentions(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadMentions(userID, teamID, opts)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9879,10 +9879,10 @@ func (s *TimerLayerThreadStore) GetTotalUnreadMentions(userId string, teamID str
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetTotalUnreadThreads(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *TimerLayerThreadStore) GetTotalUnreadThreads(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetTotalUnreadThreads(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadThreads(userID, teamID, opts)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -9895,10 +9895,10 @@ func (s *TimerLayerThreadStore) GetTotalUnreadThreads(userId string, teamID stri
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerThreadStore) GetTotalUnreadUrgentMentions(userId string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
func (s *TimerLayerThreadStore) GetTotalUnreadUrgentMentions(userID string, teamID string, opts model.GetUserThreadsOpts) (int64, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.ThreadStore.GetTotalUnreadUrgentMentions(userId, teamID, opts)
|
||||
result, err := s.ThreadStore.GetTotalUnreadUrgentMentions(userID, teamID, opts)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -10517,10 +10517,10 @@ func (s *TimerLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerUserStore) GetAllProfilesInChannel(rctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
func (s *TimerLayerUserStore) GetAllProfilesInChannel(ctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.UserStore.GetAllProfilesInChannel(rctx, channelID, allowFromCache)
|
||||
result, err := s.UserStore.GetAllProfilesInChannel(ctx, channelID, allowFromCache)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -10885,10 +10885,10 @@ func (s *TimerLayerUserStore) GetProfilesInChannelByStatus(options *model.UserGe
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerUserStore) GetProfilesNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
func (s *TimerLayerUserStore) GetProfilesNotInChannel(teamID string, channelID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.UserStore.GetProfilesNotInChannel(teamID, channelId, groupConstrained, offset, limit, viewRestrictions)
|
||||
result, err := s.UserStore.GetProfilesNotInChannel(teamID, channelID, groupConstrained, offset, limit, viewRestrictions)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
@@ -11730,10 +11730,10 @@ func (s *TimerLayerUserAccessTokenStore) UpdateTokenEnable(tokenID string) error
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *TimerLayerUserTermsOfServiceStore) Delete(userID string, termsOfServiceId string) error {
|
||||
func (s *TimerLayerUserTermsOfServiceStore) Delete(userID string, termsOfServiceID string) error {
|
||||
start := time.Now()
|
||||
|
||||
err := s.UserTermsOfServiceStore.Delete(userID, termsOfServiceId)
|
||||
err := s.UserTermsOfServiceStore.Delete(userID, termsOfServiceID)
|
||||
|
||||
elapsed := float64(time.Since(start)) / float64(time.Second)
|
||||
if s.Root.Metrics != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user