Files
mattermost/store/timer_layer.go

8164 lines
249 KiB
Go
Raw Normal View History

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// Code generated by "make store-layers"
// DO NOT EDIT
package store
import (
"context"
timemodule "time"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/model"
)
type TimerLayer struct {
Store
Metrics einterfaces.MetricsInterface
AuditStore AuditStore
BotStore BotStore
ChannelStore ChannelStore
ChannelMemberHistoryStore ChannelMemberHistoryStore
ClusterDiscoveryStore ClusterDiscoveryStore
CommandStore CommandStore
CommandWebhookStore CommandWebhookStore
ComplianceStore ComplianceStore
EmojiStore EmojiStore
FileInfoStore FileInfoStore
GroupStore GroupStore
JobStore JobStore
LicenseStore LicenseStore
LinkMetadataStore LinkMetadataStore
OAuthStore OAuthStore
PluginStore PluginStore
PostStore PostStore
PreferenceStore PreferenceStore
ReactionStore ReactionStore
RoleStore RoleStore
SchemeStore SchemeStore
SessionStore SessionStore
StatusStore StatusStore
SystemStore SystemStore
TeamStore TeamStore
TermsOfServiceStore TermsOfServiceStore
TokenStore TokenStore
UserStore UserStore
UserAccessTokenStore UserAccessTokenStore
UserTermsOfServiceStore UserTermsOfServiceStore
WebhookStore WebhookStore
}
func (s *TimerLayer) Audit() AuditStore {
return s.AuditStore
}
func (s *TimerLayer) Bot() BotStore {
return s.BotStore
}
func (s *TimerLayer) Channel() ChannelStore {
return s.ChannelStore
}
func (s *TimerLayer) ChannelMemberHistory() ChannelMemberHistoryStore {
return s.ChannelMemberHistoryStore
}
func (s *TimerLayer) ClusterDiscovery() ClusterDiscoveryStore {
return s.ClusterDiscoveryStore
}
func (s *TimerLayer) Command() CommandStore {
return s.CommandStore
}
func (s *TimerLayer) CommandWebhook() CommandWebhookStore {
return s.CommandWebhookStore
}
func (s *TimerLayer) Compliance() ComplianceStore {
return s.ComplianceStore
}
func (s *TimerLayer) Emoji() EmojiStore {
return s.EmojiStore
}
func (s *TimerLayer) FileInfo() FileInfoStore {
return s.FileInfoStore
}
func (s *TimerLayer) Group() GroupStore {
return s.GroupStore
}
func (s *TimerLayer) Job() JobStore {
return s.JobStore
}
func (s *TimerLayer) License() LicenseStore {
return s.LicenseStore
}
func (s *TimerLayer) LinkMetadata() LinkMetadataStore {
return s.LinkMetadataStore
}
func (s *TimerLayer) OAuth() OAuthStore {
return s.OAuthStore
}
func (s *TimerLayer) Plugin() PluginStore {
return s.PluginStore
}
func (s *TimerLayer) Post() PostStore {
return s.PostStore
}
func (s *TimerLayer) Preference() PreferenceStore {
return s.PreferenceStore
}
func (s *TimerLayer) Reaction() ReactionStore {
return s.ReactionStore
}
func (s *TimerLayer) Role() RoleStore {
return s.RoleStore
}
func (s *TimerLayer) Scheme() SchemeStore {
return s.SchemeStore
}
func (s *TimerLayer) Session() SessionStore {
return s.SessionStore
}
func (s *TimerLayer) Status() StatusStore {
return s.StatusStore
}
func (s *TimerLayer) System() SystemStore {
return s.SystemStore
}
func (s *TimerLayer) Team() TeamStore {
return s.TeamStore
}
func (s *TimerLayer) TermsOfService() TermsOfServiceStore {
return s.TermsOfServiceStore
}
func (s *TimerLayer) Token() TokenStore {
return s.TokenStore
}
func (s *TimerLayer) User() UserStore {
return s.UserStore
}
func (s *TimerLayer) UserAccessToken() UserAccessTokenStore {
return s.UserAccessTokenStore
}
func (s *TimerLayer) UserTermsOfService() UserTermsOfServiceStore {
return s.UserTermsOfServiceStore
}
func (s *TimerLayer) Webhook() WebhookStore {
return s.WebhookStore
}
type TimerLayerAuditStore struct {
AuditStore
Root *TimerLayer
}
type TimerLayerBotStore struct {
BotStore
Root *TimerLayer
}
type TimerLayerChannelStore struct {
ChannelStore
Root *TimerLayer
}
type TimerLayerChannelMemberHistoryStore struct {
ChannelMemberHistoryStore
Root *TimerLayer
}
type TimerLayerClusterDiscoveryStore struct {
ClusterDiscoveryStore
Root *TimerLayer
}
type TimerLayerCommandStore struct {
CommandStore
Root *TimerLayer
}
type TimerLayerCommandWebhookStore struct {
CommandWebhookStore
Root *TimerLayer
}
type TimerLayerComplianceStore struct {
ComplianceStore
Root *TimerLayer
}
type TimerLayerEmojiStore struct {
EmojiStore
Root *TimerLayer
}
type TimerLayerFileInfoStore struct {
FileInfoStore
Root *TimerLayer
}
type TimerLayerGroupStore struct {
GroupStore
Root *TimerLayer
}
type TimerLayerJobStore struct {
JobStore
Root *TimerLayer
}
type TimerLayerLicenseStore struct {
LicenseStore
Root *TimerLayer
}
type TimerLayerLinkMetadataStore struct {
LinkMetadataStore
Root *TimerLayer
}
type TimerLayerOAuthStore struct {
OAuthStore
Root *TimerLayer
}
type TimerLayerPluginStore struct {
PluginStore
Root *TimerLayer
}
type TimerLayerPostStore struct {
PostStore
Root *TimerLayer
}
type TimerLayerPreferenceStore struct {
PreferenceStore
Root *TimerLayer
}
type TimerLayerReactionStore struct {
ReactionStore
Root *TimerLayer
}
type TimerLayerRoleStore struct {
RoleStore
Root *TimerLayer
}
type TimerLayerSchemeStore struct {
SchemeStore
Root *TimerLayer
}
type TimerLayerSessionStore struct {
SessionStore
Root *TimerLayer
}
type TimerLayerStatusStore struct {
StatusStore
Root *TimerLayer
}
type TimerLayerSystemStore struct {
SystemStore
Root *TimerLayer
}
type TimerLayerTeamStore struct {
TeamStore
Root *TimerLayer
}
type TimerLayerTermsOfServiceStore struct {
TermsOfServiceStore
Root *TimerLayer
}
type TimerLayerTokenStore struct {
TokenStore
Root *TimerLayer
}
type TimerLayerUserStore struct {
UserStore
Root *TimerLayer
}
type TimerLayerUserAccessTokenStore struct {
UserAccessTokenStore
Root *TimerLayer
}
type TimerLayerUserTermsOfServiceStore struct {
UserTermsOfServiceStore
Root *TimerLayer
}
type TimerLayerWebhookStore struct {
WebhookStore
Root *TimerLayer
}
func (s *TimerLayerAuditStore) Get(user_id string, offset int, limit int) (model.Audits, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.AuditStore.Get(user_id, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("AuditStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerAuditStore) PermanentDeleteByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.AuditStore.PermanentDeleteByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("AuditStore.PermanentDeleteByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerAuditStore) Save(audit *model.Audit) *model.AppError {
start := timemodule.Now()
resultVar0 := s.AuditStore.Save(audit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("AuditStore.Save", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerBotStore) Get(userId string, includeDeleted bool) (*model.Bot, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.BotStore.Get(userId, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("BotStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerBotStore) GetAll(options *model.BotGetOptions) ([]*model.Bot, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.BotStore.GetAll(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("BotStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerBotStore) PermanentDelete(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.BotStore.PermanentDelete(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("BotStore.PermanentDelete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerBotStore) Save(bot *model.Bot) (*model.Bot, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.BotStore.Save(bot)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("BotStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerBotStore) Update(bot *model.Bot) (*model.Bot, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.BotStore.Update(bot)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("BotStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) AnalyticsDeletedTypeCount(teamId string, channelType string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.AnalyticsDeletedTypeCount(teamId, channelType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.AnalyticsDeletedTypeCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) AnalyticsTypeCount(teamId string, channelType string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.AnalyticsTypeCount(teamId, channelType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.AnalyticsTypeCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) AutocompleteInTeam(teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.AutocompleteInTeam(teamId, term, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.AutocompleteInTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) AutocompleteInTeamForSearch(teamId string, userId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.AutocompleteInTeamForSearch(teamId, userId, term, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.AutocompleteInTeamForSearch", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) ClearAllCustomRoleAssignments() *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.ClearAllCustomRoleAssignments()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.ClearAllCustomRoleAssignments", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) ClearCaches() {
start := timemodule.Now()
s.ChannelStore.ClearCaches()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.ClearCaches", success, elapsed)
}
}
func (s *TimerLayerChannelStore) CountPostsAfter(channelId string, timestamp int64, userId string) (int, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.CountPostsAfter(channelId, timestamp, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.CountPostsAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) CreateDirectChannel(userId *model.User, otherUserId *model.User) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.CreateDirectChannel(userId, otherUserId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.CreateDirectChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) Delete(channelId string, time int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.Delete(channelId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) Get(id string, allowFromCache bool) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.Get(id, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetAll(teamId string) ([]*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetAll(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetAllChannelMembersForUser(userId string, allowFromCache bool, includeDeleted bool) (map[string]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetAllChannelMembersForUser(userId, allowFromCache, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetAllChannelMembersForUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetAllChannelMembersNotifyPropsForChannel(channelId string, allowFromCache bool) (map[string]model.StringMap, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetAllChannelMembersNotifyPropsForChannel(channelId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetAllChannelMembersNotifyPropsForChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetAllChannels(page int, perPage int, opts ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetAllChannels(page, perPage, opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetAllChannels", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetAllChannelsCount(opts ChannelSearchOpts) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetAllChannelsCount(opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetAllChannelsCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetAllChannelsForExportAfter(limit int, afterId string) ([]*model.ChannelForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetAllChannelsForExportAfter(limit, afterId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetAllChannelsForExportAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetAllDirectChannelsForExportAfter(limit int, afterId string) ([]*model.DirectChannelForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetAllDirectChannelsForExportAfter(limit, afterId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetAllDirectChannelsForExportAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetByName(team_id string, name string, allowFromCache bool) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetByName(team_id, name, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetByNameIncludeDeleted(team_id string, name string, allowFromCache bool) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetByNameIncludeDeleted(team_id, name, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetByNameIncludeDeleted", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetByNames(team_id string, names []string, allowFromCache bool) ([]*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetByNames(team_id, names, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetByNames", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetChannelCounts(teamId string, userId string) (*model.ChannelCounts, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetChannelCounts(teamId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannelCounts", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetChannelMembersForExport(userId string, teamId string) ([]*model.ChannelMemberForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetChannelMembersForExport(userId, teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannelMembersForExport", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetChannelMembersTimezones(channelId string) ([]model.StringMap, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetChannelMembersTimezones(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannelMembersTimezones", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetChannelUnread(channelId string, userId string) (*model.ChannelUnread, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetChannelUnread(channelId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannelUnread", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetChannels(teamId string, userId string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetChannels(teamId, userId, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannels", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetChannelsBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetChannelsBatchForIndexing(startTime, endTime, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannelsBatchForIndexing", success, elapsed)
}
return resultVar0, resultVar1
}
Adding the new search engine abstraction (#13304) * WIP * Adding bleve to go modules * WIP * Adding missing files from searchengine implementation * WIP * WIP * WIP * WIP * WIP * WIP * User and channel indexing and searches implemented * Make bleve tests run with in-memory indexes * Implement post index and deletion tests * Initial commits for the search layer * Removing unnecesary indexing * WIP * WIP * More fixes for tests * Adding the search layer * Finishing the migration of searchers to the layer * Removing unnecesary code * Allowing multiple engines active at the same time * WIP * Add simple post search * Print information when using bleve * Adding some debugging to understand better how the searches are working * Making more dynamic config of search engines * Add post search basics * Adding the Purge API endpoint * Fixing bleve config updates * Adding missed file * Regenerating search engine mocks * Adding missed v5 to modules imports * fixing i18n * Fixing some test around search engine * Removing all bleve traces * Cleaning up the vendors directory and go.mod/go.sum files * Regenerating timer layer * Adding properly the license * Fixing govet shadow error * Fixing some tests * Fixing TestSearchPostsFromUser * Fixing another test * Fixing more tests * Fixing more tests * Removing SearchEngine redundant text from searchengine module code * Fixing some reindexing problems in members updates * Fixing tests * Addressing PR comments * Reverting go.mod and go.sum * Addressing PR comments * Fixing tests compilation * Fixing govet * Adding search engine stop method * Being more explicit on where we use includeDeleted * Adding GetSqlSupplier test helper method * Mocking elasticsearch start function * Fixing tests Co-authored-by: Miguel de la Cruz <miguel@mcrx.me> Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-13 15:33:18 +01:00
func (s *TimerLayerChannelStore) GetChannelsByIds(channelIds []string, includeDeleted bool) ([]*model.Channel, *model.AppError) {
start := timemodule.Now()
Adding the new search engine abstraction (#13304) * WIP * Adding bleve to go modules * WIP * Adding missing files from searchengine implementation * WIP * WIP * WIP * WIP * WIP * WIP * User and channel indexing and searches implemented * Make bleve tests run with in-memory indexes * Implement post index and deletion tests * Initial commits for the search layer * Removing unnecesary indexing * WIP * WIP * More fixes for tests * Adding the search layer * Finishing the migration of searchers to the layer * Removing unnecesary code * Allowing multiple engines active at the same time * WIP * Add simple post search * Print information when using bleve * Adding some debugging to understand better how the searches are working * Making more dynamic config of search engines * Add post search basics * Adding the Purge API endpoint * Fixing bleve config updates * Adding missed file * Regenerating search engine mocks * Adding missed v5 to modules imports * fixing i18n * Fixing some test around search engine * Removing all bleve traces * Cleaning up the vendors directory and go.mod/go.sum files * Regenerating timer layer * Adding properly the license * Fixing govet shadow error * Fixing some tests * Fixing TestSearchPostsFromUser * Fixing another test * Fixing more tests * Fixing more tests * Removing SearchEngine redundant text from searchengine module code * Fixing some reindexing problems in members updates * Fixing tests * Addressing PR comments * Reverting go.mod and go.sum * Addressing PR comments * Fixing tests compilation * Fixing govet * Adding search engine stop method * Being more explicit on where we use includeDeleted * Adding GetSqlSupplier test helper method * Mocking elasticsearch start function * Fixing tests Co-authored-by: Miguel de la Cruz <miguel@mcrx.me> Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-13 15:33:18 +01:00
resultVar0, resultVar1 := s.ChannelStore.GetChannelsByIds(channelIds, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannelsByIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetChannelsByScheme(schemeId string, offset int, limit int) (model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetChannelsByScheme(schemeId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetChannelsByScheme", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetDeleted(team_id string, offset int, limit int, userId string) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetDeleted(team_id, offset, limit, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetDeleted", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetDeletedByName(team_id string, name string) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetDeletedByName(team_id, name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetDeletedByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetForPost(postId string) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetForPost(postId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetForPost", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetFromMaster(id string) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetFromMaster(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetFromMaster", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetGuestCount(channelId string, allowFromCache bool) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetGuestCount(channelId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetGuestCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMember(channelId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMemberCount(channelId string, allowFromCache bool) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMemberCount(channelId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMemberCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMemberCountFromCache(channelId string) int64 {
start := timemodule.Now()
resultVar0 := s.ChannelStore.GetMemberCountFromCache(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMemberCountFromCache", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) GetMemberForPost(postId string, userId string) (*model.ChannelMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMemberForPost(postId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMemberForPost", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMembers(channelId string, offset int, limit int) (*model.ChannelMembers, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMembers(channelId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMembersByIds(channelId, userIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMembersByIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMembersForUser(teamId string, userId string) (*model.ChannelMembers, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMembersForUser(teamId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMembersForUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMembersForUserWithPagination(teamId string, userId string, page int, perPage int) (*model.ChannelMembers, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMembersForUserWithPagination(teamId, userId, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMembersForUserWithPagination", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetMoreChannels(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetMoreChannels(teamId, userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetMoreChannels", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetPinnedPostCount(channelId string, allowFromCache bool) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetPinnedPostCount(channelId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetPinnedPostCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetPinnedPosts(channelId string) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetPinnedPosts(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetPinnedPosts", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetPublicChannelsByIdsForTeam(teamId, channelIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetPublicChannelsByIdsForTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetPublicChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetPublicChannelsForTeam(teamId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetPublicChannelsForTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GetTeamChannels(teamId string) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GetTeamChannels(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetTeamChannels", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) GroupSyncedChannelCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.GroupSyncedChannelCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GroupSyncedChannelCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) IncrementMentionCount(channelId string, userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.IncrementMentionCount(channelId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.IncrementMentionCount", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) InvalidateAllChannelMembersForUser(userId string) {
start := timemodule.Now()
s.ChannelStore.InvalidateAllChannelMembersForUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.InvalidateAllChannelMembersForUser", success, elapsed)
}
}
func (s *TimerLayerChannelStore) InvalidateCacheForChannelMembersNotifyProps(channelId string) {
start := timemodule.Now()
s.ChannelStore.InvalidateCacheForChannelMembersNotifyProps(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.InvalidateCacheForChannelMembersNotifyProps", success, elapsed)
}
}
func (s *TimerLayerChannelStore) InvalidateChannel(id string) {
start := timemodule.Now()
s.ChannelStore.InvalidateChannel(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.InvalidateChannel", success, elapsed)
}
}
func (s *TimerLayerChannelStore) InvalidateChannelByName(teamId string, name string) {
start := timemodule.Now()
s.ChannelStore.InvalidateChannelByName(teamId, name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.InvalidateChannelByName", success, elapsed)
}
}
func (s *TimerLayerChannelStore) InvalidateGuestCount(channelId string) {
start := timemodule.Now()
s.ChannelStore.InvalidateGuestCount(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.InvalidateGuestCount", success, elapsed)
}
}
func (s *TimerLayerChannelStore) InvalidateMemberCount(channelId string) {
start := timemodule.Now()
s.ChannelStore.InvalidateMemberCount(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.InvalidateMemberCount", success, elapsed)
}
}
func (s *TimerLayerChannelStore) InvalidatePinnedPostCount(channelId string) {
start := timemodule.Now()
s.ChannelStore.InvalidatePinnedPostCount(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.InvalidatePinnedPostCount", success, elapsed)
}
}
func (s *TimerLayerChannelStore) IsUserInChannelUseCache(userId string, channelId string) bool {
start := timemodule.Now()
resultVar0 := s.ChannelStore.IsUserInChannelUseCache(userId, channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.IsUserInChannelUseCache", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) MigrateChannelMembers(fromChannelId string, fromUserId string) (map[string]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.MigrateChannelMembers(fromChannelId, fromUserId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.MigrateChannelMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) MigratePublicChannels() error {
start := timemodule.Now()
resultVar0 := s.ChannelStore.MigratePublicChannels()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.MigratePublicChannels", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) PermanentDelete(channelId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.PermanentDelete(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.PermanentDelete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) PermanentDeleteByTeam(teamId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.PermanentDeleteByTeam(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.PermanentDeleteByTeam", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) PermanentDeleteMembersByChannel(channelId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.PermanentDeleteMembersByChannel(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.PermanentDeleteMembersByChannel", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) PermanentDeleteMembersByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.PermanentDeleteMembersByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.PermanentDeleteMembersByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) RemoveAllDeactivatedMembers(channelId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.RemoveAllDeactivatedMembers(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.RemoveAllDeactivatedMembers", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) RemoveMember(channelId string, userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.RemoveMember(channelId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.RemoveMember", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) RemoveMembers(channelId string, userIds []string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.RemoveMembers(channelId, userIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.RemoveMembers", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) ResetAllChannelSchemes() *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.ResetAllChannelSchemes()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.ResetAllChannelSchemes", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) Restore(channelId string, time int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.Restore(channelId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.Restore", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.Save(channel, maxChannelsPerTeam)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SaveDirectChannel(channel *model.Channel, member1 *model.ChannelMember, member2 *model.ChannelMember) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SaveDirectChannel(channel, member1, member2)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SaveDirectChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SaveMember(member *model.ChannelMember) (*model.ChannelMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SaveMember(member)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SaveMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SaveMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SaveMultipleMembers(members)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SaveMultipleMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SearchAllChannels(term string, opts ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1, resultVar2 := s.ChannelStore.SearchAllChannels(term, opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar2 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SearchAllChannels", success, elapsed)
}
return resultVar0, resultVar1, resultVar2
}
func (s *TimerLayerChannelStore) SearchArchivedInTeam(teamId string, term string, userId string) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SearchArchivedInTeam(teamId, term, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SearchArchivedInTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SearchForUserInTeam(userId string, teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SearchForUserInTeam(userId, teamId, term, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SearchForUserInTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SearchGroupChannels(userId string, term string) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SearchGroupChannels(userId, term)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SearchGroupChannels", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SearchInTeam(teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SearchInTeam(teamId, term, includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SearchInTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SearchMore(userId string, teamId string, term string) (*model.ChannelList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.SearchMore(userId, teamId, term)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SearchMore", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) SetDeleteAt(channelId string, deleteAt int64, updateAt int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.SetDeleteAt(channelId, deleteAt, updateAt)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SetDeleteAt", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) Update(channel *model.Channel) (*model.Channel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.Update(channel)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) UpdateLastViewedAt(channelIds []string, userId string) (map[string]int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.UpdateLastViewedAt(channelIds, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.UpdateLastViewedAt", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) UpdateLastViewedAtPost(unreadPost *model.Post, userID string, mentionCount int) (*model.ChannelUnreadAt, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.UpdateLastViewedAtPost(unreadPost, userID, mentionCount)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.UpdateLastViewedAtPost", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) UpdateMember(member *model.ChannelMember) (*model.ChannelMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.UpdateMember(member)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.UpdateMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) UpdateMembersRole(channelID string, userIDs []string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelStore.UpdateMembersRole(channelID, userIDs)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.UpdateMembersRole", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelStore) UpdateMultipleMembers(members []*model.ChannelMember) ([]*model.ChannelMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.UpdateMultipleMembers(members)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.UpdateMultipleMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelStore) UserBelongsToChannels(userId string, channelIds []string) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelStore.UserBelongsToChannels(userId, channelIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.UserBelongsToChannels", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelMemberHistoryStore) GetUsersInChannelDuring(startTime int64, endTime int64, channelId string) ([]*model.ChannelMemberHistoryResult, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelMemberHistoryStore.GetUsersInChannelDuring(startTime, endTime, channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelMemberHistoryStore.GetUsersInChannelDuring", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerChannelMemberHistoryStore) LogJoinEvent(userId string, channelId string, joinTime int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelMemberHistoryStore.LogJoinEvent(userId, channelId, joinTime)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelMemberHistoryStore.LogJoinEvent", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelMemberHistoryStore) LogLeaveEvent(userId string, channelId string, leaveTime int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ChannelMemberHistoryStore.LogLeaveEvent(userId, channelId, leaveTime)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelMemberHistoryStore.LogLeaveEvent", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerChannelMemberHistoryStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ChannelMemberHistoryStore.PermanentDeleteBatch(endTime, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelMemberHistoryStore.PermanentDeleteBatch", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerClusterDiscoveryStore) Cleanup() *model.AppError {
start := timemodule.Now()
resultVar0 := s.ClusterDiscoveryStore.Cleanup()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Cleanup", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerClusterDiscoveryStore) Delete(discovery *model.ClusterDiscovery) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ClusterDiscoveryStore.Delete(discovery)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Delete", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerClusterDiscoveryStore) Exists(discovery *model.ClusterDiscovery) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ClusterDiscoveryStore.Exists(discovery)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Exists", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerClusterDiscoveryStore) GetAll(discoveryType string, clusterName string) ([]*model.ClusterDiscovery, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ClusterDiscoveryStore.GetAll(discoveryType, clusterName)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerClusterDiscoveryStore) Save(discovery *model.ClusterDiscovery) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ClusterDiscoveryStore.Save(discovery)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Save", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerClusterDiscoveryStore) SetLastPingAt(discovery *model.ClusterDiscovery) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ClusterDiscoveryStore.SetLastPingAt(discovery)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.SetLastPingAt", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerCommandStore) AnalyticsCommandCount(teamId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandStore.AnalyticsCommandCount(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.AnalyticsCommandCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandStore) Delete(commandId string, time int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.CommandStore.Delete(commandId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerCommandStore) Get(id string) (*model.Command, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandStore) GetByTeam(teamId string) ([]*model.Command, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandStore.GetByTeam(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.GetByTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandStore) GetByTrigger(teamId string, trigger string) (*model.Command, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandStore.GetByTrigger(teamId, trigger)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.GetByTrigger", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandStore) PermanentDeleteByTeam(teamId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.CommandStore.PermanentDeleteByTeam(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.PermanentDeleteByTeam", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerCommandStore) PermanentDeleteByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.CommandStore.PermanentDeleteByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.PermanentDeleteByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerCommandStore) Save(webhook *model.Command) (*model.Command, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandStore.Save(webhook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandStore) Update(hook *model.Command) (*model.Command, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandStore.Update(hook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandWebhookStore) Cleanup() {
start := timemodule.Now()
s.CommandWebhookStore.Cleanup()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.Cleanup", success, elapsed)
}
}
func (s *TimerLayerCommandWebhookStore) Get(id string) (*model.CommandWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandWebhookStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandWebhookStore) Save(webhook *model.CommandWebhook) (*model.CommandWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.CommandWebhookStore.Save(webhook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerCommandWebhookStore) TryUse(id string, limit int) *model.AppError {
start := timemodule.Now()
resultVar0 := s.CommandWebhookStore.TryUse(id, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.TryUse", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ComplianceStore.ComplianceExport(compliance)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.ComplianceExport", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerComplianceStore) Get(id string) (*model.Compliance, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ComplianceStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerComplianceStore) GetAll(offset int, limit int) (model.Compliances, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ComplianceStore.GetAll(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ComplianceStore.MessageExport(after, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.MessageExport", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ComplianceStore.Save(compliance)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ComplianceStore.Update(compliance)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerEmojiStore) Delete(emoji *model.Emoji, time int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.EmojiStore.Delete(emoji, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerEmojiStore) Get(id string, allowFromCache bool) (*model.Emoji, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.EmojiStore.Get(id, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerEmojiStore) GetByName(name string, allowFromCache bool) (*model.Emoji, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.EmojiStore.GetByName(name, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.GetByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerEmojiStore) GetList(offset int, limit int, sort string) ([]*model.Emoji, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.EmojiStore.GetList(offset, limit, sort)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.GetList", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerEmojiStore) GetMultipleByName(names []string) ([]*model.Emoji, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.EmojiStore.GetMultipleByName(names)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.GetMultipleByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerEmojiStore) Save(emoji *model.Emoji) (*model.Emoji, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.EmojiStore.Save(emoji)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerEmojiStore) Search(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.EmojiStore.Search(name, prefixOnly, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Search", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) AttachToPost(fileId string, postId string, creatorId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.FileInfoStore.AttachToPost(fileId, postId, creatorId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.AttachToPost", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerFileInfoStore) ClearCaches() {
start := timemodule.Now()
s.FileInfoStore.ClearCaches()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.ClearCaches", success, elapsed)
}
}
func (s *TimerLayerFileInfoStore) DeleteForPost(postId string) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.DeleteForPost(postId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.DeleteForPost", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) Get(id string) (*model.FileInfo, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) GetByPath(path string) (*model.FileInfo, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.GetByPath(path)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetByPath", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) GetForPost(postId string, readFromMaster bool, includeDeleted bool, allowFromCache bool) ([]*model.FileInfo, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.GetForPost(postId, readFromMaster, includeDeleted, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetForPost", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) GetForUser(userId string) ([]*model.FileInfo, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.GetForUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetForUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) GetWithOptions(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.GetWithOptions(page, perPage, opt)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetWithOptions", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) InvalidateFileInfosForPostCache(postId string, deleted bool) {
start := timemodule.Now()
s.FileInfoStore.InvalidateFileInfosForPostCache(postId, deleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.InvalidateFileInfosForPostCache", success, elapsed)
}
}
func (s *TimerLayerFileInfoStore) PermanentDelete(fileId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.FileInfoStore.PermanentDelete(fileId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.PermanentDelete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerFileInfoStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.PermanentDeleteBatch(endTime, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.PermanentDeleteBatch", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) PermanentDeleteByUser(userId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.PermanentDeleteByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.PermanentDeleteByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerFileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.FileInfoStore.Save(info)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) AdminRoleGroupsForSyncableMember(userID string, syncableID string, syncableType model.GroupSyncableType) ([]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.AdminRoleGroupsForSyncableMember(userID, syncableID, syncableType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.AdminRoleGroupsForSyncableMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) ChannelMembersMinusGroupMembers(channelID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.ChannelMembersMinusGroupMembers(channelID, groupIDs, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.ChannelMembersMinusGroupMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) ChannelMembersToAdd(since int64, channelID *string) ([]*model.UserChannelIDPair, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.ChannelMembersToAdd(since, channelID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.ChannelMembersToAdd", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) ChannelMembersToRemove(channelID *string) ([]*model.ChannelMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.ChannelMembersToRemove(channelID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.ChannelMembersToRemove", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) CountChannelMembersMinusGroupMembers(channelID string, groupIDs []string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.CountChannelMembersMinusGroupMembers(channelID, groupIDs)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.CountChannelMembersMinusGroupMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) CountGroupsByChannel(channelId string, opts model.GroupSearchOpts) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.CountGroupsByChannel(channelId, opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.CountGroupsByChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) CountGroupsByTeam(teamId string, opts model.GroupSearchOpts) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.CountGroupsByTeam(teamId, opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.CountGroupsByTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) CountTeamMembersMinusGroupMembers(teamID string, groupIDs []string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.CountTeamMembersMinusGroupMembers(teamID, groupIDs)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.CountTeamMembersMinusGroupMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) Create(group *model.Group) (*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.Create(group)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.Create", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) CreateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.CreateGroupSyncable(groupSyncable)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.CreateGroupSyncable", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) Delete(groupID string) (*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.Delete(groupID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.Delete", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.DeleteGroupSyncable(groupID, syncableID, syncableType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.DeleteGroupSyncable", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) DeleteMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.DeleteMember(groupID, userID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.DeleteMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) DistinctGroupMemberCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.DistinctGroupMemberCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.DistinctGroupMemberCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) Get(groupID string) (*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.Get(groupID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetAllBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetAllBySource(groupSource)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetAllBySource", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetAllGroupSyncablesByGroupId(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetAllGroupSyncablesByGroupId(groupID, syncableType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetAllGroupSyncablesByGroupId", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetByIDs(groupIDs []string) ([]*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetByIDs(groupIDs)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByIDs", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetByName(name string) (*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetByName(name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetByRemoteID(remoteID, groupSource)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByRemoteID", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetByUser(userId string) ([]*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetGroupSyncable(groupID, syncableID, syncableType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetGroupSyncable", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetGroups(page int, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetGroups(page, perPage, opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetGroups", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetGroupsByChannel(channelId, opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetGroupsByChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetGroupsByTeam(teamId, opts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetGroupsByTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetMemberCount(groupID string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetMemberCount(groupID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetMemberCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetMemberUsers(groupID string) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetMemberUsers(groupID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetMemberUsers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GetMemberUsersPage(groupID string, page int, perPage int) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GetMemberUsersPage(groupID, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetMemberUsersPage", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GroupChannelCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GroupChannelCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GroupChannelCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GroupCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GroupCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GroupCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GroupMemberCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GroupMemberCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GroupMemberCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) GroupTeamCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.GroupTeamCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GroupTeamCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) PermanentDeleteMembersByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.GroupStore.PermanentDeleteMembersByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.PermanentDeleteMembersByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerGroupStore) PermittedSyncableAdmins(syncableID string, syncableType model.GroupSyncableType) ([]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.PermittedSyncableAdmins(syncableID, syncableType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.PermittedSyncableAdmins", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.TeamMembersMinusGroupMembers(teamID, groupIDs, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.TeamMembersMinusGroupMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) TeamMembersToAdd(since int64, teamID *string) ([]*model.UserTeamIDPair, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.TeamMembersToAdd(since, teamID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.TeamMembersToAdd", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) TeamMembersToRemove(teamID *string) ([]*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.TeamMembersToRemove(teamID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.TeamMembersToRemove", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) Update(group *model.Group) (*model.Group, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.Update(group)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.UpdateGroupSyncable(groupSyncable)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.UpdateGroupSyncable", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerGroupStore) UpsertMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.GroupStore.UpsertMember(groupID, userID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.UpsertMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) Delete(id string) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.Delete(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.Delete", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) Get(id string) (*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) GetAllByStatus(status string) ([]*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.GetAllByStatus(status)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllByStatus", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) GetAllByType(jobType string) ([]*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.GetAllByType(jobType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllByType", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.GetAllByTypePage(jobType, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllByTypePage", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) GetAllPage(offset int, limit int) ([]*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.GetAllPage(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllPage", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) GetCountByStatusAndType(status string, jobType string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.GetCountByStatusAndType(status, jobType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetCountByStatusAndType", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.GetNewestJobByStatusAndType(status, jobType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetNewestJobByStatusAndType", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) Save(job *model.Job) (*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.Save(job)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) UpdateOptimistically(job *model.Job, currentStatus string) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.UpdateOptimistically(job, currentStatus)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.UpdateOptimistically", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) UpdateStatus(id string, status string) (*model.Job, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.UpdateStatus(id, status)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.UpdateStatus", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerJobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.JobStore.UpdateStatusOptimistically(id, currentStatus, newStatus)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("JobStore.UpdateStatusOptimistically", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerLicenseStore) Get(id string) (*model.LicenseRecord, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.LicenseStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("LicenseStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerLicenseStore) Save(license *model.LicenseRecord) (*model.LicenseRecord, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.LicenseStore.Save(license)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("LicenseStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerLinkMetadataStore) Get(url string, timestamp int64) (*model.LinkMetadata, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.LinkMetadataStore.Get(url, timestamp)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("LinkMetadataStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerLinkMetadataStore) Save(linkMetadata *model.LinkMetadata) (*model.LinkMetadata, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.LinkMetadataStore.Save(linkMetadata)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("LinkMetadataStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) DeleteApp(id string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.OAuthStore.DeleteApp(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.DeleteApp", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerOAuthStore) GetAccessData(token string) (*model.AccessData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetAccessData(token)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAccessData", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetAccessDataByRefreshToken(token)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAccessDataByRefreshToken", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetAccessDataByUserForApp(userId string, clientId string) ([]*model.AccessData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetAccessDataByUserForApp(userId, clientId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAccessDataByUserForApp", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetApp(id string) (*model.OAuthApp, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetApp(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetApp", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetAppByUser(userId string, offset int, limit int) ([]*model.OAuthApp, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetAppByUser(userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAppByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetApps(offset int, limit int) ([]*model.OAuthApp, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetApps(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetApps", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetAuthData(code string) (*model.AuthData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetAuthData(code)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAuthData", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetAuthorizedApps(userId string, offset int, limit int) ([]*model.OAuthApp, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetAuthorizedApps(userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAuthorizedApps", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) GetPreviousAccessData(userId string, clientId string) (*model.AccessData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.GetPreviousAccessData(userId, clientId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetPreviousAccessData", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) PermanentDeleteAuthDataByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.OAuthStore.PermanentDeleteAuthDataByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.PermanentDeleteAuthDataByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerOAuthStore) RemoveAccessData(token string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.OAuthStore.RemoveAccessData(token)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.RemoveAccessData", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerOAuthStore) RemoveAllAccessData() *model.AppError {
start := timemodule.Now()
resultVar0 := s.OAuthStore.RemoveAllAccessData()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.RemoveAllAccessData", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerOAuthStore) RemoveAuthData(code string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.OAuthStore.RemoveAuthData(code)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.RemoveAuthData", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerOAuthStore) SaveAccessData(accessData *model.AccessData) (*model.AccessData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.SaveAccessData(accessData)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.SaveAccessData", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) SaveApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.SaveApp(app)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.SaveApp", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) SaveAuthData(authData *model.AuthData) (*model.AuthData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.SaveAuthData(authData)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.SaveAuthData", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) UpdateAccessData(accessData *model.AccessData) (*model.AccessData, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.UpdateAccessData(accessData)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.UpdateAccessData", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerOAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.OAuthStore.UpdateApp(app)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.UpdateApp", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPluginStore) CompareAndDelete(keyVal *model.PluginKeyValue, oldValue []byte) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PluginStore.CompareAndDelete(keyVal, oldValue)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.CompareAndDelete", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPluginStore) CompareAndSet(keyVal *model.PluginKeyValue, oldValue []byte) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PluginStore.CompareAndSet(keyVal, oldValue)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.CompareAndSet", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPluginStore) Delete(pluginId string, key string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PluginStore.Delete(pluginId, key)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPluginStore) DeleteAllExpired() *model.AppError {
start := timemodule.Now()
resultVar0 := s.PluginStore.DeleteAllExpired()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.DeleteAllExpired", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPluginStore) DeleteAllForPlugin(PluginId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PluginStore.DeleteAllForPlugin(PluginId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.DeleteAllForPlugin", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPluginStore) Get(pluginId string, key string) (*model.PluginKeyValue, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PluginStore.Get(pluginId, key)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPluginStore) List(pluginId string, page int, perPage int) ([]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PluginStore.List(pluginId, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.List", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPluginStore) SaveOrUpdate(keyVal *model.PluginKeyValue) (*model.PluginKeyValue, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PluginStore.SaveOrUpdate(keyVal)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.SaveOrUpdate", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPluginStore) SetWithOptions(pluginId string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PluginStore.SetWithOptions(pluginId, key, value, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.SetWithOptions", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.AnalyticsPostCount(teamId, mustHaveFile, mustHaveHashtag)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.AnalyticsPostCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) AnalyticsPostCountsByDay(options *model.AnalyticsPostCountsOptions) (model.AnalyticsRows, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.AnalyticsPostCountsByDay(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.AnalyticsPostCountsByDay", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) (model.AnalyticsRows, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.AnalyticsUserCountsWithPostsByDay(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.AnalyticsUserCountsWithPostsByDay", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) ClearCaches() {
start := timemodule.Now()
s.PostStore.ClearCaches()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.ClearCaches", success, elapsed)
}
}
func (s *TimerLayerPostStore) Delete(postId string, time int64, deleteByID string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PostStore.Delete(postId, time, deleteByID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPostStore) Get(id string, skipFetchThreads bool) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.Get(id, skipFetchThreads)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetDirectPostParentsForExportAfter(limit int, afterId string) ([]*model.DirectPostForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetDirectPostParentsForExportAfter(limit, afterId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetDirectPostParentsForExportAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetEtag(channelId string, allowFromCache bool) string {
start := timemodule.Now()
resultVar0 := s.PostStore.GetEtag(channelId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetEtag", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPostStore) GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetFlaggedPosts(userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetFlaggedPosts", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetFlaggedPostsForChannel(userId string, channelId string, offset int, limit int) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetFlaggedPostsForChannel(userId, channelId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetFlaggedPostsForChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetFlaggedPostsForTeam(userId string, teamId string, offset int, limit int) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetFlaggedPostsForTeam(userId, teamId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetFlaggedPostsForTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetMaxPostSize() int {
start := timemodule.Now()
resultVar0 := s.PostStore.GetMaxPostSize()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetMaxPostSize", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPostStore) GetOldest() (*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetOldest()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetOldest", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetParentsForExportAfter(limit int, afterId string) ([]*model.PostForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetParentsForExportAfter(limit, afterId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetParentsForExportAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostAfterTime(channelId string, time int64) (*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostAfterTime(channelId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostAfterTime", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostIdAfterTime(channelId string, time int64) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostIdAfterTime(channelId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostIdAfterTime", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostIdBeforeTime(channelId string, time int64) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostIdBeforeTime(channelId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostIdBeforeTime", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPosts(options model.GetPostsOptions, allowFromCache bool) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPosts(options, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPosts", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostsAfter(options model.GetPostsOptions) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostsAfter(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostsBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.PostForIndexing, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostsBatchForIndexing(startTime, endTime, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsBatchForIndexing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostsBefore(options model.GetPostsOptions) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostsBefore(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsBefore", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostsByIds(postIds []string) ([]*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostsByIds(postIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsByIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostsCreatedAt(channelId string, time int64) ([]*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostsCreatedAt(channelId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsCreatedAt", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetPostsSince(options model.GetPostsSinceOptions, allowFromCache bool) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetPostsSince(options, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsSince", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetRepliesForExport(parentId string) ([]*model.ReplyForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetRepliesForExport(parentId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetRepliesForExport", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetSingle(id string) (*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetSingle(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetSingle", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) InvalidateLastPostTimeCache(channelId string) {
start := timemodule.Now()
s.PostStore.InvalidateLastPostTimeCache(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.InvalidateLastPostTimeCache", success, elapsed)
}
}
func (s *TimerLayerPostStore) Overwrite(post *model.Post) (*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.Overwrite(post)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Overwrite", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) OverwriteMultiple(posts []*model.Post) ([]*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.OverwriteMultiple(posts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.OverwriteMultiple", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.PermanentDeleteBatch(endTime, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.PermanentDeleteBatch", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) PermanentDeleteByChannel(channelId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PostStore.PermanentDeleteByChannel(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.PermanentDeleteByChannel", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPostStore) PermanentDeleteByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PostStore.PermanentDeleteByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.PermanentDeleteByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPostStore) Save(post *model.Post) (*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.Save(post)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) SaveMultiple(posts []*model.Post) ([]*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.SaveMultiple(posts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.SaveMultiple", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) Search(teamId string, userId string, params *model.SearchParams) (*model.PostList, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.Search(teamId, userId, params)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Search", success, elapsed)
}
return resultVar0, resultVar1
}
Adding the new search engine abstraction (#13304) * WIP * Adding bleve to go modules * WIP * Adding missing files from searchengine implementation * WIP * WIP * WIP * WIP * WIP * WIP * User and channel indexing and searches implemented * Make bleve tests run with in-memory indexes * Implement post index and deletion tests * Initial commits for the search layer * Removing unnecesary indexing * WIP * WIP * More fixes for tests * Adding the search layer * Finishing the migration of searchers to the layer * Removing unnecesary code * Allowing multiple engines active at the same time * WIP * Add simple post search * Print information when using bleve * Adding some debugging to understand better how the searches are working * Making more dynamic config of search engines * Add post search basics * Adding the Purge API endpoint * Fixing bleve config updates * Adding missed file * Regenerating search engine mocks * Adding missed v5 to modules imports * fixing i18n * Fixing some test around search engine * Removing all bleve traces * Cleaning up the vendors directory and go.mod/go.sum files * Regenerating timer layer * Adding properly the license * Fixing govet shadow error * Fixing some tests * Fixing TestSearchPostsFromUser * Fixing another test * Fixing more tests * Fixing more tests * Removing SearchEngine redundant text from searchengine module code * Fixing some reindexing problems in members updates * Fixing tests * Addressing PR comments * Reverting go.mod and go.sum * Addressing PR comments * Fixing tests compilation * Fixing govet * Adding search engine stop method * Being more explicit on where we use includeDeleted * Adding GetSqlSupplier test helper method * Mocking elasticsearch start function * Fixing tests Co-authored-by: Miguel de la Cruz <miguel@mcrx.me> Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-13 15:33:18 +01:00
func (s *TimerLayerPostStore) SearchPostsInTeamForUser(paramsList []*model.SearchParams, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, page int, perPage int) (*model.PostSearchResults, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.SearchPostsInTeamForUser(paramsList, userId, teamId, isOrSearch, includeDeletedChannels, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.SearchPostsInTeamForUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) Update(newPost *model.Post, oldPost *model.Post) (*model.Post, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.Update(newPost, oldPost)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPreferenceStore) CleanupFlagsBatch(limit int64) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PreferenceStore.CleanupFlagsBatch(limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.CleanupFlagsBatch", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPreferenceStore) Delete(userId string, category string, name string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PreferenceStore.Delete(userId, category, name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPreferenceStore) DeleteCategory(userId string, category string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PreferenceStore.DeleteCategory(userId, category)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.DeleteCategory", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPreferenceStore) DeleteCategoryAndName(category string, name string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PreferenceStore.DeleteCategoryAndName(category, name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.DeleteCategoryAndName", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPreferenceStore) Get(userId string, category string, name string) (*model.Preference, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PreferenceStore.Get(userId, category, name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPreferenceStore) GetAll(userId string) (model.Preferences, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PreferenceStore.GetAll(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPreferenceStore) GetCategory(userId string, category string) (model.Preferences, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PreferenceStore.GetCategory(userId, category)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.GetCategory", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPreferenceStore) PermanentDeleteByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PreferenceStore.PermanentDeleteByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.PermanentDeleteByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerPreferenceStore) Save(preferences *model.Preferences) *model.AppError {
start := timemodule.Now()
resultVar0 := s.PreferenceStore.Save(preferences)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.Save", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerReactionStore) BulkGetForPosts(postIds []string) ([]*model.Reaction, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ReactionStore.BulkGetForPosts(postIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.BulkGetForPosts", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ReactionStore.Delete(reaction)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.Delete", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerReactionStore) DeleteAllWithEmojiName(emojiName string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.ReactionStore.DeleteAllWithEmojiName(emojiName)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.DeleteAllWithEmojiName", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerReactionStore) GetForPost(postId string, allowFromCache bool) ([]*model.Reaction, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ReactionStore.GetForPost(postId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.GetForPost", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerReactionStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ReactionStore.PermanentDeleteBatch(endTime, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.PermanentDeleteBatch", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerReactionStore) Save(reaction *model.Reaction) (*model.Reaction, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.ReactionStore.Save(reaction)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
MM-22212 & MM-22208: Read from the higher-scoped scheme if the permission is non-moderated. (#13813) * MM-22212: Read non-moderated permissions from higher-scoped scheme. * MM-2212: Corrects test count in comment. * MM-22212: Adds godoc comment. * MM-2212: Switches to the channel roles check in a few more places. * MM-22212: Refactors and fixes. * MM-22212: Reverts change, no longer required. * MM-22212: Removes translation. * MM-22212: Un-comments merged new permission. * MM-22212: Un-comments merged new permission. * MM-22212: Performance tweak. * MM-22212: Fixes some fmting. * MM-22212: Add unit test for newly-added store methods. * MM-22212: Renames app method. * MM-22212: Re-uses existing function to find string in slice. * MM-22212: Keeps 'higher-scoped' terminology for consistency. * MM-22212: Refactors based on PR feedback. * MM-22212: Fix for some bad merging. * MM-22212: Renamed some things. * MM-22212: Use an 'else' instead of a 'continue' for readability. * MM-22212: Caches (*SqlRoleStore).ChannelRolesUnderTeamRole. * MM-22212: Adds mock to new cache store. * MM-22212: Adds missing open tracing app layer methods. * MM-22212: Adds migration to add moderated permissions to channel_admin if present on channel_user. * MM-22212: Migrates team schemes. Removes unused AppError. * MM-22212: Fix for for if. * MM-22212: Fixes iterator. * MM-22212: Updates open tracing generated methods. * MM-22212: Fix mocks. * MM-22212: Change migration key name. * MM-22212: Switched to data structure from other branch. * MM-22212: Fixes tests after adding 'use_channel_mentions' to the channel_admin role. * MM-22212: Adds tracking of channel moderation. * Revert "MM-22212: Adds tracking of channel moderation." This reverts commit 23689efa22c112e4ba37f6a212535dd7ebfb63db. * MM-22212: Switch some functions to methods and vice versa. * MM-22212: Fix for refactor bug not notifiying websocket about changed role. * MM-22212: Adds test for public/private 'manage_members' handling. * MM-22122 Fix manage channel members edge case for public and private channels (#14049) * MM-22212: Adds moderated permission to team_admin. * MM-22212: Updates migration. * MM-22212: Revert unnecessary update to default roles. * Add channel scheme updated event when channel scheme is deleted or created (#14057) * MM-22212: Adds newline. * MM-22212: Migration fix. * MM-22212: Fix for migration. * MM-22212: Test fix. Co-authored-by: Farhan Munshi <3207297+fm2munsh@users.noreply.github.com>
2020-03-23 13:44:20 -04:00
func (s *TimerLayerRoleStore) AllChannelSchemeRoles() ([]*model.Role, *model.AppError) {
start := timemodule.Now()
MM-22212 & MM-22208: Read from the higher-scoped scheme if the permission is non-moderated. (#13813) * MM-22212: Read non-moderated permissions from higher-scoped scheme. * MM-2212: Corrects test count in comment. * MM-22212: Adds godoc comment. * MM-2212: Switches to the channel roles check in a few more places. * MM-22212: Refactors and fixes. * MM-22212: Reverts change, no longer required. * MM-22212: Removes translation. * MM-22212: Un-comments merged new permission. * MM-22212: Un-comments merged new permission. * MM-22212: Performance tweak. * MM-22212: Fixes some fmting. * MM-22212: Add unit test for newly-added store methods. * MM-22212: Renames app method. * MM-22212: Re-uses existing function to find string in slice. * MM-22212: Keeps 'higher-scoped' terminology for consistency. * MM-22212: Refactors based on PR feedback. * MM-22212: Fix for some bad merging. * MM-22212: Renamed some things. * MM-22212: Use an 'else' instead of a 'continue' for readability. * MM-22212: Caches (*SqlRoleStore).ChannelRolesUnderTeamRole. * MM-22212: Adds mock to new cache store. * MM-22212: Adds missing open tracing app layer methods. * MM-22212: Adds migration to add moderated permissions to channel_admin if present on channel_user. * MM-22212: Migrates team schemes. Removes unused AppError. * MM-22212: Fix for for if. * MM-22212: Fixes iterator. * MM-22212: Updates open tracing generated methods. * MM-22212: Fix mocks. * MM-22212: Change migration key name. * MM-22212: Switched to data structure from other branch. * MM-22212: Fixes tests after adding 'use_channel_mentions' to the channel_admin role. * MM-22212: Adds tracking of channel moderation. * Revert "MM-22212: Adds tracking of channel moderation." This reverts commit 23689efa22c112e4ba37f6a212535dd7ebfb63db. * MM-22212: Switch some functions to methods and vice versa. * MM-22212: Fix for refactor bug not notifiying websocket about changed role. * MM-22212: Adds test for public/private 'manage_members' handling. * MM-22122 Fix manage channel members edge case for public and private channels (#14049) * MM-22212: Adds moderated permission to team_admin. * MM-22212: Updates migration. * MM-22212: Revert unnecessary update to default roles. * Add channel scheme updated event when channel scheme is deleted or created (#14057) * MM-22212: Adds newline. * MM-22212: Migration fix. * MM-22212: Fix for migration. * MM-22212: Test fix. Co-authored-by: Farhan Munshi <3207297+fm2munsh@users.noreply.github.com>
2020-03-23 13:44:20 -04:00
resultVar0, resultVar1 := s.RoleStore.AllChannelSchemeRoles()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.AllChannelSchemeRoles", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) ChannelHigherScopedPermissions(roleNames []string) (map[string]*model.RolePermissions, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.ChannelHigherScopedPermissions(roleNames)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.ChannelHigherScopedPermissions", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) ChannelRolesUnderTeamRole(roleName string) ([]*model.Role, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.ChannelRolesUnderTeamRole(roleName)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.ChannelRolesUnderTeamRole", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) Delete(roleId string) (*model.Role, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.Delete(roleId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.Delete", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) Get(roleId string) (*model.Role, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.Get(roleId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) GetAll() ([]*model.Role, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.GetAll()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) GetByName(name string) (*model.Role, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.GetByName(name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.GetByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) GetByNames(names []string) ([]*model.Role, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.GetByNames(names)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.GetByNames", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerRoleStore) PermanentDeleteAll() *model.AppError {
start := timemodule.Now()
resultVar0 := s.RoleStore.PermanentDeleteAll()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.PermanentDeleteAll", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerRoleStore) Save(role *model.Role) (*model.Role, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.RoleStore.Save(role)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSchemeStore) CountByScope(scope string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SchemeStore.CountByScope(scope)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.CountByScope", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSchemeStore) CountWithoutPermission(scope string, permissionID string, roleScope model.RoleScope, roleType model.RoleType) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SchemeStore.CountWithoutPermission(scope, permissionID, roleScope, roleType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.CountWithoutPermission", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSchemeStore) Delete(schemeId string) (*model.Scheme, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SchemeStore.Delete(schemeId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.Delete", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSchemeStore) Get(schemeId string) (*model.Scheme, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SchemeStore.Get(schemeId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSchemeStore) GetAllPage(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SchemeStore.GetAllPage(scope, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.GetAllPage", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSchemeStore) GetByName(schemeName string) (*model.Scheme, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SchemeStore.GetByName(schemeName)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.GetByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSchemeStore) PermanentDeleteAll() *model.AppError {
start := timemodule.Now()
resultVar0 := s.SchemeStore.PermanentDeleteAll()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.PermanentDeleteAll", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSchemeStore) Save(scheme *model.Scheme) (*model.Scheme, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SchemeStore.Save(scheme)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSessionStore) AnalyticsSessionCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SessionStore.AnalyticsSessionCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.AnalyticsSessionCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSessionStore) Cleanup(expiryTime int64, batchSize int64) {
start := timemodule.Now()
s.SessionStore.Cleanup(expiryTime, batchSize)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Cleanup", success, elapsed)
}
}
func (s *TimerLayerSessionStore) Get(sessionIdOrToken string) (*model.Session, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SessionStore.Get(sessionIdOrToken)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSessionStore) GetSessions(userId string) ([]*model.Session, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SessionStore.GetSessions(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.GetSessions", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSessionStore) GetSessionsWithActiveDeviceIds(userId string) ([]*model.Session, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SessionStore.GetSessionsWithActiveDeviceIds(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.GetSessionsWithActiveDeviceIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSessionStore) PermanentDeleteSessionsByUser(teamId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.SessionStore.PermanentDeleteSessionsByUser(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.PermanentDeleteSessionsByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSessionStore) Remove(sessionIdOrToken string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.SessionStore.Remove(sessionIdOrToken)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Remove", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSessionStore) RemoveAllSessions() *model.AppError {
start := timemodule.Now()
resultVar0 := s.SessionStore.RemoveAllSessions()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.RemoveAllSessions", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSessionStore) Save(session *model.Session) (*model.Session, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SessionStore.Save(session)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSessionStore) UpdateDeviceId(id string, deviceId string, expiresAt int64) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SessionStore.UpdateDeviceId(id, deviceId, expiresAt)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateDeviceId", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSessionStore) UpdateLastActivityAt(sessionId string, time int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.SessionStore.UpdateLastActivityAt(sessionId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateLastActivityAt", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSessionStore) UpdateProps(session *model.Session) *model.AppError {
start := timemodule.Now()
resultVar0 := s.SessionStore.UpdateProps(session)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateProps", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSessionStore) UpdateRoles(userId string, roles string) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SessionStore.UpdateRoles(userId, roles)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateRoles", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerStatusStore) Get(userId string) (*model.Status, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.StatusStore.Get(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerStatusStore) GetByIds(userIds []string) ([]*model.Status, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.StatusStore.GetByIds(userIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.GetByIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerStatusStore) GetTotalActiveUsersCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.StatusStore.GetTotalActiveUsersCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.GetTotalActiveUsersCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerStatusStore) ResetAll() *model.AppError {
start := timemodule.Now()
resultVar0 := s.StatusStore.ResetAll()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.ResetAll", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerStatusStore) SaveOrUpdate(status *model.Status) *model.AppError {
start := timemodule.Now()
resultVar0 := s.StatusStore.SaveOrUpdate(status)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.SaveOrUpdate", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerStatusStore) UpdateLastActivityAt(userId string, lastActivityAt int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.StatusStore.UpdateLastActivityAt(userId, lastActivityAt)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.UpdateLastActivityAt", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSystemStore) Get() (model.StringMap, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SystemStore.Get()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSystemStore) GetByName(name string) (*model.System, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SystemStore.GetByName(name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.GetByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSystemStore) PermanentDeleteByName(name string) (*model.System, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.SystemStore.PermanentDeleteByName(name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.PermanentDeleteByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerSystemStore) Save(system *model.System) *model.AppError {
start := timemodule.Now()
resultVar0 := s.SystemStore.Save(system)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.Save", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSystemStore) SaveOrUpdate(system *model.System) *model.AppError {
start := timemodule.Now()
resultVar0 := s.SystemStore.SaveOrUpdate(system)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.SaveOrUpdate", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerSystemStore) Update(system *model.System) *model.AppError {
start := timemodule.Now()
resultVar0 := s.SystemStore.Update(system)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.Update", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) AnalyticsGetTeamCountForScheme(schemeId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.AnalyticsGetTeamCountForScheme(schemeId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.AnalyticsGetTeamCountForScheme", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) AnalyticsPrivateTeamCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.AnalyticsPrivateTeamCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.AnalyticsPrivateTeamCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) AnalyticsPublicTeamCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.AnalyticsPublicTeamCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.AnalyticsPublicTeamCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) AnalyticsTeamCount(includeDeleted bool) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.AnalyticsTeamCount(includeDeleted)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.AnalyticsTeamCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) ClearAllCustomRoleAssignments() *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.ClearAllCustomRoleAssignments()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.ClearAllCustomRoleAssignments", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) ClearCaches() {
start := timemodule.Now()
s.TeamStore.ClearCaches()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.ClearCaches", success, elapsed)
}
}
func (s *TimerLayerTeamStore) Get(id string) (*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetActiveMemberCount(teamId string, restrictions *model.ViewUsersRestrictions) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetActiveMemberCount(teamId, restrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetActiveMemberCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAll() ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAll()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAllForExportAfter(limit int, afterId string) ([]*model.TeamForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAllForExportAfter(limit, afterId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAllForExportAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAllPage(offset int, limit int) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAllPage(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAllPage", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAllPrivateTeamListing() ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAllPrivateTeamListing()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAllPrivateTeamListing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAllPrivateTeamPageListing(offset int, limit int) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAllPrivateTeamPageListing(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAllPrivateTeamPageListing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAllPublicTeamPageListing(offset int, limit int) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAllPublicTeamPageListing(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAllPublicTeamPageListing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAllTeamListing() ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAllTeamListing()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAllTeamListing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetAllTeamPageListing(offset int, limit int) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetAllTeamPageListing(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetAllTeamPageListing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetByInviteId(inviteId string) (*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetByInviteId(inviteId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetByInviteId", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetByName(name string) (*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetByName(name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetByName", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetByNames(name []string) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetByNames(name)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetByNames", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetChannelUnreadsForAllTeams(excludeTeamId string, userId string) ([]*model.ChannelUnread, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetChannelUnreadsForAllTeams(excludeTeamId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetChannelUnreadsForAllTeams", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetChannelUnreadsForTeam(teamId string, userId string) ([]*model.ChannelUnread, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetChannelUnreadsForTeam(teamId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetChannelUnreadsForTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetMember(teamId string, userId string) (*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetMember(teamId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetMembers(teamId string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetMembers(teamId, offset, limit, teamMembersGetOptions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetMembersByIds(teamId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetMembersByIds(teamId, userIds, restrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetMembersByIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetTeamMembersForExport(userId string) ([]*model.TeamMemberForExport, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetTeamMembersForExport(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetTeamMembersForExport", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetTeamsByScheme(schemeId string, offset int, limit int) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetTeamsByScheme(schemeId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetTeamsByScheme", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetTeamsByUserId(userId string) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetTeamsByUserId(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetTeamsByUserId", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetTeamsForUser(userId string) ([]*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetTeamsForUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetTeamsForUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetTeamsForUserWithPagination(userId string, page int, perPage int) ([]*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetTeamsForUserWithPagination(userId, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetTeamsForUserWithPagination", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetTotalMemberCount(teamId string, restrictions *model.ViewUsersRestrictions) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetTotalMemberCount(teamId, restrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetTotalMemberCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GetUserTeamIds(userId string, allowFromCache bool) ([]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GetUserTeamIds(userId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GetUserTeamIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) GroupSyncedTeamCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.GroupSyncedTeamCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.GroupSyncedTeamCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) InvalidateAllTeamIdsForUser(userId string) {
start := timemodule.Now()
s.TeamStore.InvalidateAllTeamIdsForUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.InvalidateAllTeamIdsForUser", success, elapsed)
}
}
func (s *TimerLayerTeamStore) MigrateTeamMembers(fromTeamId string, fromUserId string) (map[string]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.MigrateTeamMembers(fromTeamId, fromUserId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.MigrateTeamMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) PermanentDelete(teamId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.PermanentDelete(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.PermanentDelete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) RemoveAllMembersByTeam(teamId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.RemoveAllMembersByTeam(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.RemoveAllMembersByTeam", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) RemoveAllMembersByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.RemoveAllMembersByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.RemoveAllMembersByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) RemoveMember(teamId string, userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.RemoveMember(teamId, userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.RemoveMember", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) RemoveMembers(teamId string, userIds []string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.RemoveMembers(teamId, userIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.RemoveMembers", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) ResetAllTeamSchemes() *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.ResetAllTeamSchemes()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.ResetAllTeamSchemes", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) Save(team *model.Team) (*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.Save(team)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) SaveMember(member *model.TeamMember, maxUsersPerTeam int) (*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.SaveMember(member, maxUsersPerTeam)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.SaveMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) SaveMultipleMembers(members []*model.TeamMember, maxUsersPerTeam int) ([]*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.SaveMultipleMembers(members, maxUsersPerTeam)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.SaveMultipleMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) SearchAll(term string) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.SearchAll(term)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.SearchAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) SearchAllPaged(term string, page int, perPage int) ([]*model.Team, int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1, resultVar2 := s.TeamStore.SearchAllPaged(term, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar2 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.SearchAllPaged", success, elapsed)
}
return resultVar0, resultVar1, resultVar2
}
func (s *TimerLayerTeamStore) SearchOpen(term string) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.SearchOpen(term)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.SearchOpen", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) SearchPrivate(term string) ([]*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.SearchPrivate(term)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.SearchPrivate", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) Update(team *model.Team) (*model.Team, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.Update(team)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) UpdateLastTeamIconUpdate(teamId string, curTime int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.UpdateLastTeamIconUpdate(teamId, curTime)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.UpdateLastTeamIconUpdate", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) UpdateMember(member *model.TeamMember) (*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.UpdateMember(member)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.UpdateMember", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) UpdateMembersRole(teamID string, userIDs []string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TeamStore.UpdateMembersRole(teamID, userIDs)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.UpdateMembersRole", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTeamStore) UpdateMultipleMembers(members []*model.TeamMember) ([]*model.TeamMember, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.UpdateMultipleMembers(members)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.UpdateMultipleMembers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTeamStore) UserBelongsToTeams(userId string, teamIds []string) (bool, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TeamStore.UserBelongsToTeams(userId, teamIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.UserBelongsToTeams", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTermsOfServiceStore) Get(id string, allowFromCache bool) (*model.TermsOfService, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TermsOfServiceStore.Get(id, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TermsOfServiceStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfService, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TermsOfServiceStore.GetLatest(allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TermsOfServiceStore.GetLatest", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*model.TermsOfService, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TermsOfServiceStore.Save(termsOfService)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TermsOfServiceStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTokenStore) Cleanup() {
start := timemodule.Now()
s.TokenStore.Cleanup()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.Cleanup", success, elapsed)
}
}
func (s *TimerLayerTokenStore) Delete(token string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TokenStore.Delete(token)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTokenStore) GetByToken(token string) (*model.Token, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.TokenStore.GetByToken(token)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.GetByToken", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerTokenStore) RemoveAllTokensByType(tokenType string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TokenStore.RemoveAllTokensByType(tokenType)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.RemoveAllTokensByType", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerTokenStore) Save(recovery *model.Token) *model.AppError {
start := timemodule.Now()
resultVar0 := s.TokenStore.Save(recovery)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.Save", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.AnalyticsActiveCount(time, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AnalyticsActiveCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) AnalyticsGetGuestCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.AnalyticsGetGuestCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AnalyticsGetGuestCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.AnalyticsGetInactiveUsersCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AnalyticsGetInactiveUsersCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) AnalyticsGetSystemAdminCount() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.AnalyticsGetSystemAdminCount()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AnalyticsGetSystemAdminCount", success, elapsed)
}
return resultVar0, resultVar1
}
Adding the new search engine abstraction (#13304) * WIP * Adding bleve to go modules * WIP * Adding missing files from searchengine implementation * WIP * WIP * WIP * WIP * WIP * WIP * User and channel indexing and searches implemented * Make bleve tests run with in-memory indexes * Implement post index and deletion tests * Initial commits for the search layer * Removing unnecesary indexing * WIP * WIP * More fixes for tests * Adding the search layer * Finishing the migration of searchers to the layer * Removing unnecesary code * Allowing multiple engines active at the same time * WIP * Add simple post search * Print information when using bleve * Adding some debugging to understand better how the searches are working * Making more dynamic config of search engines * Add post search basics * Adding the Purge API endpoint * Fixing bleve config updates * Adding missed file * Regenerating search engine mocks * Adding missed v5 to modules imports * fixing i18n * Fixing some test around search engine * Removing all bleve traces * Cleaning up the vendors directory and go.mod/go.sum files * Regenerating timer layer * Adding properly the license * Fixing govet shadow error * Fixing some tests * Fixing TestSearchPostsFromUser * Fixing another test * Fixing more tests * Fixing more tests * Removing SearchEngine redundant text from searchengine module code * Fixing some reindexing problems in members updates * Fixing tests * Addressing PR comments * Reverting go.mod and go.sum * Addressing PR comments * Fixing tests compilation * Fixing govet * Adding search engine stop method * Being more explicit on where we use includeDeleted * Adding GetSqlSupplier test helper method * Mocking elasticsearch start function * Fixing tests Co-authored-by: Miguel de la Cruz <miguel@mcrx.me> Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-13 15:33:18 +01:00
func (s *TimerLayerUserStore) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.AutocompleteUsersInChannel(teamId, channelId, term, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AutocompleteUsersInChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) ClearAllCustomRoleAssignments() *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.ClearAllCustomRoleAssignments()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.ClearAllCustomRoleAssignments", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) ClearCaches() {
start := timemodule.Now()
s.UserStore.ClearCaches()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.ClearCaches", success, elapsed)
}
}
func (s *TimerLayerUserStore) Count(options model.UserCountOptions) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.Count(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Count", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) DeactivateGuests() ([]string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.DeactivateGuests()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.DeactivateGuests", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) DemoteUserToGuest(userID string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.DemoteUserToGuest(userID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.DemoteUserToGuest", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) Get(id string) (*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.Get(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetAll() ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetAll()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetAllAfter(limit int, afterId string) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetAllAfter(limit, afterId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllAfter", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetAllProfiles(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllProfiles", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetAllProfilesInChannel(channelId, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllProfilesInChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetAllUsingAuthService(authService string) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetAllUsingAuthService(authService)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllUsingAuthService", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetAnyUnreadPostCountForChannel(userId string, channelId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetAnyUnreadPostCountForChannel(userId, channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAnyUnreadPostCountForChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetByAuth(authData *string, authService string) (*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetByAuth(authData, authService)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetByAuth", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetByEmail(email string) (*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetByEmail(email)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetByEmail", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetByUsername(username string) (*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetByUsername(username)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetByUsername", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetChannelGroupUsers(channelID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetChannelGroupUsers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetEtagForAllProfiles() string {
start := timemodule.Now()
resultVar0 := s.UserStore.GetEtagForAllProfiles()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetEtagForAllProfiles", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) GetEtagForProfiles(teamId string) string {
start := timemodule.Now()
resultVar0 := s.UserStore.GetEtagForProfiles(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetEtagForProfiles", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) GetEtagForProfilesNotInTeam(teamId string) string {
start := timemodule.Now()
resultVar0 := s.UserStore.GetEtagForProfilesNotInTeam(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetEtagForProfilesNotInTeam", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) GetForLogin(loginId string, allowSignInWithUsername bool, allowSignInWithEmail bool) (*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetForLogin(loginId, allowSignInWithUsername, allowSignInWithEmail)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetForLogin", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetNewUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetNewUsersForTeam(teamId, offset, limit, viewRestrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetNewUsersForTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfileByGroupChannelIdsForUser(userId string, channelIds []string) (map[string][]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfileByGroupChannelIdsForUser(userId, channelIds)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfileByGroupChannelIdsForUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfileByIds(userIds []string, options *UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfileByIds(userIds, options, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfileByIds", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfiles(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfiles", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfilesByUsernames(usernames, viewRestrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesByUsernames", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfilesInChannel(channelId string, offset int, limit int) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfilesInChannel(channelId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesInChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfilesInChannelByStatus(channelId string, offset int, limit int) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfilesInChannelByStatus(channelId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesInChannelByStatus", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfilesNotInChannel(teamId, channelId, groupConstrained, offset, limit, viewRestrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesNotInChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfilesNotInTeam(teamId, groupConstrained, offset, limit, viewRestrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesNotInTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetProfilesWithoutTeam(options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesWithoutTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetRecentlyActiveUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetRecentlyActiveUsersForTeam(teamId, offset, limit, viewRestrictions)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetRecentlyActiveUsersForTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetSystemAdminProfiles() (map[string]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetSystemAdminProfiles()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetSystemAdminProfiles", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetTeamGroupUsers(teamID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetTeamGroupUsers", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetUnreadCount(userId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetUnreadCount(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetUnreadCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetUnreadCountForChannel(userId string, channelId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetUnreadCountForChannel(userId, channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetUnreadCountForChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) GetUsersBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.UserForIndexing, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.GetUsersBatchForIndexing(startTime, endTime, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetUsersBatchForIndexing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) InferSystemInstallDate() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.InferSystemInstallDate()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InferSystemInstallDate", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) InvalidateProfileCacheForUser(userId string) {
start := timemodule.Now()
s.UserStore.InvalidateProfileCacheForUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidateProfileCacheForUser", success, elapsed)
}
}
func (s *TimerLayerUserStore) InvalidateProfilesInChannelCache(channelId string) {
start := timemodule.Now()
s.UserStore.InvalidateProfilesInChannelCache(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidateProfilesInChannelCache", success, elapsed)
}
}
func (s *TimerLayerUserStore) InvalidateProfilesInChannelCacheByUser(userId string) {
start := timemodule.Now()
s.UserStore.InvalidateProfilesInChannelCacheByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidateProfilesInChannelCacheByUser", success, elapsed)
}
}
func (s *TimerLayerUserStore) PermanentDelete(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.PermanentDelete(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.PermanentDelete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) PromoteGuestToUser(userID string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.PromoteGuestToUser(userID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.PromoteGuestToUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) ResetLastPictureUpdate(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.ResetLastPictureUpdate(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.ResetLastPictureUpdate", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) Save(user *model.User) (*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.Save(user)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) Search(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.Search(teamId, term, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Search", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) SearchInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.SearchInChannel(channelId, term, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.SearchInChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.SearchNotInChannel(teamId, channelId, term, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.SearchNotInChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.SearchNotInTeam(notInTeamId, term, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.SearchNotInTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) SearchWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.SearchWithoutTeam(term, options)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.SearchWithoutTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.Update(user, allowRoleUpdate)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Update", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.UpdateAuthData(userId, service, authData, email, resetMfa)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateAuthData", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.UpdateFailedPasswordAttempts(userId, attempts)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateFailedPasswordAttempts", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) UpdateLastPictureUpdate(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.UpdateLastPictureUpdate(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateLastPictureUpdate", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) UpdateMfaActive(userId string, active bool) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.UpdateMfaActive(userId, active)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateMfaActive", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) UpdateMfaSecret(userId string, secret string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.UpdateMfaSecret(userId, secret)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateMfaSecret", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) UpdatePassword(userId string, newPassword string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserStore.UpdatePassword(userId, newPassword)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdatePassword", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserStore) UpdateUpdateAt(userId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.UpdateUpdateAt(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateUpdateAt", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserStore) VerifyEmail(userId string, email string) (string, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserStore.VerifyEmail(userId, email)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.VerifyEmail", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserAccessTokenStore) Delete(tokenId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserAccessTokenStore.Delete(tokenId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserAccessTokenStore) DeleteAllForUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserAccessTokenStore.DeleteAllForUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.DeleteAllForUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserAccessTokenStore) Get(tokenId string) (*model.UserAccessToken, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserAccessTokenStore.Get(tokenId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Get", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserAccessTokenStore) GetAll(offset int, limit int) ([]*model.UserAccessToken, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserAccessTokenStore.GetAll(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.GetAll", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserAccessTokenStore) GetByToken(tokenString string) (*model.UserAccessToken, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserAccessTokenStore.GetByToken(tokenString)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.GetByToken", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserAccessTokenStore) GetByUser(userId string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserAccessTokenStore.GetByUser(userId, page, perPage)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.GetByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserAccessTokenStore) Save(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserAccessTokenStore.Save(token)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserAccessTokenStore) Search(term string) ([]*model.UserAccessToken, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserAccessTokenStore.Search(term)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Search", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserAccessTokenStore) UpdateTokenDisable(tokenId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserAccessTokenStore.UpdateTokenDisable(tokenId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.UpdateTokenDisable", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserAccessTokenStore) UpdateTokenEnable(tokenId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserAccessTokenStore.UpdateTokenEnable(tokenId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.UpdateTokenEnable", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserTermsOfServiceStore) Delete(userId string, termsOfServiceId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.UserTermsOfServiceStore.Delete(userId, termsOfServiceId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserTermsOfServiceStore.Delete", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerUserTermsOfServiceStore) GetByUser(userId string) (*model.UserTermsOfService, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserTermsOfServiceStore.GetByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserTermsOfServiceStore.GetByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerUserTermsOfServiceStore) Save(userTermsOfService *model.UserTermsOfService) (*model.UserTermsOfService, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.UserTermsOfServiceStore.Save(userTermsOfService)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserTermsOfServiceStore.Save", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.AnalyticsIncomingCount(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.AnalyticsIncomingCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.AnalyticsOutgoingCount(teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.AnalyticsOutgoingCount", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) ClearCaches() {
start := timemodule.Now()
s.WebhookStore.ClearCaches()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.ClearCaches", success, elapsed)
}
}
func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.WebhookStore.DeleteIncoming(webhookId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.DeleteIncoming", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
start := timemodule.Now()
resultVar0 := s.WebhookStore.DeleteOutgoing(webhookId, time)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.DeleteOutgoing", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetIncoming(id, allowFromCache)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncoming", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByChannel(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingByChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeam(teamId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingByTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeamByUser(teamId, userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingByTeamByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetIncomingList(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingList", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetIncomingListByUser(userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingListByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetOutgoing(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannel(channelId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByChannel", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannelByUser(channelId, userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByChannelByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeam(teamId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByTeam", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeamByUser(teamId, userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByTeamByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingList(offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingList", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingListByUser(userId, offset, limit)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingListByUser", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) InvalidateWebhookCache(webhook string) {
start := timemodule.Now()
s.WebhookStore.InvalidateWebhookCache(webhook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.InvalidateWebhookCache", success, elapsed)
}
}
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByChannel(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteIncomingByChannel", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteIncomingByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByChannel(channelId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteOutgoingByChannel", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
start := timemodule.Now()
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByUser(userId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar0 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteOutgoingByUser", success, elapsed)
}
return resultVar0
}
func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.SaveIncoming(webhook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.SaveIncoming", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.SaveOutgoing(webhook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.SaveOutgoing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.UpdateIncoming(webhook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.UpdateIncoming", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.WebhookStore.UpdateOutgoing(hook)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.UpdateOutgoing", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayer) Close() {
s.Store.Close()
}
func (s *TimerLayer) DropAllTables() {
s.Store.DropAllTables()
}
func (s *TimerLayer) GetCurrentSchemaVersion() string {
return s.Store.GetCurrentSchemaVersion()
}
func (s *TimerLayer) LockToMaster() {
s.Store.LockToMaster()
}
func (s *TimerLayer) MarkSystemRanUnitTests() {
s.Store.MarkSystemRanUnitTests()
}
func (s *TimerLayer) SetContext(context context.Context) {
s.Store.SetContext(context)
}
func (s *TimerLayer) TotalMasterDbConnections() int {
return s.Store.TotalMasterDbConnections()
}
func (s *TimerLayer) TotalReadDbConnections() int {
return s.Store.TotalReadDbConnections()
}
func (s *TimerLayer) TotalSearchDbConnections() int {
return s.Store.TotalSearchDbConnections()
}
func (s *TimerLayer) UnlockFromMaster() {
s.Store.UnlockFromMaster()
}
func NewTimerLayer(childStore Store, metrics einterfaces.MetricsInterface) *TimerLayer {
newStore := TimerLayer{
Store: childStore,
Metrics: metrics,
}
newStore.AuditStore = &TimerLayerAuditStore{AuditStore: childStore.Audit(), Root: &newStore}
newStore.BotStore = &TimerLayerBotStore{BotStore: childStore.Bot(), Root: &newStore}
newStore.ChannelStore = &TimerLayerChannelStore{ChannelStore: childStore.Channel(), Root: &newStore}
newStore.ChannelMemberHistoryStore = &TimerLayerChannelMemberHistoryStore{ChannelMemberHistoryStore: childStore.ChannelMemberHistory(), Root: &newStore}
newStore.ClusterDiscoveryStore = &TimerLayerClusterDiscoveryStore{ClusterDiscoveryStore: childStore.ClusterDiscovery(), Root: &newStore}
newStore.CommandStore = &TimerLayerCommandStore{CommandStore: childStore.Command(), Root: &newStore}
newStore.CommandWebhookStore = &TimerLayerCommandWebhookStore{CommandWebhookStore: childStore.CommandWebhook(), Root: &newStore}
newStore.ComplianceStore = &TimerLayerComplianceStore{ComplianceStore: childStore.Compliance(), Root: &newStore}
newStore.EmojiStore = &TimerLayerEmojiStore{EmojiStore: childStore.Emoji(), Root: &newStore}
newStore.FileInfoStore = &TimerLayerFileInfoStore{FileInfoStore: childStore.FileInfo(), Root: &newStore}
newStore.GroupStore = &TimerLayerGroupStore{GroupStore: childStore.Group(), Root: &newStore}
newStore.JobStore = &TimerLayerJobStore{JobStore: childStore.Job(), Root: &newStore}
newStore.LicenseStore = &TimerLayerLicenseStore{LicenseStore: childStore.License(), Root: &newStore}
newStore.LinkMetadataStore = &TimerLayerLinkMetadataStore{LinkMetadataStore: childStore.LinkMetadata(), Root: &newStore}
newStore.OAuthStore = &TimerLayerOAuthStore{OAuthStore: childStore.OAuth(), Root: &newStore}
newStore.PluginStore = &TimerLayerPluginStore{PluginStore: childStore.Plugin(), Root: &newStore}
newStore.PostStore = &TimerLayerPostStore{PostStore: childStore.Post(), Root: &newStore}
newStore.PreferenceStore = &TimerLayerPreferenceStore{PreferenceStore: childStore.Preference(), Root: &newStore}
newStore.ReactionStore = &TimerLayerReactionStore{ReactionStore: childStore.Reaction(), Root: &newStore}
newStore.RoleStore = &TimerLayerRoleStore{RoleStore: childStore.Role(), Root: &newStore}
newStore.SchemeStore = &TimerLayerSchemeStore{SchemeStore: childStore.Scheme(), Root: &newStore}
newStore.SessionStore = &TimerLayerSessionStore{SessionStore: childStore.Session(), Root: &newStore}
newStore.StatusStore = &TimerLayerStatusStore{StatusStore: childStore.Status(), Root: &newStore}
newStore.SystemStore = &TimerLayerSystemStore{SystemStore: childStore.System(), Root: &newStore}
newStore.TeamStore = &TimerLayerTeamStore{TeamStore: childStore.Team(), Root: &newStore}
newStore.TermsOfServiceStore = &TimerLayerTermsOfServiceStore{TermsOfServiceStore: childStore.TermsOfService(), Root: &newStore}
newStore.TokenStore = &TimerLayerTokenStore{TokenStore: childStore.Token(), Root: &newStore}
newStore.UserStore = &TimerLayerUserStore{UserStore: childStore.User(), Root: &newStore}
newStore.UserAccessTokenStore = &TimerLayerUserAccessTokenStore{UserAccessTokenStore: childStore.UserAccessToken(), Root: &newStore}
newStore.UserTermsOfServiceStore = &TimerLayerUserTermsOfServiceStore{UserTermsOfServiceStore: childStore.UserTermsOfService(), Root: &newStore}
newStore.WebhookStore = &TimerLayerWebhookStore{WebhookStore: childStore.Webhook(), Root: &newStore}
return &newStore
}