mattermost/server/public/plugin/hooks_timer_layer_generated.go

597 lines
26 KiB
Go
Raw Permalink Normal View History

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// Code generated by "make pluginapi"
// DO NOT EDIT
package plugin
import (
"io"
"net/http"
timePkg "time"
saml2 "github.com/mattermost/gosaml2"
"github.com/mattermost/mattermost/server/public/model"
)
type hooksTimerLayer struct {
[MM-68655] Surface RPC errors from plugin hooks (#36414) * add WithRPCErr hooks (server-facing/internal only) * zero _returns on RPC failure in WithRPCErr companions Aligns the WithRPCErr template with the HooksRPCErr godoc contract: when g.client.Call returns a transport error, gob may have partially decoded the reply. Reassign _returns to a zero value before destructuring so callers always receive zeroed outputs alongside a non-nil transport error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * rename HooksRPCErr to HooksWithRPCErr for naming consistency Every related symbol uses the WithRPCErr suffix (MessageHasBeenPostedWithRPCErr, RunMultiPluginHookWithRPCErr, RunMultiHookWithRPCErr, etc.). Aligning the interface name removes the only outlier and makes the convention uniform. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * rename rpcErrImpl to hooksWithRPCErrImpl Mirrors the existing hooksImpl/Hooks naming pattern on hooksTimerLayer. * add supervisor.HooksWithRPCErr() and drop runtime type assertion The old path did rp.supervisor.Hooks().(HooksWithRPCErr) and handled the "doesn't implement" branch — but that branch was structurally unreachable (the compile-time `_ HooksWithRPCErr = (*hooksTimerLayer)(nil)` assertion guards it). Change supervisor.hooks from `Hooks` to the concrete `*hooksTimerLayer` (which implements both interfaces, enforced at field assignment), add a parallel HooksWithRPCErr() accessor, and call it directly. Hooks() keeps its public Hooks-interface signature via implicit conversion at return. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * drop "implemented by" clause from HooksWithRPCErr godoc Both hooksRPCClient and hooksTimerLayer satisfy the interface, and naming implementations in interface godocs adds rot — the contract is what readers need, not the list of wrappers. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 10:41:11 -04:00
pluginID string
hooksImpl Hooks
hooksWithRPCErrImpl HooksWithRPCErr
metrics metricsInterface
}
func (hooks *hooksTimerLayer) recordTime(startTime timePkg.Time, name string, success bool) {
if hooks.metrics != nil {
elapsedTime := float64(timePkg.Since(startTime)) / float64(timePkg.Second)
hooks.metrics.ObservePluginHookDuration(hooks.pluginID, name, success, elapsedTime)
}
}
func (hooks *hooksTimerLayer) OnActivate() error {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnActivate()
hooks.recordTime(startTime, "OnActivate", _returnsA == nil)
return _returnsA
}
func (hooks *hooksTimerLayer) Implemented() ([]string, error) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.Implemented()
hooks.recordTime(startTime, "Implemented", _returnsB == nil)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) OnDeactivate() error {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnDeactivate()
hooks.recordTime(startTime, "OnDeactivate", _returnsA == nil)
return _returnsA
}
func (hooks *hooksTimerLayer) OnConfigurationChange() error {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnConfigurationChange()
hooks.recordTime(startTime, "OnConfigurationChange", _returnsA == nil)
return _returnsA
}
func (hooks *hooksTimerLayer) ServeHTTP(c *Context, w http.ResponseWriter, r *http.Request) {
startTime := timePkg.Now()
hooks.hooksImpl.ServeHTTP(c, w, r)
hooks.recordTime(startTime, "ServeHTTP", true)
}
func (hooks *hooksTimerLayer) ExecuteCommand(c *Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.ExecuteCommand(c, args)
hooks.recordTime(startTime, "ExecuteCommand", _returnsB == nil)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) UserHasBeenCreated(c *Context, user *model.User) {
startTime := timePkg.Now()
hooks.hooksImpl.UserHasBeenCreated(c, user)
hooks.recordTime(startTime, "UserHasBeenCreated", true)
}
func (hooks *hooksTimerLayer) UserWillLogIn(c *Context, user *model.User) string {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.UserWillLogIn(c, user)
hooks.recordTime(startTime, "UserWillLogIn", true)
return _returnsA
}
func (hooks *hooksTimerLayer) UserHasLoggedIn(c *Context, user *model.User) {
startTime := timePkg.Now()
hooks.hooksImpl.UserHasLoggedIn(c, user)
hooks.recordTime(startTime, "UserHasLoggedIn", true)
}
func (hooks *hooksTimerLayer) MessageWillBePosted(c *Context, post *model.Post) (*model.Post, string) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.MessageWillBePosted(c, post)
hooks.recordTime(startTime, "MessageWillBePosted", true)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) MessageWillBeUpdated(c *Context, newPost, oldPost *model.Post) (*model.Post, string) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.MessageWillBeUpdated(c, newPost, oldPost)
hooks.recordTime(startTime, "MessageWillBeUpdated", true)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) MessageHasBeenPosted(c *Context, post *model.Post) {
startTime := timePkg.Now()
hooks.hooksImpl.MessageHasBeenPosted(c, post)
hooks.recordTime(startTime, "MessageHasBeenPosted", true)
}
func (hooks *hooksTimerLayer) MessageHasBeenUpdated(c *Context, newPost, oldPost *model.Post) {
startTime := timePkg.Now()
hooks.hooksImpl.MessageHasBeenUpdated(c, newPost, oldPost)
hooks.recordTime(startTime, "MessageHasBeenUpdated", true)
}
func (hooks *hooksTimerLayer) MessagesWillBeConsumed(posts []*model.Post) []*model.Post {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.MessagesWillBeConsumed(posts)
hooks.recordTime(startTime, "MessagesWillBeConsumed", true)
return _returnsA
}
func (hooks *hooksTimerLayer) MessageHasBeenDeleted(c *Context, post *model.Post) {
startTime := timePkg.Now()
hooks.hooksImpl.MessageHasBeenDeleted(c, post)
hooks.recordTime(startTime, "MessageHasBeenDeleted", true)
}
func (hooks *hooksTimerLayer) ChannelHasBeenCreated(c *Context, channel *model.Channel) {
startTime := timePkg.Now()
hooks.hooksImpl.ChannelHasBeenCreated(c, channel)
hooks.recordTime(startTime, "ChannelHasBeenCreated", true)
}
func (hooks *hooksTimerLayer) ChannelWillBeArchived(c *Context, channel *model.Channel) string {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.ChannelWillBeArchived(c, channel)
hooks.recordTime(startTime, "ChannelWillBeArchived", true)
return _returnsA
}
func (hooks *hooksTimerLayer) ChannelMemberWillBeAdded(c *Context, channelMember *model.ChannelMember) (*model.ChannelMember, string) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.ChannelMemberWillBeAdded(c, channelMember)
hooks.recordTime(startTime, "ChannelMemberWillBeAdded", true)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) UserHasJoinedChannel(c *Context, channelMember *model.ChannelMember, actor *model.User) {
startTime := timePkg.Now()
hooks.hooksImpl.UserHasJoinedChannel(c, channelMember, actor)
hooks.recordTime(startTime, "UserHasJoinedChannel", true)
}
func (hooks *hooksTimerLayer) UserHasLeftChannel(c *Context, channelMember *model.ChannelMember, actor *model.User) {
startTime := timePkg.Now()
hooks.hooksImpl.UserHasLeftChannel(c, channelMember, actor)
hooks.recordTime(startTime, "UserHasLeftChannel", true)
}
func (hooks *hooksTimerLayer) TeamMemberWillBeAdded(c *Context, teamMember *model.TeamMember) (*model.TeamMember, string) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.TeamMemberWillBeAdded(c, teamMember)
hooks.recordTime(startTime, "TeamMemberWillBeAdded", true)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) UserHasJoinedTeam(c *Context, teamMember *model.TeamMember, actor *model.User) {
startTime := timePkg.Now()
hooks.hooksImpl.UserHasJoinedTeam(c, teamMember, actor)
hooks.recordTime(startTime, "UserHasJoinedTeam", true)
}
func (hooks *hooksTimerLayer) UserHasLeftTeam(c *Context, teamMember *model.TeamMember, actor *model.User) {
startTime := timePkg.Now()
hooks.hooksImpl.UserHasLeftTeam(c, teamMember, actor)
hooks.recordTime(startTime, "UserHasLeftTeam", true)
}
func (hooks *hooksTimerLayer) FileWillBeUploaded(c *Context, info *model.FileInfo, file io.Reader, output io.Writer) (*model.FileInfo, string) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.FileWillBeUploaded(c, info, file, output)
hooks.recordTime(startTime, "FileWillBeUploaded", true)
return _returnsA, _returnsB
}
feat: pluginapi: filewillbedownloaded / sendtoastmessage (#34596) * feat: filewillbedonwloaded hook * feat: error popup * chore: make generated pluginapi * tests * feat: different errors for different download types * feat: allow toast positions * fix: avoid using deprecated i18n function * feat: add plugin API to show toasts * feat: downloadType parameter * tests: updated tests * chore: make check-style * chore: i18n * chore: missing fields in tests * chore: sorted i18n for webapp * chore: run mmjstool * test: fixed webapp tests with new changes * test: missing mocks * fix: ensure one-file attachments (previews) are handler properly as thumbnails * chore: lint * test: added new logic to tests * chore: lint * Add SendToastMessage API and FileWillBeDownloaded hook - Introduced SendToastMessage method for sending toast notifications to users with customizable options. - Added FileWillBeDownloaded hook to handle file download requests, allowing plugins to control access to files. - Updated related types and constants for file download handling. - Enhanced PluginSettings to include HookTimeoutSeconds for better timeout management. * Update webapp/channels/src/components/single_image_view/single_image_view.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: copilot reviews * test: head requests * chore: linted the webapp * tests: fixed path * test: fixed mocked args * allow sending message to a connection directly * fix: hook thread safety * chore: formatting * chore: remove configuration from system console * chore: release version * chore: update signature * chore: update release version * chore: addressed comments * fix: update file rejection handling to use 403 Forbidden status and include rejection reason header * Fix nil pointer panic in runFileWillBeDownloadedHook The atomic.Value in runFileWillBeDownloadedHook can be nil if no plugins implement the FileWillBeDownloaded hook. This causes a panic when trying to assert the nil interface to string. This fix adds a nil check before the type assertion, defaulting to an empty string (which allows the download) when no hooks have run. Fixes: - TestUploadDataMultipart/success panic - TestUploadDataMultipart/resume_success panic * test: move the logout test last * chore: restored accidential deletion * chore: lint * chore: make generated * refactor: move websocket events to new package * chore: go vet * chore: missing mock * chore: revert incorrect fmt * chore: import ordering * chore: npm i18n-extract * chore: update constants.tsx from master * chore: make i18n-extract * revert: conflict merge * fix: add missing isFileRejected prop to SingleImageView tests * fix: mock fetch in SingleImageView tests for async thumbnail check The component now performs an async fetch to check thumbnail availability before rendering. Tests need to mock fetch and use waitFor to handle the async state updates. * refactor: move hook logic to app layer * chore: update version to 11.5 * Scope file download rejection toast to the requesting connection Thread the Connection-Id header through RunFileWillBeDownloadedHook and sendFileDownloadRejectedEvent so the WebSocket event is sent only to the connection that initiated the download, instead of all connections for the user. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-16 11:10:39 -05:00
func (hooks *hooksTimerLayer) FileWillBeDownloaded(c *Context, fileInfo *model.FileInfo, userID string, downloadType model.FileDownloadType) string {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.FileWillBeDownloaded(c, fileInfo, userID, downloadType)
hooks.recordTime(startTime, "FileWillBeDownloaded", true)
return _returnsA
}
func (hooks *hooksTimerLayer) ReactionHasBeenAdded(c *Context, reaction *model.Reaction) {
startTime := timePkg.Now()
hooks.hooksImpl.ReactionHasBeenAdded(c, reaction)
hooks.recordTime(startTime, "ReactionHasBeenAdded", true)
}
func (hooks *hooksTimerLayer) ReactionHasBeenRemoved(c *Context, reaction *model.Reaction) {
startTime := timePkg.Now()
hooks.hooksImpl.ReactionHasBeenRemoved(c, reaction)
hooks.recordTime(startTime, "ReactionHasBeenRemoved", true)
}
func (hooks *hooksTimerLayer) OnPluginClusterEvent(c *Context, ev model.PluginClusterEvent) {
startTime := timePkg.Now()
hooks.hooksImpl.OnPluginClusterEvent(c, ev)
hooks.recordTime(startTime, "OnPluginClusterEvent", true)
}
func (hooks *hooksTimerLayer) OnWebSocketConnect(webConnID, userID string) {
startTime := timePkg.Now()
hooks.hooksImpl.OnWebSocketConnect(webConnID, userID)
hooks.recordTime(startTime, "OnWebSocketConnect", true)
}
func (hooks *hooksTimerLayer) OnWebSocketDisconnect(webConnID, userID string) {
startTime := timePkg.Now()
hooks.hooksImpl.OnWebSocketDisconnect(webConnID, userID)
hooks.recordTime(startTime, "OnWebSocketDisconnect", true)
}
func (hooks *hooksTimerLayer) WebSocketMessageHasBeenPosted(webConnID, userID string, req *model.WebSocketRequest) {
startTime := timePkg.Now()
hooks.hooksImpl.WebSocketMessageHasBeenPosted(webConnID, userID, req)
hooks.recordTime(startTime, "WebSocketMessageHasBeenPosted", true)
}
func (hooks *hooksTimerLayer) RunDataRetention(nowTime, batchSize int64) (int64, error) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.RunDataRetention(nowTime, batchSize)
hooks.recordTime(startTime, "RunDataRetention", _returnsB == nil)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) OnInstall(c *Context, event model.OnInstallEvent) error {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnInstall(c, event)
hooks.recordTime(startTime, "OnInstall", _returnsA == nil)
return _returnsA
}
func (hooks *hooksTimerLayer) OnSendDailyTelemetry() {
startTime := timePkg.Now()
hooks.hooksImpl.OnSendDailyTelemetry()
hooks.recordTime(startTime, "OnSendDailyTelemetry", true)
}
func (hooks *hooksTimerLayer) OnCloudLimitsUpdated(limits *model.ProductLimits) {
startTime := timePkg.Now()
hooks.hooksImpl.OnCloudLimitsUpdated(limits)
hooks.recordTime(startTime, "OnCloudLimitsUpdated", true)
}
func (hooks *hooksTimerLayer) ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, error) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.ConfigurationWillBeSaved(newCfg)
hooks.recordTime(startTime, "ConfigurationWillBeSaved", _returnsB == nil)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) EmailNotificationWillBeSent(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.EmailNotificationWillBeSent(emailNotification)
hooks.recordTime(startTime, "EmailNotificationWillBeSent", true)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.NotificationWillBePushed(pushNotification, userID)
hooks.recordTime(startTime, "NotificationWillBePushed", true)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) UserHasBeenDeactivated(c *Context, user *model.User) {
startTime := timePkg.Now()
hooks.hooksImpl.UserHasBeenDeactivated(c, user)
hooks.recordTime(startTime, "UserHasBeenDeactivated", true)
}
func (hooks *hooksTimerLayer) ServeMetrics(c *Context, w http.ResponseWriter, r *http.Request) {
startTime := timePkg.Now()
hooks.hooksImpl.ServeMetrics(c, w, r)
hooks.recordTime(startTime, "ServeMetrics", true)
}
func (hooks *hooksTimerLayer) OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.OnSharedChannelsSyncMsg(msg, rc)
hooks.recordTime(startTime, "OnSharedChannelsSyncMsg", _returnsB == nil)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) OnSharedChannelsPing(rc *model.RemoteCluster) bool {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnSharedChannelsPing(rc)
hooks.recordTime(startTime, "OnSharedChannelsPing", true)
return _returnsA
}
func (hooks *hooksTimerLayer) PreferencesHaveChanged(c *Context, preferences []model.Preference) {
startTime := timePkg.Now()
hooks.hooksImpl.PreferencesHaveChanged(c, preferences)
hooks.recordTime(startTime, "PreferencesHaveChanged", true)
}
func (hooks *hooksTimerLayer) OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) error {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnSharedChannelsAttachmentSyncMsg(fi, post, rc)
hooks.recordTime(startTime, "OnSharedChannelsAttachmentSyncMsg", _returnsA == nil)
return _returnsA
}
func (hooks *hooksTimerLayer) OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model.RemoteCluster) error {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnSharedChannelsProfileImageSyncMsg(user, rc)
hooks.recordTime(startTime, "OnSharedChannelsProfileImageSyncMsg", _returnsA == nil)
return _returnsA
}
func (hooks *hooksTimerLayer) GenerateSupportData(c *Context) ([]*model.FileData, error) {
startTime := timePkg.Now()
_returnsA, _returnsB := hooks.hooksImpl.GenerateSupportData(c)
hooks.recordTime(startTime, "GenerateSupportData", _returnsB == nil)
return _returnsA, _returnsB
}
func (hooks *hooksTimerLayer) OnSAMLLogin(c *Context, user *model.User, assertion *saml2.AssertionInfo) error {
startTime := timePkg.Now()
_returnsA := hooks.hooksImpl.OnSAMLLogin(c, user, assertion)
hooks.recordTime(startTime, "OnSAMLLogin", _returnsA == nil)
return _returnsA
}
[MM-68655] Surface RPC errors from plugin hooks (#36414) * add WithRPCErr hooks (server-facing/internal only) * zero _returns on RPC failure in WithRPCErr companions Aligns the WithRPCErr template with the HooksRPCErr godoc contract: when g.client.Call returns a transport error, gob may have partially decoded the reply. Reassign _returns to a zero value before destructuring so callers always receive zeroed outputs alongside a non-nil transport error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * rename HooksRPCErr to HooksWithRPCErr for naming consistency Every related symbol uses the WithRPCErr suffix (MessageHasBeenPostedWithRPCErr, RunMultiPluginHookWithRPCErr, RunMultiHookWithRPCErr, etc.). Aligning the interface name removes the only outlier and makes the convention uniform. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * rename rpcErrImpl to hooksWithRPCErrImpl Mirrors the existing hooksImpl/Hooks naming pattern on hooksTimerLayer. * add supervisor.HooksWithRPCErr() and drop runtime type assertion The old path did rp.supervisor.Hooks().(HooksWithRPCErr) and handled the "doesn't implement" branch — but that branch was structurally unreachable (the compile-time `_ HooksWithRPCErr = (*hooksTimerLayer)(nil)` assertion guards it). Change supervisor.hooks from `Hooks` to the concrete `*hooksTimerLayer` (which implements both interfaces, enforced at field assignment), add a parallel HooksWithRPCErr() accessor, and call it directly. Hooks() keeps its public Hooks-interface signature via implicit conversion at return. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * drop "implemented by" clause from HooksWithRPCErr godoc Both hooksRPCClient and hooksTimerLayer satisfy the interface, and naming implementations in interface godocs adds rot — the contract is what readers need, not the list of wrappers. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 10:41:11 -04:00
func (hooks *hooksTimerLayer) OnDeactivateWithRPCErr() (error, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnDeactivateWithRPCErr()
hooks.recordTime(startTime, "OnDeactivateWithRPCErr", _returnsRPCErr == nil && _returnsA == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnConfigurationChangeWithRPCErr() (error, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnConfigurationChangeWithRPCErr()
hooks.recordTime(startTime, "OnConfigurationChangeWithRPCErr", _returnsRPCErr == nil && _returnsA == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) ExecuteCommandWithRPCErr(c *Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError, error) {
startTime := timePkg.Now()
_returnsA, _returnsB, _returnsRPCErr := hooks.hooksWithRPCErrImpl.ExecuteCommandWithRPCErr(c, args)
hooks.recordTime(startTime, "ExecuteCommandWithRPCErr", _returnsRPCErr == nil && _returnsB == nil)
return _returnsA, _returnsB, _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserHasBeenCreatedWithRPCErr(c *Context, user *model.User) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.UserHasBeenCreatedWithRPCErr(c, user)
hooks.recordTime(startTime, "UserHasBeenCreatedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserWillLogInWithRPCErr(c *Context, user *model.User) (string, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.UserWillLogInWithRPCErr(c, user)
hooks.recordTime(startTime, "UserWillLogInWithRPCErr", _returnsRPCErr == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserHasLoggedInWithRPCErr(c *Context, user *model.User) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.UserHasLoggedInWithRPCErr(c, user)
hooks.recordTime(startTime, "UserHasLoggedInWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) MessageHasBeenPostedWithRPCErr(c *Context, post *model.Post) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.MessageHasBeenPostedWithRPCErr(c, post)
hooks.recordTime(startTime, "MessageHasBeenPostedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) MessageHasBeenUpdatedWithRPCErr(c *Context, newPost, oldPost *model.Post) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.MessageHasBeenUpdatedWithRPCErr(c, newPost, oldPost)
hooks.recordTime(startTime, "MessageHasBeenUpdatedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) MessageHasBeenDeletedWithRPCErr(c *Context, post *model.Post) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.MessageHasBeenDeletedWithRPCErr(c, post)
hooks.recordTime(startTime, "MessageHasBeenDeletedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) ChannelHasBeenCreatedWithRPCErr(c *Context, channel *model.Channel) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.ChannelHasBeenCreatedWithRPCErr(c, channel)
hooks.recordTime(startTime, "ChannelHasBeenCreatedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) ChannelWillBeArchivedWithRPCErr(c *Context, channel *model.Channel) (string, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.ChannelWillBeArchivedWithRPCErr(c, channel)
hooks.recordTime(startTime, "ChannelWillBeArchivedWithRPCErr", _returnsRPCErr == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserHasJoinedChannelWithRPCErr(c *Context, channelMember *model.ChannelMember, actor *model.User) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.UserHasJoinedChannelWithRPCErr(c, channelMember, actor)
hooks.recordTime(startTime, "UserHasJoinedChannelWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserHasLeftChannelWithRPCErr(c *Context, channelMember *model.ChannelMember, actor *model.User) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.UserHasLeftChannelWithRPCErr(c, channelMember, actor)
hooks.recordTime(startTime, "UserHasLeftChannelWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserHasJoinedTeamWithRPCErr(c *Context, teamMember *model.TeamMember, actor *model.User) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.UserHasJoinedTeamWithRPCErr(c, teamMember, actor)
hooks.recordTime(startTime, "UserHasJoinedTeamWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserHasLeftTeamWithRPCErr(c *Context, teamMember *model.TeamMember, actor *model.User) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.UserHasLeftTeamWithRPCErr(c, teamMember, actor)
hooks.recordTime(startTime, "UserHasLeftTeamWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) FileWillBeDownloadedWithRPCErr(c *Context, fileInfo *model.FileInfo, userID string, downloadType model.FileDownloadType) (string, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.FileWillBeDownloadedWithRPCErr(c, fileInfo, userID, downloadType)
hooks.recordTime(startTime, "FileWillBeDownloadedWithRPCErr", _returnsRPCErr == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) ReactionHasBeenAddedWithRPCErr(c *Context, reaction *model.Reaction) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.ReactionHasBeenAddedWithRPCErr(c, reaction)
hooks.recordTime(startTime, "ReactionHasBeenAddedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) ReactionHasBeenRemovedWithRPCErr(c *Context, reaction *model.Reaction) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.ReactionHasBeenRemovedWithRPCErr(c, reaction)
hooks.recordTime(startTime, "ReactionHasBeenRemovedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnPluginClusterEventWithRPCErr(c *Context, ev model.PluginClusterEvent) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.OnPluginClusterEventWithRPCErr(c, ev)
hooks.recordTime(startTime, "OnPluginClusterEventWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnWebSocketConnectWithRPCErr(webConnID, userID string) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.OnWebSocketConnectWithRPCErr(webConnID, userID)
hooks.recordTime(startTime, "OnWebSocketConnectWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnWebSocketDisconnectWithRPCErr(webConnID, userID string) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.OnWebSocketDisconnectWithRPCErr(webConnID, userID)
hooks.recordTime(startTime, "OnWebSocketDisconnectWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) WebSocketMessageHasBeenPostedWithRPCErr(webConnID, userID string, req *model.WebSocketRequest) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.WebSocketMessageHasBeenPostedWithRPCErr(webConnID, userID, req)
hooks.recordTime(startTime, "WebSocketMessageHasBeenPostedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) RunDataRetentionWithRPCErr(nowTime, batchSize int64) (int64, error, error) {
startTime := timePkg.Now()
_returnsA, _returnsB, _returnsRPCErr := hooks.hooksWithRPCErrImpl.RunDataRetentionWithRPCErr(nowTime, batchSize)
hooks.recordTime(startTime, "RunDataRetentionWithRPCErr", _returnsRPCErr == nil && _returnsB == nil)
return _returnsA, _returnsB, _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnInstallWithRPCErr(c *Context, event model.OnInstallEvent) (error, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnInstallWithRPCErr(c, event)
hooks.recordTime(startTime, "OnInstallWithRPCErr", _returnsRPCErr == nil && _returnsA == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnSendDailyTelemetryWithRPCErr() error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.OnSendDailyTelemetryWithRPCErr()
hooks.recordTime(startTime, "OnSendDailyTelemetryWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnCloudLimitsUpdatedWithRPCErr(limits *model.ProductLimits) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.OnCloudLimitsUpdatedWithRPCErr(limits)
hooks.recordTime(startTime, "OnCloudLimitsUpdatedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) ConfigurationWillBeSavedWithRPCErr(newCfg *model.Config) (*model.Config, error, error) {
startTime := timePkg.Now()
_returnsA, _returnsB, _returnsRPCErr := hooks.hooksWithRPCErrImpl.ConfigurationWillBeSavedWithRPCErr(newCfg)
hooks.recordTime(startTime, "ConfigurationWillBeSavedWithRPCErr", _returnsRPCErr == nil && _returnsB == nil)
return _returnsA, _returnsB, _returnsRPCErr
}
func (hooks *hooksTimerLayer) EmailNotificationWillBeSentWithRPCErr(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string, error) {
startTime := timePkg.Now()
_returnsA, _returnsB, _returnsRPCErr := hooks.hooksWithRPCErrImpl.EmailNotificationWillBeSentWithRPCErr(emailNotification)
hooks.recordTime(startTime, "EmailNotificationWillBeSentWithRPCErr", _returnsRPCErr == nil)
return _returnsA, _returnsB, _returnsRPCErr
}
func (hooks *hooksTimerLayer) NotificationWillBePushedWithRPCErr(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string, error) {
startTime := timePkg.Now()
_returnsA, _returnsB, _returnsRPCErr := hooks.hooksWithRPCErrImpl.NotificationWillBePushedWithRPCErr(pushNotification, userID)
hooks.recordTime(startTime, "NotificationWillBePushedWithRPCErr", _returnsRPCErr == nil)
return _returnsA, _returnsB, _returnsRPCErr
}
func (hooks *hooksTimerLayer) UserHasBeenDeactivatedWithRPCErr(c *Context, user *model.User) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.UserHasBeenDeactivatedWithRPCErr(c, user)
hooks.recordTime(startTime, "UserHasBeenDeactivatedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnSharedChannelsSyncMsgWithRPCErr(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error, error) {
startTime := timePkg.Now()
_returnsA, _returnsB, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnSharedChannelsSyncMsgWithRPCErr(msg, rc)
hooks.recordTime(startTime, "OnSharedChannelsSyncMsgWithRPCErr", _returnsRPCErr == nil && _returnsB == nil)
return _returnsA, _returnsB, _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnSharedChannelsPingWithRPCErr(rc *model.RemoteCluster) (bool, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnSharedChannelsPingWithRPCErr(rc)
hooks.recordTime(startTime, "OnSharedChannelsPingWithRPCErr", _returnsRPCErr == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) PreferencesHaveChangedWithRPCErr(c *Context, preferences []model.Preference) error {
startTime := timePkg.Now()
_returnsRPCErr := hooks.hooksWithRPCErrImpl.PreferencesHaveChangedWithRPCErr(c, preferences)
hooks.recordTime(startTime, "PreferencesHaveChangedWithRPCErr", _returnsRPCErr == nil)
return _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnSharedChannelsAttachmentSyncMsgWithRPCErr(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) (error, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnSharedChannelsAttachmentSyncMsgWithRPCErr(fi, post, rc)
hooks.recordTime(startTime, "OnSharedChannelsAttachmentSyncMsgWithRPCErr", _returnsRPCErr == nil && _returnsA == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnSharedChannelsProfileImageSyncMsgWithRPCErr(user *model.User, rc *model.RemoteCluster) (error, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnSharedChannelsProfileImageSyncMsgWithRPCErr(user, rc)
hooks.recordTime(startTime, "OnSharedChannelsProfileImageSyncMsgWithRPCErr", _returnsRPCErr == nil && _returnsA == nil)
return _returnsA, _returnsRPCErr
}
func (hooks *hooksTimerLayer) GenerateSupportDataWithRPCErr(c *Context) ([]*model.FileData, error, error) {
startTime := timePkg.Now()
_returnsA, _returnsB, _returnsRPCErr := hooks.hooksWithRPCErrImpl.GenerateSupportDataWithRPCErr(c)
hooks.recordTime(startTime, "GenerateSupportDataWithRPCErr", _returnsRPCErr == nil && _returnsB == nil)
return _returnsA, _returnsB, _returnsRPCErr
}
func (hooks *hooksTimerLayer) OnSAMLLoginWithRPCErr(c *Context, user *model.User, assertion *saml2.AssertionInfo) (error, error) {
startTime := timePkg.Now()
_returnsA, _returnsRPCErr := hooks.hooksWithRPCErrImpl.OnSAMLLoginWithRPCErr(c, user, assertion)
hooks.recordTime(startTime, "OnSAMLLoginWithRPCErr", _returnsRPCErr == nil && _returnsA == nil)
return _returnsA, _returnsRPCErr
}