mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
* MM-68339: Add XML struct tags and multi-remote registration for shared channels plugin API (#36126) * Add XML struct tags and multi-remote registration for shared channels plugin API Phase 1: Add xml struct tags to model types used in SyncMsg (Post, User, Reaction, Status, PostAcknowledgement, FileInfo, SyncResponse, MembershipChangeMsg). Add custom MarshalXML/UnmarshalXML for SyncMsg (Users map, MentionTransforms map), StringMap, and StringInterface. Exclude Post.Metadata, PrevStatus, and server-internal FileInfo fields from XML. JSON serialization is unaffected. Phase 2: Lift the one-remote-per-plugin constraint so plugins can register multiple remotes with different SiteURLs. Add SiteURL field to RegisterPluginOpts (defaults to "plugin_<PluginID>" for backward compatibility). Add GetAllByPluginID and GetBySiteURL store methods. Rewrite registration to dedup by SiteURL instead of PluginID. Add UnregisterPluginRemoteForSharedChannels for single-remote removal with plugin ownership validation. Validate SiteURL is non-empty in RemoteCluster.IsValid. Simplify IsPlugin() to check PluginID only. (cherry picked from commita760aefcd0) * MM-68339: slugify RemoteCluster.Name in plugin registration (#36309) The new TestRegisterPluginForSharedChannels tests added in #36126 broke master CI because RegisterPluginForSharedChannels assigned opts.Displayname directly to RemoteCluster.Name, which IsValid validates against the slug regex ^[a-zA-Z0-9.\-_]+$. Display names with spaces (e.g. "legacy plugin") fail validation. The tests didn't run in the PR's final CI shard and the issue surfaced post-merge. Add CleanRemoteName to the public model, mirroring CleanTeamName and CleanUsername: lowercase, replace spaces and other disallowed characters with hyphens, trim, truncate to RemoteNameMaxLength, fall back to NewId when the result is empty. Use it in RegisterPluginForSharedChannels so Name is always slug-valid while DisplayName keeps the human-readable label. This also lets real plugins register with display names containing spaces. (cherry picked from commit078f6b31b5) * MM-68622: start inter-cluster services before plugin activation (#36366) * MM-68622: start inter-cluster services before plugin activation Move startInterClusterServices from the end of Server.Start() to the beginning, before Channels().Start() initializes plugins. This lets plugins call shared channels APIs (ShareChannel, InviteRemoteToChannel, UninviteRemoteFromChannel, UnshareChannel, UpdateSharedChannel, CheckCanInviteToSharedChannel) during OnActivate instead of failing with "Shared Channels Service is disabled". Side-effect analysis: * Plugin API gating: getSharedChannelsService in channels/app/shared_channel.go:32 only requires the service to be non-nil. The plugin-facing wrappers all pass ensureIsActive=false, so Active() is bypassed. Once SetSharedChannelService runs, calls succeed on both leader and follower nodes. This is the fix path. * Multi-node leader timing: the enterprise cluster impl in enterprise/cluster/cluster.go:70 initializes currentLeader="", so IsLeader() returns false before StartInterNodeCommunication runs. The immediate onClusterLeaderChange in scs.Start at platform/services/sharedchannel/service.go:151 therefore takes the pause path, which is a no-op since the service was never active. When memberlist.Create fires NotifyJoin for the local node, addPotentialLeader runs and InvokeClusterLeaderChangedListeners drives the registered listener to resume() the sync loop on the elected leader. End state matches the prior ordering. * Single-node: IsLeader() returns true unconditionally per channels/app/platform/cluster.go:33, so SharedChannelSyncHandler is active during plugin OnActivate. Events emitted by plugins during activation (posts to shared channels, DM creation) now flow through sync where they were previously dropped. This is intended correctness, not a regression. * Transport and handlers: api4 remote-cluster routes are registered before Server.Start, so HTTP handlers exist when rcs.Start runs early. rcs and scs do not send cluster-broadcast messages during Start; they only register topic listeners on the rcs transport, which is independent of cluster gossip. registerClusterHandlers ordering is unaffected. * Config: scs reads only ConnectedWorkspacesSettings and the License at construction, both stable from the initial config load. ReloadConfig at server.go:912 has no bearing on inter-cluster service init. Errors from startInterClusterServices remain logged and non-fatal, matching prior behavior. (cherry picked from commit4e967cb7ad) * MM-68536: Show actual remote names in system console channel list (#36298) * MM-68536: Show actual remote names in system console channel list The system console "Channels" list rendered SharedChannelIndicator without a remoteNames prop, so every shared channel showed the generic "Shared with trusted organizations" fallback even after PR 35908. Add a small connected wrapper that selects remote names via getRemoteNamesForChannel and dispatches fetchChannelRemotes on mount, mirroring the pattern used by the LHS sidebar. The shared_channel_remote_updated websocket event added in PR 35908 already refreshes the same Redux slice, so the system console list now stays in sync automatically. (cherry picked from commit15d7fbd8cb) * [MM-68697] Preserve sender file ID in plugin-relayed shared channel attachments (#36468) Set ReqFileId on the UploadSession created in ReceiveSharedChannelAttachmentSyncMsg so the attachment is persisted under the sender's file ID. Without this, the receiving server stored the bytes under a freshly generated ID while the synced post's FileIds still referenced the sender's ID, leaving the attachment invisible in the UI even though the file and FileInfo row existed on disk. Mirrors the existing cluster-to-cluster path in platform/services/sharedchannel/attachment.go. Also tightens TestPluginAPIReceiveSharedChannelAttachmentSyncMsg to pass a sender-side fi.Id and assert the saved FileInfo keeps it. The prior assertion only checked that some ID was assigned, which the buggy code also satisfied. (cherry picked from commita72b1db4c5) * MM-68705 - Order-tolerant Shared Channel plugin API's for receiving attachments (#36486) * MM-68705 - Make ReceiveSharedChannelAttachmentSyncMsg order tolerant Allow plugin remotes to invoke ReceiveSharedChannelAttachmentSyncMsg and ReceiveSharedChannelSyncMsg in either order without losing the post/file binding, and make repeat deliveries of the same file id idempotent. Two localised changes inside ReceiveSharedChannelAttachmentSyncMsg: - Idempotency check before CreateUploadSession. If a FileInfo with the sender's id already exists for the same channel and creator, return it instead of inserting a duplicate (which would violate the FileInfo PK and force the caller to retry indefinitely after any transient ack failure). A mismatched channel or creator on the same id is rejected. - Lazy bind to post after UploadData. When the matching post is already present (post-then-file ordering), CreatePost will have stripped the unmatched file id from Post.FileIds; AttachToPost plus Post.Overwrite restore the binding. When the post is not yet present (file-then-post ordering), the FileInfo is left unbound so the eventual post arrival's CreatePost path binds it. The post is fetched first because AttachToPost is a blind UPDATE that does not validate post existence, so calling it before the post exists would orphan the FileInfo. No other paths change. Cluster (non-plugin) shared-channel attachments, ReceiveSharedChannelProfileImageSyncMsg, and UI uploads are unaffected. New tests in shared_channel_test.go cover both orderings, repeated receive success and rejection on channel/creator mismatch, and the empty-PostId no-op. (cherry picked from commit5c58953e8e) * MM-68708 - Fix TestCreatePost shared DM/GM subtests when env pins feature flag (#36488) The two shared DM/GM subtests in TestCreatePost rely on FeatureFlags.EnableSharedChannelsDMs being false, but the config store reapplies MM_FEATUREFLAGS_* env overrides on every Set, so an UpdateConfig pin gets clobbered. Use t.Setenv to force the flag false for the duration of each subtest, and drop the parent's mainHelper.Parallel(t) so Go's "no Setenv under a parallel ancestor" rule is satisfied. Sibling subtests still parallelize via their own mainHelper.Parallel(t) calls. (cherry picked from commita98e01ebac) * MM-68838: Ping a restored plugin remote immediately on re-register (#36592) * MM-68838: ping restored plugin remote immediately on re-register RegisterPluginForSharedChannels' restore branch updated the row but did not call PingNow, leaving the restored remote offline until the next pingLoop tick (up to PingFreq, default 1 minute). The new-connection branch already calls PingNow; the restore branch now mirrors it so sync attempts immediately after a plugin restart no longer fail with "offline remote cluster". * MM-68838: gob-encode error returns in apiRPCServer.ReceiveSharedChannelAttachmentSyncMsg The apiRPCServer wrapper for ReceiveSharedChannelAttachmentSyncMsg assigned the hook's error return directly to the gob-encoded response struct. When the framework's App.ReceiveSharedChannelAttachmentSyncMsg returned an error wrapped with %w (*fmt.wrapError, an unexported type), gob refused to encode it and the RPC server broke the connection with "type not registered for interface: fmt.wrapError". Every subsequent plugin/server RPC call then returned the zero-value response struct, causing plugins that dereferenced the nil returns to crash. Apply the existing encodableError() helper so the returned error becomes a gob-safe ErrorString, matching every other apiRPCServer method in this file. (cherry picked from commitea7f488c64)
1709 lines
68 KiB
Go
1709 lines
68 KiB
Go
// 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"
|
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
|
)
|
|
|
|
type apiTimerLayer struct {
|
|
pluginID string
|
|
apiImpl API
|
|
metrics metricsInterface
|
|
}
|
|
|
|
func (api *apiTimerLayer) recordTime(startTime timePkg.Time, name string, success bool) {
|
|
if api.metrics != nil {
|
|
elapsedTime := float64(timePkg.Since(startTime)) / float64(timePkg.Second)
|
|
api.metrics.ObservePluginAPIDuration(api.pluginID, name, success, elapsedTime)
|
|
}
|
|
}
|
|
|
|
func (api *apiTimerLayer) LoadPluginConfiguration(dest any) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.LoadPluginConfiguration(dest)
|
|
api.recordTime(startTime, "LoadPluginConfiguration", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) RegisterCommand(command *model.Command) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RegisterCommand(command)
|
|
api.recordTime(startTime, "RegisterCommand", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UnregisterCommand(teamID, trigger string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UnregisterCommand(teamID, trigger)
|
|
api.recordTime(startTime, "UnregisterCommand", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) ExecuteSlashCommand(commandArgs *model.CommandArgs) (*model.CommandResponse, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ExecuteSlashCommand(commandArgs)
|
|
api.recordTime(startTime, "ExecuteSlashCommand", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetConfig() *model.Config {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetConfig()
|
|
api.recordTime(startTime, "GetConfig", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUnsanitizedConfig() *model.Config {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetUnsanitizedConfig()
|
|
api.recordTime(startTime, "GetUnsanitizedConfig", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) SaveConfig(config *model.Config) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SaveConfig(config)
|
|
api.recordTime(startTime, "SaveConfig", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPluginConfig() map[string]any {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetPluginConfig()
|
|
api.recordTime(startTime, "GetPluginConfig", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) SavePluginConfig(config map[string]any) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SavePluginConfig(config)
|
|
api.recordTime(startTime, "SavePluginConfig", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetBundlePath() (string, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetBundlePath()
|
|
api.recordTime(startTime, "GetBundlePath", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetLicense() *model.License {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetLicense()
|
|
api.recordTime(startTime, "GetLicense", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) IsEnterpriseReady() bool {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.IsEnterpriseReady()
|
|
api.recordTime(startTime, "IsEnterpriseReady", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetServerVersion() string {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetServerVersion()
|
|
api.recordTime(startTime, "GetServerVersion", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetSystemInstallDate() (int64, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetSystemInstallDate()
|
|
api.recordTime(startTime, "GetSystemInstallDate", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetDiagnosticId() string {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetDiagnosticId()
|
|
api.recordTime(startTime, "GetDiagnosticId", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTelemetryId() string {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetTelemetryId()
|
|
api.recordTime(startTime, "GetTelemetryId", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateUser(user *model.User) (*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateUser(user)
|
|
api.recordTime(startTime, "CreateUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteUser(userID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteUser(userID)
|
|
api.recordTime(startTime, "DeleteUser", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUsers(options)
|
|
api.recordTime(startTime, "GetUsers", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUsersByIds(userIDs []string) ([]*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUsersByIds(userIDs)
|
|
api.recordTime(startTime, "GetUsersByIds", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUser(userID string) (*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUser(userID)
|
|
api.recordTime(startTime, "GetUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUserByEmail(email string) (*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUserByEmail(email)
|
|
api.recordTime(startTime, "GetUserByEmail", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUserByUsername(name string) (*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUserByUsername(name)
|
|
api.recordTime(startTime, "GetUserByUsername", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUsersByUsernames(usernames []string) ([]*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUsersByUsernames(usernames)
|
|
api.recordTime(startTime, "GetUsersByUsernames", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUsersInTeam(teamID string, page int, perPage int) ([]*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUsersInTeam(teamID, page, perPage)
|
|
api.recordTime(startTime, "GetUsersInTeam", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPreferenceForUser(userID, category, name string) (model.Preference, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPreferenceForUser(userID, category, name)
|
|
api.recordTime(startTime, "GetPreferenceForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPreferencesForUser(userID string) ([]model.Preference, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPreferencesForUser(userID)
|
|
api.recordTime(startTime, "GetPreferencesForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdatePreferencesForUser(userID string, preferences []model.Preference) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UpdatePreferencesForUser(userID, preferences)
|
|
api.recordTime(startTime, "UpdatePreferencesForUser", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeletePreferencesForUser(userID string, preferences []model.Preference) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeletePreferencesForUser(userID, preferences)
|
|
api.recordTime(startTime, "DeletePreferencesForUser", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetSession(sessionID string) (*model.Session, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetSession(sessionID)
|
|
api.recordTime(startTime, "GetSession", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateSession(session *model.Session) (*model.Session, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateSession(session)
|
|
api.recordTime(startTime, "CreateSession", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ExtendSessionExpiry(sessionID string, newExpiry int64) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.ExtendSessionExpiry(sessionID, newExpiry)
|
|
api.recordTime(startTime, "ExtendSessionExpiry", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) RevokeSession(sessionID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RevokeSession(sessionID)
|
|
api.recordTime(startTime, "RevokeSession", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateUserAccessToken(token)
|
|
api.recordTime(startTime, "CreateUserAccessToken", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) RevokeUserAccessToken(tokenID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RevokeUserAccessToken(tokenID)
|
|
api.recordTime(startTime, "RevokeUserAccessToken", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamIcon(teamID string) ([]byte, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamIcon(teamID)
|
|
api.recordTime(startTime, "GetTeamIcon", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SetTeamIcon(teamID string, data []byte) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SetTeamIcon(teamID, data)
|
|
api.recordTime(startTime, "SetTeamIcon", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) RemoveTeamIcon(teamID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RemoveTeamIcon(teamID)
|
|
api.recordTime(startTime, "RemoveTeamIcon", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateUser(user *model.User) (*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateUser(user)
|
|
api.recordTime(startTime, "UpdateUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUserStatus(userID string) (*model.Status, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUserStatus(userID)
|
|
api.recordTime(startTime, "GetUserStatus", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUserStatusesByIds(userIds)
|
|
api.recordTime(startTime, "GetUserStatusesByIds", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateUserStatus(userID, status string) (*model.Status, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateUserStatus(userID, status)
|
|
api.recordTime(startTime, "UpdateUserStatus", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SetUserStatusTimedDND(userId string, endtime int64) (*model.Status, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SetUserStatusTimedDND(userId, endtime)
|
|
api.recordTime(startTime, "SetUserStatusTimedDND", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateUserActive(userID string, active bool) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UpdateUserActive(userID, active)
|
|
api.recordTime(startTime, "UpdateUserActive", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateUserCustomStatus(userID string, customStatus *model.CustomStatus) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UpdateUserCustomStatus(userID, customStatus)
|
|
api.recordTime(startTime, "UpdateUserCustomStatus", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) RemoveUserCustomStatus(userID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RemoveUserCustomStatus(userID)
|
|
api.recordTime(startTime, "RemoveUserCustomStatus", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUsersInChannel(channelID, sortBy string, page, perPage int) ([]*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUsersInChannel(channelID, sortBy, page, perPage)
|
|
api.recordTime(startTime, "GetUsersInChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetLDAPUserAttributes(userID string, attributes []string) (map[string]string, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetLDAPUserAttributes(userID, attributes)
|
|
api.recordTime(startTime, "GetLDAPUserAttributes", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateTeam(team *model.Team) (*model.Team, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateTeam(team)
|
|
api.recordTime(startTime, "CreateTeam", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteTeam(teamID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteTeam(teamID)
|
|
api.recordTime(startTime, "DeleteTeam", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeams() ([]*model.Team, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeams()
|
|
api.recordTime(startTime, "GetTeams", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeam(teamID string) (*model.Team, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeam(teamID)
|
|
api.recordTime(startTime, "GetTeam", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamByName(name string) (*model.Team, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamByName(name)
|
|
api.recordTime(startTime, "GetTeamByName", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamsUnreadForUser(userID)
|
|
api.recordTime(startTime, "GetTeamsUnreadForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateTeam(team)
|
|
api.recordTime(startTime, "UpdateTeam", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SearchTeams(term string) ([]*model.Team, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SearchTeams(term)
|
|
api.recordTime(startTime, "SearchTeams", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamsForUser(userID)
|
|
api.recordTime(startTime, "GetTeamsForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateTeamMember(teamID, userID)
|
|
api.recordTime(startTime, "CreateTeamMember", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateTeamMembers(teamID string, userIds []string, requestorId string) ([]*model.TeamMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateTeamMembers(teamID, userIds, requestorId)
|
|
api.recordTime(startTime, "CreateTeamMembers", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateTeamMembersGracefully(teamID string, userIds []string, requestorId string) ([]*model.TeamMemberWithError, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateTeamMembersGracefully(teamID, userIds, requestorId)
|
|
api.recordTime(startTime, "CreateTeamMembersGracefully", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteTeamMember(teamID, userID, requestorId string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteTeamMember(teamID, userID, requestorId)
|
|
api.recordTime(startTime, "DeleteTeamMember", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamMembers(teamID string, page, perPage int) ([]*model.TeamMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamMembers(teamID, page, perPage)
|
|
api.recordTime(startTime, "GetTeamMembers", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamMember(teamID, userID)
|
|
api.recordTime(startTime, "GetTeamMember", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamMembersForUser(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamMembersForUser(userID, page, perPage)
|
|
api.recordTime(startTime, "GetTeamMembersForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateTeamMemberRoles(teamID, userID, newRoles string) (*model.TeamMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateTeamMemberRoles(teamID, userID, newRoles)
|
|
api.recordTime(startTime, "UpdateTeamMemberRoles", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateChannel(channel)
|
|
api.recordTime(startTime, "CreateChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteChannel(channelId string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteChannel(channelId)
|
|
api.recordTime(startTime, "DeleteChannel", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPublicChannelsForTeam(teamID string, page, perPage int) ([]*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPublicChannelsForTeam(teamID, page, perPage)
|
|
api.recordTime(startTime, "GetPublicChannelsForTeam", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannel(channelId string) (*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannel(channelId)
|
|
api.recordTime(startTime, "GetChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelByName(teamID, name string, includeDeleted bool) (*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelByName(teamID, name, includeDeleted)
|
|
api.recordTime(startTime, "GetChannelByName", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelByNameForTeamName(teamName, channelName string, includeDeleted bool) (*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelByNameForTeamName(teamName, channelName, includeDeleted)
|
|
api.recordTime(startTime, "GetChannelByNameForTeamName", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelsForTeamForUser(teamID, userID string, includeDeleted bool) ([]*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelsForTeamForUser(teamID, userID, includeDeleted)
|
|
api.recordTime(startTime, "GetChannelsForTeamForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelStats(channelId)
|
|
api.recordTime(startTime, "GetChannelStats", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetDirectChannel(userId1, userId2)
|
|
api.recordTime(startTime, "GetDirectChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupChannel(userIds)
|
|
api.recordTime(startTime, "GetGroupChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateChannel(channel)
|
|
api.recordTime(startTime, "UpdateChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SearchChannels(teamID string, term string) ([]*model.Channel, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SearchChannels(teamID, term)
|
|
api.recordTime(startTime, "SearchChannels", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateChannelSidebarCategory(userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateChannelSidebarCategory(userID, teamID, newCategory)
|
|
api.recordTime(startTime, "CreateChannelSidebarCategory", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelSidebarCategories(userID, teamID)
|
|
api.recordTime(startTime, "GetChannelSidebarCategories", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateChannelSidebarCategories(userID, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateChannelSidebarCategories(userID, teamID, categories)
|
|
api.recordTime(startTime, "UpdateChannelSidebarCategories", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SearchUsers(search *model.UserSearch) ([]*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SearchUsers(search)
|
|
api.recordTime(startTime, "SearchUsers", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) ([]*model.Post, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SearchPostsInTeam(teamID, paramsList)
|
|
api.recordTime(startTime, "SearchPostsInTeam", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SearchPostsInTeamForUser(teamID string, userID string, searchParams model.SearchParameter) (*model.PostSearchResults, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SearchPostsInTeamForUser(teamID, userID, searchParams)
|
|
api.recordTime(startTime, "SearchPostsInTeamForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) AddChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.AddChannelMember(channelId, userID)
|
|
api.recordTime(startTime, "AddChannelMember", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) AddUserToChannel(channelId, userID, asUserId string) (*model.ChannelMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.AddUserToChannel(channelId, userID, asUserId)
|
|
api.recordTime(startTime, "AddUserToChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelMember(channelId, userID)
|
|
api.recordTime(startTime, "GetChannelMember", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelMembers(channelId string, page, perPage int) (model.ChannelMembers, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelMembers(channelId, page, perPage)
|
|
api.recordTime(startTime, "GetChannelMembers", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelMembersByIds(channelId string, userIds []string) (model.ChannelMembers, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelMembersByIds(channelId, userIds)
|
|
api.recordTime(startTime, "GetChannelMembersByIds", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetChannelMembersForUser(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetChannelMembersForUser(teamID, userID, page, perPage)
|
|
api.recordTime(startTime, "GetChannelMembersForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateChannelMemberRoles(channelId, userID, newRoles string) (*model.ChannelMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateChannelMemberRoles(channelId, userID, newRoles)
|
|
api.recordTime(startTime, "UpdateChannelMemberRoles", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateChannelMemberNotifications(channelId, userID string, notifications map[string]string) (*model.ChannelMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateChannelMemberNotifications(channelId, userID, notifications)
|
|
api.recordTime(startTime, "UpdateChannelMemberNotifications", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) PatchChannelMembersNotifications(members []*model.ChannelMemberIdentifier, notifyProps map[string]string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.PatchChannelMembersNotifications(members, notifyProps)
|
|
api.recordTime(startTime, "PatchChannelMembersNotifications", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroup(groupId string) (*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroup(groupId)
|
|
api.recordTime(startTime, "GetGroup", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupByName(name)
|
|
api.recordTime(startTime, "GetGroupByName", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupMemberUsers(groupID string, page, perPage int) ([]*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupMemberUsers(groupID, page, perPage)
|
|
api.recordTime(startTime, "GetGroupMemberUsers", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupsBySource(groupSource)
|
|
api.recordTime(startTime, "GetGroupsBySource", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupsForUser(userID string) ([]*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupsForUser(userID)
|
|
api.recordTime(startTime, "GetGroupsForUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteChannelMember(channelId, userID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteChannelMember(channelId, userID)
|
|
api.recordTime(startTime, "DeleteChannelMember", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreatePost(post *model.Post) (*model.Post, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreatePost(post)
|
|
api.recordTime(startTime, "CreatePost", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) AddReaction(reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.AddReaction(reaction)
|
|
api.recordTime(startTime, "AddReaction", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) RemoveReaction(reaction *model.Reaction) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RemoveReaction(reaction)
|
|
api.recordTime(startTime, "RemoveReaction", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetReactions(postId string) ([]*model.Reaction, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetReactions(postId)
|
|
api.recordTime(startTime, "GetReactions", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SendEphemeralPost(userID string, post *model.Post) *model.Post {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SendEphemeralPost(userID, post)
|
|
api.recordTime(startTime, "SendEphemeralPost", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateEphemeralPost(userID string, post *model.Post) *model.Post {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UpdateEphemeralPost(userID, post)
|
|
api.recordTime(startTime, "UpdateEphemeralPost", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteEphemeralPost(userID, postId string) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.DeleteEphemeralPost(userID, postId)
|
|
api.recordTime(startTime, "DeleteEphemeralPost", true)
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeletePost(postId string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeletePost(postId)
|
|
api.recordTime(startTime, "DeletePost", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPostThread(postId string) (*model.PostList, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPostThread(postId)
|
|
api.recordTime(startTime, "GetPostThread", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPost(postId string) (*model.Post, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPost(postId)
|
|
api.recordTime(startTime, "GetPost", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPostsSince(channelId, time)
|
|
api.recordTime(startTime, "GetPostsSince", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPostsAfter(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPostsAfter(channelId, postId, page, perPage)
|
|
api.recordTime(startTime, "GetPostsAfter", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPostsBefore(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPostsBefore(channelId, postId, page, perPage)
|
|
api.recordTime(startTime, "GetPostsBefore", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPostsForChannel(channelId string, page, perPage int) (*model.PostList, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPostsForChannel(channelId, page, perPage)
|
|
api.recordTime(startTime, "GetPostsForChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetTeamStats(teamID string) (*model.TeamStats, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetTeamStats(teamID)
|
|
api.recordTime(startTime, "GetTeamStats", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdatePost(post *model.Post) (*model.Post, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdatePost(post)
|
|
api.recordTime(startTime, "UpdatePost", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetProfileImage(userID string) ([]byte, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetProfileImage(userID)
|
|
api.recordTime(startTime, "GetProfileImage", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SetProfileImage(userID string, data []byte) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SetProfileImage(userID, data)
|
|
api.recordTime(startTime, "SetProfileImage", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetEmojiList(sortBy string, page, perPage int) ([]*model.Emoji, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetEmojiList(sortBy, page, perPage)
|
|
api.recordTime(startTime, "GetEmojiList", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetEmojiByName(name string) (*model.Emoji, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetEmojiByName(name)
|
|
api.recordTime(startTime, "GetEmojiByName", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetEmoji(emojiId)
|
|
api.recordTime(startTime, "GetEmoji", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CopyFileInfos(userID, fileIds)
|
|
api.recordTime(startTime, "CopyFileInfos", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetFileInfo(fileId)
|
|
api.recordTime(startTime, "GetFileInfo", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SetFileSearchableContent(fileID string, content string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SetFileSearchableContent(fileID, content)
|
|
api.recordTime(startTime, "SetFileSearchableContent", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetFileInfos(page, perPage, opt)
|
|
api.recordTime(startTime, "GetFileInfos", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetFile(fileId string) ([]byte, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetFile(fileId)
|
|
api.recordTime(startTime, "GetFile", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetFileLink(fileId string) (string, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetFileLink(fileId)
|
|
api.recordTime(startTime, "GetFileLink", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ReadFile(path string) ([]byte, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ReadFile(path)
|
|
api.recordTime(startTime, "ReadFile", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB, _returnsC := api.apiImpl.GetEmojiImage(emojiId)
|
|
api.recordTime(startTime, "GetEmojiImage", _returnsC == nil)
|
|
return _returnsA, _returnsB, _returnsC
|
|
}
|
|
|
|
func (api *apiTimerLayer) UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UploadFile(data, channelId, filename)
|
|
api.recordTime(startTime, "UploadFile", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.OpenInteractiveDialog(dialog)
|
|
api.recordTime(startTime, "OpenInteractiveDialog", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) SendToastMessage(userID, connectionID, message string, options model.SendToastMessageOptions) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SendToastMessage(userID, connectionID, message, options)
|
|
api.recordTime(startTime, "SendToastMessage", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPlugins() ([]*model.Manifest, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPlugins()
|
|
api.recordTime(startTime, "GetPlugins", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) EnablePlugin(id string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.EnablePlugin(id)
|
|
api.recordTime(startTime, "EnablePlugin", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) DisablePlugin(id string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DisablePlugin(id)
|
|
api.recordTime(startTime, "DisablePlugin", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) RemovePlugin(id string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RemovePlugin(id)
|
|
api.recordTime(startTime, "RemovePlugin", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPluginStatus(id)
|
|
api.recordTime(startTime, "GetPluginStatus", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) InstallPlugin(file io.Reader, replace bool) (*model.Manifest, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.InstallPlugin(file, replace)
|
|
api.recordTime(startTime, "InstallPlugin", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVSet(key string, value []byte) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.KVSet(key, value)
|
|
api.recordTime(startTime, "KVSet", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVCompareAndSet(key string, oldValue, newValue []byte) (bool, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.KVCompareAndSet(key, oldValue, newValue)
|
|
api.recordTime(startTime, "KVCompareAndSet", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVCompareAndDelete(key string, oldValue []byte) (bool, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.KVCompareAndDelete(key, oldValue)
|
|
api.recordTime(startTime, "KVCompareAndDelete", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.KVSetWithOptions(key, value, options)
|
|
api.recordTime(startTime, "KVSetWithOptions", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.KVSetWithExpiry(key, value, expireInSeconds)
|
|
api.recordTime(startTime, "KVSetWithExpiry", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVGet(key string) ([]byte, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.KVGet(key)
|
|
api.recordTime(startTime, "KVGet", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVDelete(key string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.KVDelete(key)
|
|
api.recordTime(startTime, "KVDelete", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVDeleteAll() *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.KVDeleteAll()
|
|
api.recordTime(startTime, "KVDeleteAll", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) KVList(page, perPage int) ([]string, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.KVList(page, perPage)
|
|
api.recordTime(startTime, "KVList", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) PublishWebSocketEvent(event string, payload map[string]any, broadcast *model.WebsocketBroadcast) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.PublishWebSocketEvent(event, payload, broadcast)
|
|
api.recordTime(startTime, "PublishWebSocketEvent", true)
|
|
}
|
|
|
|
func (api *apiTimerLayer) HasPermissionTo(userID string, permission *model.Permission) bool {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.HasPermissionTo(userID, permission)
|
|
api.recordTime(startTime, "HasPermissionTo", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) HasPermissionToTeam(userID, teamID string, permission *model.Permission) bool {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.HasPermissionToTeam(userID, teamID, permission)
|
|
api.recordTime(startTime, "HasPermissionToTeam", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) HasPermissionToChannel(userID, channelId string, permission *model.Permission) bool {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.HasPermissionToChannel(userID, channelId, permission)
|
|
api.recordTime(startTime, "HasPermissionToChannel", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) RolesGrantPermission(roleNames []string, permissionId string) bool {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RolesGrantPermission(roleNames, permissionId)
|
|
api.recordTime(startTime, "RolesGrantPermission", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) LogDebug(msg string, keyValuePairs ...any) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.LogDebug(msg, keyValuePairs...)
|
|
api.recordTime(startTime, "LogDebug", true)
|
|
}
|
|
|
|
func (api *apiTimerLayer) LogInfo(msg string, keyValuePairs ...any) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.LogInfo(msg, keyValuePairs...)
|
|
api.recordTime(startTime, "LogInfo", true)
|
|
}
|
|
|
|
func (api *apiTimerLayer) LogError(msg string, keyValuePairs ...any) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.LogError(msg, keyValuePairs...)
|
|
api.recordTime(startTime, "LogError", true)
|
|
}
|
|
|
|
func (api *apiTimerLayer) LogWarn(msg string, keyValuePairs ...any) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.LogWarn(msg, keyValuePairs...)
|
|
api.recordTime(startTime, "LogWarn", true)
|
|
}
|
|
|
|
func (api *apiTimerLayer) SendMail(to, subject, htmlBody string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SendMail(to, subject, htmlBody)
|
|
api.recordTime(startTime, "SendMail", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateBot(bot)
|
|
api.recordTime(startTime, "CreateBot", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.PatchBot(botUserId, botPatch)
|
|
api.recordTime(startTime, "PatchBot", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetBot(botUserId, includeDeleted)
|
|
api.recordTime(startTime, "GetBot", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetBots(options)
|
|
api.recordTime(startTime, "GetBots", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateBotActive(botUserId, active)
|
|
api.recordTime(startTime, "UpdateBotActive", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) PermanentDeleteBot(botUserId string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.PermanentDeleteBot(botUserId)
|
|
api.recordTime(startTime, "PermanentDeleteBot", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) PluginHTTP(request *http.Request) *http.Response {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.PluginHTTP(request)
|
|
api.recordTime(startTime, "PluginHTTP", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) PublishUserTyping(userID, channelId, parentId string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.PublishUserTyping(userID, channelId, parentId)
|
|
api.recordTime(startTime, "PublishUserTyping", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateCommand(cmd *model.Command) (*model.Command, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateCommand(cmd)
|
|
api.recordTime(startTime, "CreateCommand", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ListCommands(teamID string) ([]*model.Command, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ListCommands(teamID)
|
|
api.recordTime(startTime, "ListCommands", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ListCustomCommands(teamID string) ([]*model.Command, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ListCustomCommands(teamID)
|
|
api.recordTime(startTime, "ListCustomCommands", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ListPluginCommands(teamID string) ([]*model.Command, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ListPluginCommands(teamID)
|
|
api.recordTime(startTime, "ListPluginCommands", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ListBuiltInCommands() ([]*model.Command, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ListBuiltInCommands()
|
|
api.recordTime(startTime, "ListBuiltInCommands", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetCommand(commandID string) (*model.Command, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetCommand(commandID)
|
|
api.recordTime(startTime, "GetCommand", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateCommand(commandID string, updatedCmd *model.Command) (*model.Command, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateCommand(commandID, updatedCmd)
|
|
api.recordTime(startTime, "UpdateCommand", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteCommand(commandID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteCommand(commandID)
|
|
api.recordTime(startTime, "DeleteCommand", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateOAuthApp(app)
|
|
api.recordTime(startTime, "CreateOAuthApp", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetOAuthApp(appID)
|
|
api.recordTime(startTime, "GetOAuthApp", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateOAuthApp(app)
|
|
api.recordTime(startTime, "UpdateOAuthApp", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteOAuthApp(appID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteOAuthApp(appID)
|
|
api.recordTime(startTime, "DeleteOAuthApp", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) PublishPluginClusterEvent(ev model.PluginClusterEvent, opts model.PluginClusterEventSendOptions) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.PublishPluginClusterEvent(ev, opts)
|
|
api.recordTime(startTime, "PublishPluginClusterEvent", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RequestTrialLicense(requesterID, users, termsAccepted, receiveEmailsAccepted)
|
|
api.recordTime(startTime, "RequestTrialLicense", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetCloudLimits() (*model.ProductLimits, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetCloudLimits()
|
|
api.recordTime(startTime, "GetCloudLimits", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) EnsureBotUser(bot *model.Bot) (string, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.EnsureBotUser(bot)
|
|
api.recordTime(startTime, "EnsureBotUser", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) RegisterCollectionAndTopic(collectionType, topicType string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.RegisterCollectionAndTopic(collectionType, topicType)
|
|
api.recordTime(startTime, "RegisterCollectionAndTopic", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateUploadSession(us *model.UploadSession) (*model.UploadSession, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateUploadSession(us)
|
|
api.recordTime(startTime, "CreateUploadSession", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInfo, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UploadData(us, rd)
|
|
api.recordTime(startTime, "UploadData", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetUploadSession(uploadID string) (*model.UploadSession, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetUploadSession(uploadID)
|
|
api.recordTime(startTime, "GetUploadSession", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) SendPushNotification(notification *model.PushNotification, userID string) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SendPushNotification(notification, userID)
|
|
api.recordTime(startTime, "SendPushNotification", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateUserAuth(userID, userAuth)
|
|
api.recordTime(startTime, "UpdateUserAuth", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.RegisterPluginForSharedChannels(opts)
|
|
api.recordTime(startTime, "RegisterPluginForSharedChannels", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UnregisterPluginForSharedChannels(pluginID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UnregisterPluginForSharedChannels(pluginID)
|
|
api.recordTime(startTime, "UnregisterPluginForSharedChannels", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UnregisterPluginRemoteForSharedChannels(remoteID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UnregisterPluginRemoteForSharedChannels(remoteID)
|
|
api.recordTime(startTime, "UnregisterPluginRemoteForSharedChannels", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ShareChannel(sc)
|
|
api.recordTime(startTime, "ShareChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateSharedChannel(sc)
|
|
api.recordTime(startTime, "UpdateSharedChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UnshareChannel(channelID string) (unshared bool, err error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UnshareChannel(channelID)
|
|
api.recordTime(startTime, "UnshareChannel", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UpdateSharedChannelCursor(channelID, remoteID, cusror)
|
|
api.recordTime(startTime, "UpdateSharedChannelCursor", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) SyncSharedChannel(channelID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.SyncSharedChannel(channelID)
|
|
api.recordTime(startTime, "SyncSharedChannel", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) InviteRemoteToChannel(channelID string, remoteID string, userID string, shareIfNotShared bool) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.InviteRemoteToChannel(channelID, remoteID, userID, shareIfNotShared)
|
|
api.recordTime(startTime, "InviteRemoteToChannel", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UninviteRemoteFromChannel(channelID string, remoteID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.UninviteRemoteFromChannel(channelID, remoteID)
|
|
api.recordTime(startTime, "UninviteRemoteFromChannel", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) ReceiveSharedChannelSyncMsg(remoteID string, msg *model.SyncMsg) (model.SyncResponse, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ReceiveSharedChannelSyncMsg(remoteID, msg)
|
|
api.recordTime(startTime, "ReceiveSharedChannelSyncMsg", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ReceiveSharedChannelAttachmentSyncMsg(remoteID, channelID string, fi *model.FileInfo, data io.Reader) (*model.FileInfo, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.ReceiveSharedChannelAttachmentSyncMsg(remoteID, channelID, fi, data)
|
|
api.recordTime(startTime, "ReceiveSharedChannelAttachmentSyncMsg", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) ReceiveSharedChannelProfileImageSyncMsg(remoteID, userID string, image []byte) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.ReceiveSharedChannelProfileImageSyncMsg(remoteID, userID, image)
|
|
api.recordTime(startTime, "ReceiveSharedChannelProfileImageSyncMsg", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpsertGroupMember(groupID, userID)
|
|
api.recordTime(startTime, "UpsertGroupMember", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpsertGroupMembers(groupID string, userIDs []string) ([]*model.GroupMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpsertGroupMembers(groupID, userIDs)
|
|
api.recordTime(startTime, "UpsertGroupMembers", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupByRemoteID(remoteID, groupSource)
|
|
api.recordTime(startTime, "GetGroupByRemoteID", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateGroup(group *model.Group) (*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreateGroup(group)
|
|
api.recordTime(startTime, "CreateGroup", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateGroup(group *model.Group) (*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateGroup(group)
|
|
api.recordTime(startTime, "UpdateGroup", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteGroup(groupID string) (*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.DeleteGroup(groupID)
|
|
api.recordTime(startTime, "DeleteGroup", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) RestoreGroup(groupID string) (*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.RestoreGroup(groupID)
|
|
api.recordTime(startTime, "RestoreGroup", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.DeleteGroupMember(groupID, userID)
|
|
api.recordTime(startTime, "DeleteGroupMember", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupSyncable(groupID, syncableID, syncableType)
|
|
api.recordTime(startTime, "GetGroupSyncable", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroupSyncables(groupID, syncableType)
|
|
api.recordTime(startTime, "GetGroupSyncables", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpsertGroupSyncable(groupSyncable)
|
|
api.recordTime(startTime, "UpsertGroupSyncable", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateGroupSyncable(groupSyncable)
|
|
api.recordTime(startTime, "UpdateGroupSyncable", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.DeleteGroupSyncable(groupID, syncableID, syncableType)
|
|
api.recordTime(startTime, "DeleteGroupSyncable", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdateUserRoles(userID, newRoles string) (*model.User, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdateUserRoles(userID, newRoles)
|
|
api.recordTime(startTime, "UpdateUserRoles", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPluginID() string {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.GetPluginID()
|
|
api.recordTime(startTime, "GetPluginID", true)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetGroups(page, perPage int, opts model.GroupSearchOpts, viewRestrictions *model.ViewUsersRestrictions) ([]*model.Group, *model.AppError) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetGroups(page, perPage, opts, viewRestrictions)
|
|
api.recordTime(startTime, "GetGroups", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreateDefaultSyncableMemberships(params model.CreateDefaultMembershipParams) *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.CreateDefaultSyncableMemberships(params)
|
|
api.recordTime(startTime, "CreateDefaultSyncableMemberships", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeleteGroupConstrainedMemberships() *model.AppError {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeleteGroupConstrainedMemberships()
|
|
api.recordTime(startTime, "DeleteGroupConstrainedMemberships", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreatePropertyField(field *model.PropertyField) (*model.PropertyField, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreatePropertyField(field)
|
|
api.recordTime(startTime, "CreatePropertyField", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPropertyField(groupID, fieldID string) (*model.PropertyField, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPropertyField(groupID, fieldID)
|
|
api.recordTime(startTime, "GetPropertyField", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPropertyFields(groupID string, ids []string) ([]*model.PropertyField, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPropertyFields(groupID, ids)
|
|
api.recordTime(startTime, "GetPropertyFields", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdatePropertyField(groupID string, field *model.PropertyField) (*model.PropertyField, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdatePropertyField(groupID, field)
|
|
api.recordTime(startTime, "UpdatePropertyField", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeletePropertyField(groupID, fieldID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeletePropertyField(groupID, fieldID)
|
|
api.recordTime(startTime, "DeletePropertyField", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) SearchPropertyFields(groupID string, opts model.PropertyFieldSearchOpts) ([]*model.PropertyField, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SearchPropertyFields(groupID, opts)
|
|
api.recordTime(startTime, "SearchPropertyFields", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CountPropertyFields(groupID string, includeDeleted bool) (int64, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CountPropertyFields(groupID, includeDeleted)
|
|
api.recordTime(startTime, "CountPropertyFields", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CountPropertyFieldsForTarget(groupID, targetType, targetID string, includeDeleted bool) (int64, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CountPropertyFieldsForTarget(groupID, targetType, targetID, includeDeleted)
|
|
api.recordTime(startTime, "CountPropertyFieldsForTarget", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) CreatePropertyValue(value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.CreatePropertyValue(value)
|
|
api.recordTime(startTime, "CreatePropertyValue", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPropertyValue(groupID, valueID string) (*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPropertyValue(groupID, valueID)
|
|
api.recordTime(startTime, "GetPropertyValue", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPropertyValues(groupID string, ids []string) ([]*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPropertyValues(groupID, ids)
|
|
api.recordTime(startTime, "GetPropertyValues", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdatePropertyValue(groupID string, value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdatePropertyValue(groupID, value)
|
|
api.recordTime(startTime, "UpdatePropertyValue", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpsertPropertyValue(value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpsertPropertyValue(value)
|
|
api.recordTime(startTime, "UpsertPropertyValue", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeletePropertyValue(groupID, valueID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeletePropertyValue(groupID, valueID)
|
|
api.recordTime(startTime, "DeletePropertyValue", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) SearchPropertyValues(groupID string, opts model.PropertyValueSearchOpts) ([]*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.SearchPropertyValues(groupID, opts)
|
|
api.recordTime(startTime, "SearchPropertyValues", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) RegisterPropertyGroup(name string) (*model.PropertyGroup, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.RegisterPropertyGroup(name)
|
|
api.recordTime(startTime, "RegisterPropertyGroup", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPropertyGroup(name string) (*model.PropertyGroup, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPropertyGroup(name)
|
|
api.recordTime(startTime, "GetPropertyGroup", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) GetPropertyFieldByName(groupID, targetID, name string) (*model.PropertyField, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.GetPropertyFieldByName(groupID, targetID, name)
|
|
api.recordTime(startTime, "GetPropertyFieldByName", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdatePropertyFields(groupID string, fields []*model.PropertyField) ([]*model.PropertyField, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdatePropertyFields(groupID, fields)
|
|
api.recordTime(startTime, "UpdatePropertyFields", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpdatePropertyValues(groupID string, values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpdatePropertyValues(groupID, values)
|
|
api.recordTime(startTime, "UpdatePropertyValues", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) UpsertPropertyValues(values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
|
startTime := timePkg.Now()
|
|
_returnsA, _returnsB := api.apiImpl.UpsertPropertyValues(values)
|
|
api.recordTime(startTime, "UpsertPropertyValues", _returnsB == nil)
|
|
return _returnsA, _returnsB
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeletePropertyValuesForTarget(groupID, targetType, targetID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeletePropertyValuesForTarget(groupID, targetType, targetID)
|
|
api.recordTime(startTime, "DeletePropertyValuesForTarget", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) DeletePropertyValuesForField(groupID, fieldID string) error {
|
|
startTime := timePkg.Now()
|
|
_returnsA := api.apiImpl.DeletePropertyValuesForField(groupID, fieldID)
|
|
api.recordTime(startTime, "DeletePropertyValuesForField", _returnsA == nil)
|
|
return _returnsA
|
|
}
|
|
|
|
func (api *apiTimerLayer) LogAuditRec(rec *model.AuditRecord) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.LogAuditRec(rec)
|
|
api.recordTime(startTime, "LogAuditRec", true)
|
|
}
|
|
|
|
func (api *apiTimerLayer) LogAuditRecWithLevel(rec *model.AuditRecord, level mlog.Level) {
|
|
startTime := timePkg.Now()
|
|
api.apiImpl.LogAuditRecWithLevel(rec, level)
|
|
api.recordTime(startTime, "LogAuditRecWithLevel", true)
|
|
}
|