Documentation
¶
Overview ¶
The plugin package is used by Mattermost server plugins written in go. It also enables the Mattermost server to manage and interact with the running plugin environment.
Note that this package exports a large number of types prefixed with Z_. These are public only to allow their use with Hashicorp's go-plugin (and net/rpc). Do not use these directly.
Example (HelloWorld) ¶
This example demonstrates a plugin that handles HTTP requests which respond by greeting the world.
package main
import (
"fmt"
"net/http"
"github.com/mattermost/mattermost/server/public/plugin"
)
// HelloWorldPlugin implements the interface expected by the Mattermost server to communicate
// between the server and plugin processes.
type HelloWorldPlugin struct {
plugin.MattermostPlugin
}
// ServeHTTP demonstrates a plugin that handles HTTP requests by greeting the world.
func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, world!")
}
// This example demonstrates a plugin that handles HTTP requests which respond by greeting the
// world.
func main() {
plugin.ClientMain(&HelloWorldPlugin{})
}
Output:
Example (HelpPlugin) ¶
package main
import (
"strings"
"sync"
"github.com/pkg/errors"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/public/plugin"
)
// configuration represents the configuration for this plugin as exposed via the Mattermost
// server configuration.
type configuration struct {
TeamName string
ChannelName string
// channelID is resolved when the public configuration fields above change
channelID string
}
// HelpPlugin implements the interface expected by the Mattermost server to communicate
// between the server and plugin processes.
type HelpPlugin struct {
plugin.MattermostPlugin
// configurationLock synchronizes access to the configuration.
configurationLock sync.RWMutex
// configuration is the active plugin configuration. Consult getConfiguration and
// setConfiguration for usage.
configuration *configuration
}
// getConfiguration retrieves the active configuration under lock, making it safe to use
// concurrently. The active configuration may change underneath the client of this method, but
// the struct returned by this API call is considered immutable.
func (p *HelpPlugin) getConfiguration() *configuration {
p.configurationLock.RLock()
defer p.configurationLock.RUnlock()
if p.configuration == nil {
return &configuration{}
}
return p.configuration
}
// setConfiguration replaces the active configuration under lock.
//
// Do not call setConfiguration while holding the configurationLock, as sync.Mutex is not
// reentrant.
func (p *HelpPlugin) setConfiguration(configuration *configuration) {
// Replace the active configuration under lock.
p.configurationLock.Lock()
defer p.configurationLock.Unlock()
p.configuration = configuration
}
// OnConfigurationChange updates the active configuration for this plugin under lock.
func (p *HelpPlugin) OnConfigurationChange() error {
var configuration = new(configuration)
// Load the public configuration fields from the Mattermost server configuration.
if err := p.API.LoadPluginConfiguration(configuration); err != nil {
return errors.Wrap(err, "failed to load plugin configuration")
}
team, err := p.API.GetTeamByName(configuration.TeamName)
if err != nil {
return errors.Wrapf(err, "failed to find team %s", configuration.TeamName)
}
channel, err := p.API.GetChannelByName(team.Id, configuration.ChannelName, false)
if err != nil {
return errors.Wrapf(err, "failed to find channel %s", configuration.ChannelName)
}
configuration.channelID = channel.Id
p.setConfiguration(configuration)
return nil
}
// MessageHasBeenPosted automatically replies to posts that plea for help.
func (p *HelpPlugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) {
configuration := p.getConfiguration()
// Ignore posts not in the configured channel
if post.ChannelId != configuration.channelID {
return
}
// Ignore posts this plugin made.
if sentByPlugin, _ := post.GetProp("sent_by_plugin").(bool); sentByPlugin {
return
}
// Ignore posts without a plea for help.
if !strings.Contains(post.Message, "help") {
return
}
p.API.SendEphemeralPost(post.UserId, &model.Post{
ChannelId: configuration.channelID,
Message: "You asked for help? Checkout https://support.mattermost.com/hc/en-us",
Props: map[string]any{
"sent_by_plugin": true,
},
})
}
func main() {
plugin.ClientMain(&HelpPlugin{})
}
Output:
Index ¶
- Constants
- Variables
- func ClientMain(pluginImplementation any, opts ...func(config *plugin.ServeConfig) error)
- func MakeAuditRecord(event string, initialStatus string) *model.AuditRecord
- func MakeAuditRecordWithContext(event string, initialStatus string, ctx *Context, userId, apiPath string) *model.AuditRecord
- func WithExecutableFromManifest(pluginInfo *model.BundleInfo) func(*supervisor, *plugin.ClientConfig) error
- func WithReattachConfig(pluginReattachConfig *model.PluginReattachConfig) func(*supervisor, *plugin.ClientConfig) error
- func WithTestCloseCh(closeCh chan<- struct{}) func(*plugin.ServeConfig) error
- func WithTestContext(ctx context.Context) func(*plugin.ServeConfig) error
- func WithTestReattachConfigCh(reattachConfigCh chan<- *plugin.ReattachConfig) func(*plugin.ServeConfig) error
- type API
- type AppDriver
- type Context
- type Driver
- type Environment
- func (env *Environment) Activate(id string) (manifest *model.Manifest, activated bool, reterr error)
- func (env *Environment) Active() []*model.BundleInfo
- func (env *Environment) Available() ([]*model.BundleInfo, error)
- func (env *Environment) ClearTransitionallyPrepackagedPlugins()
- func (env *Environment) Deactivate(id string) bool
- func (env *Environment) GetManifest(pluginId string) (*model.Manifest, error)
- func (env *Environment) GetPluginHealthCheckJob() *PluginHealthCheckJob
- func (env *Environment) GetPluginState(id string) int
- func (env *Environment) HooksForPlugin(id string) (Hooks, error)
- func (env *Environment) HooksForPluginWithRPCErr(id string) (HooksWithRPCErr, error)
- func (env *Environment) IsActive(id string) bool
- func (env *Environment) PerformHealthCheck(id string) error
- func (env *Environment) PrepackagedPlugins() []*PrepackagedPlugin
- func (env *Environment) PublicFilesPath(id string) (string, error)
- func (env *Environment) Reattach(manifest *model.Manifest, pluginReattachConfig *model.PluginReattachConfig) (reterr error)
- func (env *Environment) RemovePlugin(id string)
- func (env *Environment) RestartPlugin(id string) error
- func (env *Environment) RunMultiPluginHook(hookRunnerFunc func(hooks Hooks, manifest *model.Manifest) bool, hookId int)
- func (env *Environment) RunMultiPluginHookExcluding(excludePluginIDs []string, ...)
- func (env *Environment) RunMultiPluginHookWithRPCErr(...) error
- func (env *Environment) SetPluginError(id string, err string)
- func (env *Environment) SetPrepackagedPlugins(plugins, transitionalPlugins []*PrepackagedPlugin)
- func (env *Environment) Shutdown()
- func (env *Environment) Statuses() (model.PluginStatuses, error)
- func (env *Environment) TogglePluginHealthCheckJob(enable bool)
- func (env *Environment) TransitionallyPrepackagedPlugins() []*PrepackagedPlugin
- func (env *Environment) UnpackWebappBundle(id string) (*model.Manifest, error)
- type ErrorString
- type HTTPRequestSubset
- type Hooks
- type HooksWithRPCErr
- type HooksWithRPCErrGenerated
- type MattermostPlugin
- type PluginHealthCheckJob
- type PrepackagedPlugin
- type ResultContainer
- type Z_AddChannelMemberArgs
- type Z_AddChannelMemberReturns
- type Z_AddReactionArgs
- type Z_AddReactionReturns
- type Z_AddUserToChannelArgs
- type Z_AddUserToChannelReturns
- type Z_ChannelHasBeenCreatedArgs
- type Z_ChannelHasBeenCreatedReturns
- type Z_ChannelMemberWillBeAddedArgs
- type Z_ChannelMemberWillBeAddedReturns
- type Z_ChannelWillBeArchivedArgs
- type Z_ChannelWillBeArchivedReturns
- type Z_ChannelWillBeRestoredArgs
- type Z_ChannelWillBeRestoredReturns
- type Z_ChannelWillBeUpdatedArgs
- type Z_ChannelWillBeUpdatedReturns
- type Z_ConfigurationWillBeSavedArgs
- type Z_ConfigurationWillBeSavedReturns
- type Z_CopyFileInfosArgs
- type Z_CopyFileInfosReturns
- type Z_CountPropertyFieldsArgs
- type Z_CountPropertyFieldsForTargetArgs
- type Z_CountPropertyFieldsForTargetReturns
- type Z_CountPropertyFieldsReturns
- type Z_CreateBotArgs
- type Z_CreateBotReturns
- type Z_CreateChannelArgs
- type Z_CreateChannelReturns
- type Z_CreateChannelSidebarCategoryArgs
- type Z_CreateChannelSidebarCategoryReturns
- type Z_CreateCommandArgs
- type Z_CreateCommandReturns
- type Z_CreateDefaultSyncableMembershipsArgs
- type Z_CreateDefaultSyncableMembershipsReturns
- type Z_CreateGroupArgs
- type Z_CreateGroupReturns
- type Z_CreateOAuthAppArgs
- type Z_CreateOAuthAppReturns
- type Z_CreatePostArgs
- type Z_CreatePostReturns
- type Z_CreatePropertyFieldArgs
- type Z_CreatePropertyFieldReturns
- type Z_CreatePropertyValueArgs
- type Z_CreatePropertyValueReturns
- type Z_CreateSessionArgs
- type Z_CreateSessionReturns
- type Z_CreateTeamArgs
- type Z_CreateTeamMemberArgs
- type Z_CreateTeamMemberReturns
- type Z_CreateTeamMembersArgs
- type Z_CreateTeamMembersGracefullyArgs
- type Z_CreateTeamMembersGracefullyReturns
- type Z_CreateTeamMembersReturns
- type Z_CreateTeamReturns
- type Z_CreateUploadSessionArgs
- type Z_CreateUploadSessionReturns
- type Z_CreateUserAccessTokenArgs
- type Z_CreateUserAccessTokenReturns
- type Z_CreateUserArgs
- type Z_CreateUserReturns
- type Z_DbBoolReturn
- type Z_DbConnArgs
- type Z_DbErrReturn
- type Z_DbInt64ErrReturn
- type Z_DbIntReturn
- type Z_DbResultContErrReturn
- type Z_DbRowScanArg
- type Z_DbRowScanReturn
- type Z_DbRowsColumnArg
- type Z_DbRowsColumnTypePrecisionScaleReturn
- type Z_DbStmtArgs
- type Z_DbStmtQueryArgs
- type Z_DbStrErrReturn
- type Z_DbStrSliceReturn
- type Z_DbTxArgs
- type Z_DeleteChannelArgs
- type Z_DeleteChannelMemberArgs
- type Z_DeleteChannelMemberReturns
- type Z_DeleteChannelReturns
- type Z_DeleteCommandArgs
- type Z_DeleteCommandReturns
- type Z_DeleteEphemeralPostArgs
- type Z_DeleteEphemeralPostReturns
- type Z_DeleteGroupArgs
- type Z_DeleteGroupConstrainedMembershipsArgs
- type Z_DeleteGroupConstrainedMembershipsReturns
- type Z_DeleteGroupMemberArgs
- type Z_DeleteGroupMemberReturns
- type Z_DeleteGroupReturns
- type Z_DeleteGroupSyncableArgs
- type Z_DeleteGroupSyncableReturns
- type Z_DeleteOAuthAppArgs
- type Z_DeleteOAuthAppReturns
- type Z_DeletePostArgs
- type Z_DeletePostReturns
- type Z_DeletePreferencesForUserArgs
- type Z_DeletePreferencesForUserReturns
- type Z_DeletePropertyFieldArgs
- type Z_DeletePropertyFieldReturns
- type Z_DeletePropertyValueArgs
- type Z_DeletePropertyValueReturns
- type Z_DeletePropertyValuesForFieldArgs
- type Z_DeletePropertyValuesForFieldReturns
- type Z_DeletePropertyValuesForTargetArgs
- type Z_DeletePropertyValuesForTargetReturns
- type Z_DeleteTeamArgs
- type Z_DeleteTeamMemberArgs
- type Z_DeleteTeamMemberReturns
- type Z_DeleteTeamReturns
- type Z_DeleteUserArgs
- type Z_DeleteUserReturns
- type Z_DisablePluginArgs
- type Z_DisablePluginReturns
- type Z_DraftWillBeUpsertedArgs
- type Z_DraftWillBeUpsertedReturns
- type Z_EmailNotificationWillBeSentArgs
- type Z_EmailNotificationWillBeSentReturns
- type Z_EnablePluginArgs
- type Z_EnablePluginReturns
- type Z_EnsureBotUserArgs
- type Z_EnsureBotUserReturns
- type Z_ExecuteCommandArgs
- type Z_ExecuteCommandReturns
- type Z_ExecuteSlashCommandArgs
- type Z_ExecuteSlashCommandReturns
- type Z_ExtendSessionExpiryArgs
- type Z_ExtendSessionExpiryReturns
- type Z_FileWillBeDownloadedArgs
- type Z_FileWillBeDownloadedReturns
- type Z_FileWillBeUploadedArgs
- type Z_FileWillBeUploadedReturns
- type Z_GenerateSupportDataArgs
- type Z_GenerateSupportDataReturns
- type Z_GetBotArgs
- type Z_GetBotReturns
- type Z_GetBotsArgs
- type Z_GetBotsReturns
- type Z_GetBundlePathArgs
- type Z_GetBundlePathReturns
- type Z_GetChannelArgs
- type Z_GetChannelByNameArgs
- type Z_GetChannelByNameForTeamNameArgs
- type Z_GetChannelByNameForTeamNameReturns
- type Z_GetChannelByNameReturns
- type Z_GetChannelMemberArgs
- type Z_GetChannelMemberReturns
- type Z_GetChannelMembersArgs
- type Z_GetChannelMembersByIdsArgs
- type Z_GetChannelMembersByIdsReturns
- type Z_GetChannelMembersForUserArgs
- type Z_GetChannelMembersForUserReturns
- type Z_GetChannelMembersReturns
- type Z_GetChannelReturns
- type Z_GetChannelSidebarCategoriesArgs
- type Z_GetChannelSidebarCategoriesReturns
- type Z_GetChannelStatsArgs
- type Z_GetChannelStatsReturns
- type Z_GetChannelsForTeamForUserArgs
- type Z_GetChannelsForTeamForUserReturns
- type Z_GetCloudLimitsArgs
- type Z_GetCloudLimitsReturns
- type Z_GetCommandArgs
- type Z_GetCommandReturns
- type Z_GetConfigArgs
- type Z_GetConfigReturns
- type Z_GetDiagnosticIdArgs
- type Z_GetDiagnosticIdReturns
- type Z_GetDirectChannelArgs
- type Z_GetDirectChannelReturns
- type Z_GetEmojiArgs
- type Z_GetEmojiByNameArgs
- type Z_GetEmojiByNameReturns
- type Z_GetEmojiImageArgs
- type Z_GetEmojiImageReturns
- type Z_GetEmojiListArgs
- type Z_GetEmojiListReturns
- type Z_GetEmojiReturns
- type Z_GetFileArgs
- type Z_GetFileInfoArgs
- type Z_GetFileInfoReturns
- type Z_GetFileInfosArgs
- type Z_GetFileInfosReturns
- type Z_GetFileLinkArgs
- type Z_GetFileLinkReturns
- type Z_GetFileReturns
- type Z_GetGroupArgs
- type Z_GetGroupByNameArgs
- type Z_GetGroupByNameReturns
- type Z_GetGroupByRemoteIDArgs
- type Z_GetGroupByRemoteIDReturns
- type Z_GetGroupChannelArgs
- type Z_GetGroupChannelReturns
- type Z_GetGroupMemberUsersArgs
- type Z_GetGroupMemberUsersReturns
- type Z_GetGroupReturns
- type Z_GetGroupSyncableArgs
- type Z_GetGroupSyncableReturns
- type Z_GetGroupSyncablesArgs
- type Z_GetGroupSyncablesReturns
- type Z_GetGroupsArgs
- type Z_GetGroupsBySourceArgs
- type Z_GetGroupsBySourceReturns
- type Z_GetGroupsForUserArgs
- type Z_GetGroupsForUserReturns
- type Z_GetGroupsReturns
- type Z_GetLDAPUserAttributesArgs
- type Z_GetLDAPUserAttributesReturns
- type Z_GetLicenseArgs
- type Z_GetLicenseReturns
- type Z_GetOAuthAppArgs
- type Z_GetOAuthAppReturns
- type Z_GetPluginConfigArgs
- type Z_GetPluginConfigReturns
- type Z_GetPluginIDArgs
- type Z_GetPluginIDReturns
- type Z_GetPluginStatusArgs
- type Z_GetPluginStatusReturns
- type Z_GetPluginsArgs
- type Z_GetPluginsReturns
- type Z_GetPostArgs
- type Z_GetPostReturns
- type Z_GetPostThreadArgs
- type Z_GetPostThreadReturns
- type Z_GetPostsAfterArgs
- type Z_GetPostsAfterReturns
- type Z_GetPostsBeforeArgs
- type Z_GetPostsBeforeReturns
- type Z_GetPostsForChannelArgs
- type Z_GetPostsForChannelReturns
- type Z_GetPostsSinceArgs
- type Z_GetPostsSinceReturns
- type Z_GetPreferenceForUserArgs
- type Z_GetPreferenceForUserReturns
- type Z_GetPreferencesForUserArgs
- type Z_GetPreferencesForUserReturns
- type Z_GetProfileImageArgs
- type Z_GetProfileImageReturns
- type Z_GetPropertyFieldArgs
- type Z_GetPropertyFieldByNameArgs
- type Z_GetPropertyFieldByNameReturns
- type Z_GetPropertyFieldReturns
- type Z_GetPropertyFieldsArgs
- type Z_GetPropertyFieldsReturns
- type Z_GetPropertyGroupArgs
- type Z_GetPropertyGroupReturns
- type Z_GetPropertyValueArgs
- type Z_GetPropertyValueReturns
- type Z_GetPropertyValuesArgs
- type Z_GetPropertyValuesReturns
- type Z_GetPublicChannelsForTeamArgs
- type Z_GetPublicChannelsForTeamReturns
- type Z_GetReactionsArgs
- type Z_GetReactionsReturns
- type Z_GetServerVersionArgs
- type Z_GetServerVersionReturns
- type Z_GetSessionArgs
- type Z_GetSessionReturns
- type Z_GetSystemInstallDateArgs
- type Z_GetSystemInstallDateReturns
- type Z_GetTeamArgs
- type Z_GetTeamByNameArgs
- type Z_GetTeamByNameReturns
- type Z_GetTeamIconArgs
- type Z_GetTeamIconReturns
- type Z_GetTeamMemberArgs
- type Z_GetTeamMemberReturns
- type Z_GetTeamMembersArgs
- type Z_GetTeamMembersForUserArgs
- type Z_GetTeamMembersForUserReturns
- type Z_GetTeamMembersReturns
- type Z_GetTeamReturns
- type Z_GetTeamStatsArgs
- type Z_GetTeamStatsReturns
- type Z_GetTeamsArgs
- type Z_GetTeamsForUserArgs
- type Z_GetTeamsForUserReturns
- type Z_GetTeamsReturns
- type Z_GetTeamsUnreadForUserArgs
- type Z_GetTeamsUnreadForUserReturns
- type Z_GetTelemetryIdArgs
- type Z_GetTelemetryIdReturns
- type Z_GetUnsanitizedConfigArgs
- type Z_GetUnsanitizedConfigReturns
- type Z_GetUploadSessionArgs
- type Z_GetUploadSessionReturns
- type Z_GetUserArgs
- type Z_GetUserByEmailArgs
- type Z_GetUserByEmailReturns
- type Z_GetUserByUsernameArgs
- type Z_GetUserByUsernameReturns
- type Z_GetUserReturns
- type Z_GetUserStatusArgs
- type Z_GetUserStatusReturns
- type Z_GetUserStatusesByIdsArgs
- type Z_GetUserStatusesByIdsReturns
- type Z_GetUsersArgs
- type Z_GetUsersByIdsArgs
- type Z_GetUsersByIdsReturns
- type Z_GetUsersByUsernamesArgs
- type Z_GetUsersByUsernamesReturns
- type Z_GetUsersInChannelArgs
- type Z_GetUsersInChannelReturns
- type Z_GetUsersInTeamArgs
- type Z_GetUsersInTeamReturns
- type Z_GetUsersReturns
- type Z_HasPermissionToArgs
- type Z_HasPermissionToChannelArgs
- type Z_HasPermissionToChannelReturns
- type Z_HasPermissionToReturns
- type Z_HasPermissionToTeamArgs
- type Z_HasPermissionToTeamReturns
- type Z_InstallPluginArgs
- type Z_InstallPluginReturns
- type Z_InviteRemoteToChannelArgs
- type Z_InviteRemoteToChannelReturns
- type Z_IsEnterpriseReadyArgs
- type Z_IsEnterpriseReadyReturns
- type Z_KVCompareAndDeleteArgs
- type Z_KVCompareAndDeleteReturns
- type Z_KVCompareAndSetArgs
- type Z_KVCompareAndSetReturns
- type Z_KVDeleteAllArgs
- type Z_KVDeleteAllReturns
- type Z_KVDeleteArgs
- type Z_KVDeleteReturns
- type Z_KVGetArgs
- type Z_KVGetReturns
- type Z_KVListArgs
- type Z_KVListReturns
- type Z_KVSetArgs
- type Z_KVSetReturns
- type Z_KVSetWithExpiryArgs
- type Z_KVSetWithExpiryReturns
- type Z_KVSetWithOptionsArgs
- type Z_KVSetWithOptionsReturns
- type Z_ListBuiltInCommandsArgs
- type Z_ListBuiltInCommandsReturns
- type Z_ListCommandsArgs
- type Z_ListCommandsReturns
- type Z_ListCustomCommandsArgs
- type Z_ListCustomCommandsReturns
- type Z_ListPluginCommandsArgs
- type Z_ListPluginCommandsReturns
- type Z_LoadPluginConfigurationArgsArgs
- type Z_LoadPluginConfigurationArgsReturns
- type Z_LogAuditRecArgs
- type Z_LogAuditRecReturns
- type Z_LogAuditRecWithLevelArgs
- type Z_LogAuditRecWithLevelReturns
- type Z_LogDebugArgs
- type Z_LogDebugReturns
- type Z_LogErrorArgs
- type Z_LogErrorReturns
- type Z_LogInfoArgs
- type Z_LogInfoReturns
- type Z_LogWarnArgs
- type Z_LogWarnReturns
- type Z_MessageHasBeenDeletedArgs
- type Z_MessageHasBeenDeletedReturns
- type Z_MessageHasBeenPostedArgs
- type Z_MessageHasBeenPostedReturns
- type Z_MessageHasBeenUpdatedArgs
- type Z_MessageHasBeenUpdatedReturns
- type Z_MessageWillBePostedArgs
- type Z_MessageWillBePostedReturns
- type Z_MessageWillBeUpdatedArgs
- type Z_MessageWillBeUpdatedReturns
- type Z_MessagesWillBeConsumedArgs
- type Z_MessagesWillBeConsumedReturns
- type Z_NotificationWillBePushedArgs
- type Z_NotificationWillBePushedReturns
- type Z_OnActivateArgs
- type Z_OnActivateReturns
- type Z_OnCloudLimitsUpdatedArgs
- type Z_OnCloudLimitsUpdatedReturns
- type Z_OnConfigurationChangeArgs
- type Z_OnConfigurationChangeReturns
- type Z_OnDeactivateArgs
- type Z_OnDeactivateReturns
- type Z_OnInstallArgs
- type Z_OnInstallReturns
- type Z_OnPluginClusterEventArgs
- type Z_OnPluginClusterEventReturns
- type Z_OnSAMLLoginArgs
- type Z_OnSAMLLoginReturns
- type Z_OnSendDailyTelemetryArgs
- type Z_OnSendDailyTelemetryReturns
- type Z_OnSharedChannelsAttachmentSyncMsgArgs
- type Z_OnSharedChannelsAttachmentSyncMsgReturns
- type Z_OnSharedChannelsPingArgs
- type Z_OnSharedChannelsPingReturns
- type Z_OnSharedChannelsProfileImageSyncMsgArgs
- type Z_OnSharedChannelsProfileImageSyncMsgReturns
- type Z_OnSharedChannelsSyncMsgArgs
- type Z_OnSharedChannelsSyncMsgReturns
- type Z_OnWebSocketConnectArgs
- type Z_OnWebSocketConnectReturns
- type Z_OnWebSocketDisconnectArgs
- type Z_OnWebSocketDisconnectReturns
- type Z_OpenInteractiveDialogArgs
- type Z_OpenInteractiveDialogReturns
- type Z_PatchBotArgs
- type Z_PatchBotReturns
- type Z_PatchChannelMembersNotificationsArgs
- type Z_PatchChannelMembersNotificationsReturns
- type Z_PermanentDeleteBotArgs
- type Z_PermanentDeleteBotReturns
- type Z_PluginHTTPArgs
- type Z_PluginHTTPReturns
- type Z_PluginHTTPStreamArgs
- type Z_PluginHTTPStreamReturns
- type Z_PreferencesHaveChangedArgs
- type Z_PreferencesHaveChangedReturns
- type Z_PublishPluginClusterEventArgs
- type Z_PublishPluginClusterEventReturns
- type Z_PublishUserTypingArgs
- type Z_PublishUserTypingReturns
- type Z_PublishWebSocketEventArgs
- type Z_PublishWebSocketEventReturns
- type Z_ReactionHasBeenAddedArgs
- type Z_ReactionHasBeenAddedReturns
- type Z_ReactionHasBeenRemovedArgs
- type Z_ReactionHasBeenRemovedReturns
- type Z_ReadFileArgs
- type Z_ReadFileReturns
- type Z_ReceiveSharedChannelAttachmentSyncMsgArgs
- type Z_ReceiveSharedChannelAttachmentSyncMsgReturns
- type Z_ReceiveSharedChannelProfileImageSyncMsgArgs
- type Z_ReceiveSharedChannelProfileImageSyncMsgReturns
- type Z_ReceiveSharedChannelSyncMsgArgs
- type Z_ReceiveSharedChannelSyncMsgReturns
- type Z_RegisterChannelGuardArgs
- type Z_RegisterChannelGuardReturns
- type Z_RegisterCollectionAndTopicArgs
- type Z_RegisterCollectionAndTopicReturns
- type Z_RegisterCommandArgs
- type Z_RegisterCommandReturns
- type Z_RegisterPluginForSharedChannelsArgs
- type Z_RegisterPluginForSharedChannelsReturns
- type Z_RegisterPropertyGroupArgs
- type Z_RegisterPropertyGroupReturns
- type Z_RemovePluginArgs
- type Z_RemovePluginReturns
- type Z_RemoveReactionArgs
- type Z_RemoveReactionReturns
- type Z_RemoveTeamIconArgs
- type Z_RemoveTeamIconReturns
- type Z_RemoveUserCustomStatusArgs
- type Z_RemoveUserCustomStatusReturns
- type Z_RequestTrialLicenseArgs
- type Z_RequestTrialLicenseReturns
- type Z_RestoreGroupArgs
- type Z_RestoreGroupReturns
- type Z_RevokeSessionArgs
- type Z_RevokeSessionReturns
- type Z_RevokeUserAccessTokenArgs
- type Z_RevokeUserAccessTokenReturns
- type Z_RolesGrantPermissionArgs
- type Z_RolesGrantPermissionReturns
- type Z_RunDataRetentionArgs
- type Z_RunDataRetentionReturns
- type Z_SaveConfigArgs
- type Z_SaveConfigReturns
- type Z_SavePluginConfigArgs
- type Z_SavePluginConfigReturns
- type Z_ScheduledPostWillBeCreatedArgs
- type Z_ScheduledPostWillBeCreatedReturns
- type Z_SearchChannelsArgs
- type Z_SearchChannelsReturns
- type Z_SearchPostsInTeamArgs
- type Z_SearchPostsInTeamForUserArgs
- type Z_SearchPostsInTeamForUserReturns
- type Z_SearchPostsInTeamReturns
- type Z_SearchPropertyFieldsArgs
- type Z_SearchPropertyFieldsReturns
- type Z_SearchPropertyValuesArgs
- type Z_SearchPropertyValuesReturns
- type Z_SearchTeamsArgs
- type Z_SearchTeamsReturns
- type Z_SearchUsersArgs
- type Z_SearchUsersReturns
- type Z_SendEphemeralPostArgs
- type Z_SendEphemeralPostReturns
- type Z_SendMailArgs
- type Z_SendMailReturns
- type Z_SendPushNotificationArgs
- type Z_SendPushNotificationReturns
- type Z_SendToastMessageArgs
- type Z_SendToastMessageReturns
- type Z_ServeHTTPArgs
- type Z_ServeMetricsArgs
- type Z_SetFileSearchableContentArgs
- type Z_SetFileSearchableContentReturns
- type Z_SetProfileImageArgs
- type Z_SetProfileImageReturns
- type Z_SetTeamIconArgs
- type Z_SetTeamIconReturns
- type Z_SetUserStatusTimedDNDArgs
- type Z_SetUserStatusTimedDNDReturns
- type Z_ShareChannelArgs
- type Z_ShareChannelReturns
- type Z_SyncSharedChannelArgs
- type Z_SyncSharedChannelReturns
- type Z_TeamMemberWillBeAddedArgs
- type Z_TeamMemberWillBeAddedReturns
- type Z_UninviteRemoteFromChannelArgs
- type Z_UninviteRemoteFromChannelReturns
- type Z_UnregisterChannelGuardArgs
- type Z_UnregisterChannelGuardReturns
- type Z_UnregisterCommandArgs
- type Z_UnregisterCommandReturns
- type Z_UnregisterPluginForSharedChannelsArgs
- type Z_UnregisterPluginForSharedChannelsReturns
- type Z_UnregisterPluginRemoteForSharedChannelsArgs
- type Z_UnregisterPluginRemoteForSharedChannelsReturns
- type Z_UnshareChannelArgs
- type Z_UnshareChannelReturns
- type Z_UpdateBotActiveArgs
- type Z_UpdateBotActiveReturns
- type Z_UpdateChannelArgs
- type Z_UpdateChannelMemberNotificationsArgs
- type Z_UpdateChannelMemberNotificationsReturns
- type Z_UpdateChannelMemberRolesArgs
- type Z_UpdateChannelMemberRolesReturns
- type Z_UpdateChannelReturns
- type Z_UpdateChannelSidebarCategoriesArgs
- type Z_UpdateChannelSidebarCategoriesReturns
- type Z_UpdateCommandArgs
- type Z_UpdateCommandReturns
- type Z_UpdateEphemeralPostArgs
- type Z_UpdateEphemeralPostReturns
- type Z_UpdateGroupArgs
- type Z_UpdateGroupReturns
- type Z_UpdateGroupSyncableArgs
- type Z_UpdateGroupSyncableReturns
- type Z_UpdateOAuthAppArgs
- type Z_UpdateOAuthAppReturns
- type Z_UpdatePostArgs
- type Z_UpdatePostReturns
- type Z_UpdatePreferencesForUserArgs
- type Z_UpdatePreferencesForUserReturns
- type Z_UpdatePropertyFieldArgs
- type Z_UpdatePropertyFieldReturns
- type Z_UpdatePropertyFieldsArgs
- type Z_UpdatePropertyFieldsReturns
- type Z_UpdatePropertyValueArgs
- type Z_UpdatePropertyValueReturns
- type Z_UpdatePropertyValuesArgs
- type Z_UpdatePropertyValuesReturns
- type Z_UpdateSharedChannelArgs
- type Z_UpdateSharedChannelCursorArgs
- type Z_UpdateSharedChannelCursorReturns
- type Z_UpdateSharedChannelReturns
- type Z_UpdateTeamArgs
- type Z_UpdateTeamMemberRolesArgs
- type Z_UpdateTeamMemberRolesReturns
- type Z_UpdateTeamReturns
- type Z_UpdateUserActiveArgs
- type Z_UpdateUserActiveReturns
- type Z_UpdateUserArgs
- type Z_UpdateUserAuthArgs
- type Z_UpdateUserAuthReturns
- type Z_UpdateUserCustomStatusArgs
- type Z_UpdateUserCustomStatusReturns
- type Z_UpdateUserReturns
- type Z_UpdateUserRolesArgs
- type Z_UpdateUserRolesReturns
- type Z_UpdateUserStatusArgs
- type Z_UpdateUserStatusReturns
- type Z_UploadDataArgs
- type Z_UploadDataReturns
- type Z_UploadFileArgs
- type Z_UploadFileReturns
- type Z_UpsertGroupMemberArgs
- type Z_UpsertGroupMemberReturns
- type Z_UpsertGroupMembersArgs
- type Z_UpsertGroupMembersReturns
- type Z_UpsertGroupSyncableArgs
- type Z_UpsertGroupSyncableReturns
- type Z_UpsertPropertyValueArgs
- type Z_UpsertPropertyValueReturns
- type Z_UpsertPropertyValuesArgs
- type Z_UpsertPropertyValuesReturns
- type Z_UserHasBeenCreatedArgs
- type Z_UserHasBeenCreatedReturns
- type Z_UserHasBeenDeactivatedArgs
- type Z_UserHasBeenDeactivatedReturns
- type Z_UserHasJoinedChannelArgs
- type Z_UserHasJoinedChannelReturns
- type Z_UserHasJoinedTeamArgs
- type Z_UserHasJoinedTeamReturns
- type Z_UserHasLeftChannelArgs
- type Z_UserHasLeftChannelReturns
- type Z_UserHasLeftTeamArgs
- type Z_UserHasLeftTeamReturns
- type Z_UserHasLoggedInArgs
- type Z_UserHasLoggedInReturns
- type Z_UserWillLogInArgs
- type Z_UserWillLogInReturns
- type Z_WebSocketMessageHasBeenPostedArgs
- type Z_WebSocketMessageHasBeenPostedReturns
Examples ¶
Constants ¶
const ( InternalKeyPrefix = "mmi_" BotUserKey = InternalKeyPrefix + "botid" )
const ( HealthCheckInterval = 30 * time.Second // How often the health check should run HealthCheckDeactivationWindow = 60 * time.Minute // How long we wait for num fails to occur before deactivating the plugin HealthCheckPingFailLimit = 3 // How many times we call RPC ping in a row before it is considered a failure HealthCheckNumRestartsLimit = 3 // How many times we restart a plugin before we deactivate it )
const ( OnActivateID = 0 OnDeactivateID = 1 ServeHTTPID = 2 OnConfigurationChangeID = 3 ExecuteCommandID = 4 MessageWillBePostedID = 5 MessageWillBeUpdatedID = 6 MessageHasBeenPostedID = 7 MessageHasBeenUpdatedID = 8 UserHasJoinedChannelID = 9 UserHasLeftChannelID = 10 UserHasJoinedTeamID = 11 UserHasLeftTeamID = 12 ChannelHasBeenCreatedID = 13 FileWillBeUploadedID = 14 UserWillLogInID = 15 UserHasLoggedInID = 16 UserHasBeenCreatedID = 17 ReactionHasBeenAddedID = 18 ReactionHasBeenRemovedID = 19 OnPluginClusterEventID = 20 OnWebSocketConnectID = 21 OnWebSocketDisconnectID = 22 WebSocketMessageHasBeenPostedID = 23 RunDataRetentionID = 24 OnInstallID = 25 OnSendDailyTelemetryID = 26 OnCloudLimitsUpdatedID = 27 ConfigurationWillBeSavedID = 34 NotificationWillBePushedID = 35 UserHasBeenDeactivatedID = 36 MessageHasBeenDeletedID = 37 MessagesWillBeConsumedID = 38 ServeMetricsID = 39 PreferencesHaveChangedID = 42 GenerateSupportDataID = 45 OnSAMLLoginID = 46 EmailNotificationWillBeSentID = 47 FileWillBeDownloadedID = 48 ChannelMemberWillBeAddedID = 49 TeamMemberWillBeAddedID = 50 ChannelWillBeArchivedID = 51 ChannelWillBeUpdatedID = 52 ChannelWillBeRestoredID = 53 ScheduledPostWillBeCreatedID = 54 DraftWillBeUpsertedID = 55 TotalHooksID = iota )
These assignments are part of the wire protocol used to trigger hook events in plugins.
Feel free to add more, but do not change existing assignments. Follow the naming convention of <HookName>ID as the autogenerated glue code depends on that.
const (
// DismissPostError dismisses a pending post when the error is returned from MessageWillBePosted.
DismissPostError = "plugin.message_will_be_posted.dismiss_post"
)
Variables ¶
var ( ErrNotHijacked = errors.New("response is not hijacked") ErrAlreadyHijacked = errors.New("response was already hijacked") ErrCannotHijack = errors.New("response cannot be hijacked") )
var ErrNotFound = errors.New("Item not found")
Functions ¶
func ClientMain ¶
func ClientMain(pluginImplementation any, opts ...func(config *plugin.ServeConfig) error)
Starts the serving of a Mattermost plugin over net/rpc. gRPC is not supported.
Call this when your plugin is ready to start. Options allow configuring plugins for testing scenarios.
func MakeAuditRecord ¶ added in v0.1.16
func MakeAuditRecord(event string, initialStatus string) *model.AuditRecord
MakeAuditRecord creates a new audit record with basic information for plugin use. This function creates a minimal audit record that can be populated with additional data. Use this when you don't have access to request context or want to manually populate fields.
func MakeAuditRecordWithContext ¶ added in v0.1.16
func MakeAuditRecordWithContext(event string, initialStatus string, ctx *Context, userId, apiPath string) *model.AuditRecord
MakeAuditRecordWithContext creates a new audit record populated with plugin context information. This is the recommended way for plugins to create audit records when they have request context. The Context should come from plugin hook parameters or HTTP request handlers.
func WithExecutableFromManifest ¶ added in v0.0.18
func WithExecutableFromManifest(pluginInfo *model.BundleInfo) func(*supervisor, *plugin.ClientConfig) error
func WithReattachConfig ¶ added in v0.0.18
func WithReattachConfig(pluginReattachConfig *model.PluginReattachConfig) func(*supervisor, *plugin.ClientConfig) error
func WithTestCloseCh ¶ added in v0.0.18
func WithTestCloseCh(closeCh chan<- struct{}) func(*plugin.ServeConfig) error
WithTestCloseCh provides a channel that signals when the plugin exits.
func WithTestContext ¶ added in v0.0.18
func WithTestContext(ctx context.Context) func(*plugin.ServeConfig) error
WithTestContext provides a context typically used to terminate a plugin from a unit test.
func WithTestReattachConfigCh ¶ added in v0.0.18
func WithTestReattachConfigCh(reattachConfigCh chan<- *plugin.ReattachConfig) func(*plugin.ServeConfig) error
WithTestReattachConfigCh configures the channel to receive the ReattachConfig used to reattach an externally launched plugin instance with the Mattermost server.
Types ¶
type API ¶
type API interface {
// LoadPluginConfiguration loads the plugin's configuration. dest should be a pointer to a
// struct that the configuration JSON can be unmarshalled to.
//
// @tag Plugin
// Minimum server version: 5.2
LoadPluginConfiguration(dest any) error
// RegisterCommand registers a custom slash command. When the command is triggered, your plugin
// can fulfill it via the ExecuteCommand hook.
//
// @tag Command
// Minimum server version: 5.2
RegisterCommand(command *model.Command) error
// UnregisterCommand unregisters a command previously register via RegisterCommand.
//
// @tag Command
// Minimum server version: 5.2
UnregisterCommand(teamID, trigger string) error
// ExecuteSlashCommand executes a slash command with the given parameters.
//
// @tag Command
// Minimum server version: 5.26
ExecuteSlashCommand(commandArgs *model.CommandArgs) (*model.CommandResponse, error)
// GetConfig fetches the currently persisted config
//
// @tag Configuration
// Minimum server version: 5.2
GetConfig() *model.Config
// GetUnsanitizedConfig fetches the currently persisted config without removing secrets.
//
// @tag Configuration
// Minimum server version: 5.16
GetUnsanitizedConfig() *model.Config
// SaveConfig sets the given config and persists the changes
//
// @tag Configuration
// Minimum server version: 5.2
SaveConfig(config *model.Config) *model.AppError
// GetPluginConfig fetches the currently persisted config of plugin
//
// @tag Plugin
// Minimum server version: 5.6
GetPluginConfig() map[string]any
// SavePluginConfig sets the given config for plugin and persists the changes
//
// @tag Plugin
// Minimum server version: 5.6
SavePluginConfig(config map[string]any) *model.AppError
// GetBundlePath returns the absolute path where the plugin's bundle was unpacked.
//
// @tag Plugin
// Minimum server version: 5.10
GetBundlePath() (string, error)
// GetLicense returns the current license used by the Mattermost server. Returns nil if
// the server does not have a license.
//
// @tag Server
// Minimum server version: 5.10
GetLicense() *model.License
// IsEnterpriseReady returns true if the Mattermost server is configured as Enterprise Ready.
//
// @tag Server
// Minimum server version: 5.10
IsEnterpriseReady() bool
// GetServerVersion return the current Mattermost server version
//
// @tag Server
// Minimum server version: 5.4
GetServerVersion() string
// GetSystemInstallDate returns the time that Mattermost was first installed and ran.
//
// @tag Server
// Minimum server version: 5.10
GetSystemInstallDate() (int64, *model.AppError)
// GetDiagnosticId returns a unique identifier used by the server for diagnostic reports.
//
// @tag Server
// Minimum server version: 5.10
GetDiagnosticId() string
// GetTelemetryId returns a unique identifier used by the server for telemetry reports.
//
// @tag Server
// Minimum server version: 5.28
GetTelemetryId() string
// CreateUser creates a user.
//
// @tag User
// Minimum server version: 5.2
CreateUser(user *model.User) (*model.User, *model.AppError)
// DeleteUser deletes a user.
//
// @tag User
// Minimum server version: 5.2
DeleteUser(userID string) *model.AppError
// GetUsers a list of users based on search options.
//
// Not all fields in UserGetOptions are supported by this API.
//
// @tag User
// Minimum server version: 5.10
GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError)
// GetUsersByIds gets a list of users by their IDs.
//
// @tag User
// Minimum server version: 9.8
GetUsersByIds(userIDs []string) ([]*model.User, *model.AppError)
// GetUser gets a user.
//
// @tag User
// Minimum server version: 5.2
GetUser(userID string) (*model.User, *model.AppError)
// GetUserByEmail gets a user by their email address.
//
// @tag User
// Minimum server version: 5.2
GetUserByEmail(email string) (*model.User, *model.AppError)
// GetUserByUsername gets a user by their username.
//
// @tag User
// Minimum server version: 5.2
GetUserByUsername(name string) (*model.User, *model.AppError)
// GetUsersByUsernames gets users by their usernames.
//
// @tag User
// Minimum server version: 5.6
GetUsersByUsernames(usernames []string) ([]*model.User, *model.AppError)
// GetUsersInTeam gets users in team.
//
// @tag User
// @tag Team
// Minimum server version: 5.6
GetUsersInTeam(teamID string, page int, perPage int) ([]*model.User, *model.AppError)
// GetPreferenceForUser gets a single preference for a user. An error is returned if the user has no preference
// set with the given category and name, an error is returned.
//
// @tag User
// @tag Preference
// Minimum server version: 9.5
GetPreferenceForUser(userID, category, name string) (model.Preference, *model.AppError)
// GetPreferencesForUser gets a user's preferences.
//
// @tag User
// @tag Preference
// Minimum server version: 5.26
GetPreferencesForUser(userID string) ([]model.Preference, *model.AppError)
// UpdatePreferencesForUser updates a user's preferences.
//
// @tag User
// @tag Preference
// Minimum server version: 5.26
UpdatePreferencesForUser(userID string, preferences []model.Preference) *model.AppError
// DeletePreferencesForUser deletes a user's preferences.
//
// @tag User
// @tag Preference
// Minimum server version: 5.26
DeletePreferencesForUser(userID string, preferences []model.Preference) *model.AppError
// GetSession returns the session object for the Session ID
//
//
// Minimum server version: 5.2
GetSession(sessionID string) (*model.Session, *model.AppError)
// CreateSession creates a new user session.
//
// @tag User
// Minimum server version: 6.2
CreateSession(session *model.Session) (*model.Session, *model.AppError)
// ExtendSessionExpiry extends the duration of an existing session.
//
// @tag User
// Minimum server version: 6.2
ExtendSessionExpiry(sessionID string, newExpiry int64) *model.AppError
// RevokeSession revokes an existing user session.
//
// @tag User
// Minimum server version: 6.2
RevokeSession(sessionID string) *model.AppError
// CreateUserAccessToken creates a new access token.
// @tag User
// Minimum server version: 5.38
CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError)
// RevokeUserAccessToken revokes an existing access token.
// @tag User
// Minimum server version: 5.38
RevokeUserAccessToken(tokenID string) *model.AppError
// GetTeamIcon gets the team icon.
//
// @tag Team
// Minimum server version: 5.6
GetTeamIcon(teamID string) ([]byte, *model.AppError)
// SetTeamIcon sets the team icon.
//
// @tag Team
// Minimum server version: 5.6
SetTeamIcon(teamID string, data []byte) *model.AppError
// RemoveTeamIcon removes the team icon.
//
// @tag Team
// Minimum server version: 5.6
RemoveTeamIcon(teamID string) *model.AppError
// UpdateUser updates a user.
//
// @tag User
// Minimum server version: 5.2
UpdateUser(user *model.User) (*model.User, *model.AppError)
// GetUserStatus will get a user's status.
//
// @tag User
// Minimum server version: 5.2
GetUserStatus(userID string) (*model.Status, *model.AppError)
// GetUserStatusesByIds will return a list of user statuses based on the provided slice of user IDs.
//
// @tag User
// Minimum server version: 5.2
GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError)
// UpdateUserStatus will set a user's status until the user, or another integration/plugin, sets it back to online.
// The status parameter can be: "online", "away", "dnd", or "offline".
//
// @tag User
// Minimum server version: 5.2
UpdateUserStatus(userID, status string) (*model.Status, *model.AppError)
// SetUserStatusTimedDND will set a user's status to dnd for given time until the user,
// or another integration/plugin, sets it back to online.
// @tag User
// Minimum server version: 5.35
SetUserStatusTimedDND(userId string, endtime int64) (*model.Status, *model.AppError)
// UpdateUserActive deactivates or reactivates an user.
//
// @tag User
// Minimum server version: 5.8
UpdateUserActive(userID string, active bool) *model.AppError
// UpdateUserCustomStatus will set a user's custom status until the user, or another integration/plugin, clear it or update the custom status.
// The custom status have two parameters: emoji icon and custom text.
//
// @tag User
// Minimum server version: 6.2
UpdateUserCustomStatus(userID string, customStatus *model.CustomStatus) *model.AppError
// RemoveUserCustomStatus will remove a user's custom status.
//
// @tag User
// Minimum server version: 6.2
RemoveUserCustomStatus(userID string) *model.AppError
// GetUsersInChannel returns a page of users in a channel. Page counting starts at 0.
// The sortBy parameter can be: "username" or "status".
//
// @tag User
// @tag Channel
// Minimum server version: 5.6
GetUsersInChannel(channelID, sortBy string, page, perPage int) ([]*model.User, *model.AppError)
// GetLDAPUserAttributes will return LDAP attributes for a user.
// The attributes parameter should be a list of attributes to pull.
// Returns a map with attribute names as keys and the user's attributes as values.
// Requires an enterprise license, LDAP to be configured and for the user to use LDAP as an authentication method.
//
// @tag User
// Minimum server version: 5.3
GetLDAPUserAttributes(userID string, attributes []string) (map[string]string, *model.AppError)
// CreateTeam creates a team.
//
// @tag Team
// Minimum server version: 5.2
CreateTeam(team *model.Team) (*model.Team, *model.AppError)
// DeleteTeam deletes a team.
//
// @tag Team
// Minimum server version: 5.2
DeleteTeam(teamID string) *model.AppError
// GetTeam gets all teams.
//
// @tag Team
// Minimum server version: 5.2
GetTeams() ([]*model.Team, *model.AppError)
// GetTeam gets a team.
//
// @tag Team
// Minimum server version: 5.2
GetTeam(teamID string) (*model.Team, *model.AppError)
// GetTeamByName gets a team by its name.
//
// @tag Team
// Minimum server version: 5.2
GetTeamByName(name string) (*model.Team, *model.AppError)
// GetTeamsUnreadForUser gets the unread message and mention counts for each team to which the given user belongs.
//
// @tag Team
// @tag User
// Minimum server version: 5.6
GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model.AppError)
// UpdateTeam updates a team.
//
// @tag Team
// Minimum server version: 5.2
UpdateTeam(team *model.Team) (*model.Team, *model.AppError)
// SearchTeams search a team.
//
// @tag Team
// Minimum server version: 5.8
SearchTeams(term string) ([]*model.Team, *model.AppError)
// GetTeamsForUser returns list of teams of given user ID.
//
// @tag Team
// @tag User
// Minimum server version: 5.6
GetTeamsForUser(userID string) ([]*model.Team, *model.AppError)
// CreateTeamMember creates a team membership.
//
// @tag Team
// @tag User
// Minimum server version: 5.2
CreateTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError)
// CreateTeamMembers creates a team membership for all provided user ids.
//
// @tag Team
// @tag User
// Minimum server version: 5.2
CreateTeamMembers(teamID string, userIds []string, requestorId string) ([]*model.TeamMember, *model.AppError)
// CreateTeamMembersGracefully creates a team membership for all provided user ids and reports the users that were not added.
//
// @tag Team
// @tag User
// Minimum server version: 5.20
CreateTeamMembersGracefully(teamID string, userIds []string, requestorId string) ([]*model.TeamMemberWithError, *model.AppError)
// DeleteTeamMember deletes a team membership.
//
// @tag Team
// @tag User
// Minimum server version: 5.2
DeleteTeamMember(teamID, userID, requestorId string) *model.AppError
// GetTeamMembers returns the memberships of a specific team.
//
// @tag Team
// @tag User
// Minimum server version: 5.2
GetTeamMembers(teamID string, page, perPage int) ([]*model.TeamMember, *model.AppError)
// GetTeamMember returns a specific membership.
//
// @tag Team
// @tag User
// Minimum server version: 5.2
GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError)
// GetTeamMembersForUser returns all team memberships for a user.
//
// @tag Team
// @tag User
// Minimum server version: 5.10
GetTeamMembersForUser(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError)
// UpdateTeamMemberRoles updates the role for a team membership.
//
// @tag Team
// @tag User
// Minimum server version: 5.2
UpdateTeamMemberRoles(teamID, userID, newRoles string) (*model.TeamMember, *model.AppError)
// CreateChannel creates a channel.
//
// @tag Channel
// Minimum server version: 5.2
CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
// DeleteChannel deletes a channel.
//
// @tag Channel
// Minimum server version: 5.2
DeleteChannel(channelId string) *model.AppError
// GetPublicChannelsForTeam gets a list of all channels.
//
// @tag Channel
// @tag Team
// Minimum server version: 5.2
GetPublicChannelsForTeam(teamID string, page, perPage int) ([]*model.Channel, *model.AppError)
// GetChannel gets a channel.
//
// @tag Channel
// Minimum server version: 5.2
GetChannel(channelId string) (*model.Channel, *model.AppError)
// GetChannelByName gets a channel by its name, given a team id.
//
// @tag Channel
// Minimum server version: 5.2
GetChannelByName(teamID, name string, includeDeleted bool) (*model.Channel, *model.AppError)
// GetChannelByNameForTeamName gets a channel by its name, given a team name.
//
// @tag Channel
// @tag Team
// Minimum server version: 5.2
GetChannelByNameForTeamName(teamName, channelName string, includeDeleted bool) (*model.Channel, *model.AppError)
// GetChannelsForTeamForUser gets a list of channels for given user ID in given team ID, including DMs.
// If an empty string is passed as the team ID, the user's channels on all teams and their DMs will be returned.
//
// @tag Channel
// @tag Team
// @tag User
// Minimum server version: 5.6
GetChannelsForTeamForUser(teamID, userID string, includeDeleted bool) ([]*model.Channel, *model.AppError)
// GetChannelStats gets statistics for a channel.
//
// @tag Channel
// Minimum server version: 5.6
GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError)
// GetDirectChannel gets a direct message channel.
// If the channel does not exist it will create it.
//
// @tag Channel
// @tag User
// Minimum server version: 5.2
GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)
// GetGroupChannel gets a group message channel.
// If the channel does not exist it will create it.
//
// @tag Channel
// @tag User
// Minimum server version: 5.2
GetGroupChannel(userIds []string) (*model.Channel, *model.AppError)
// UpdateChannel updates a channel.
//
// @tag Channel
// Minimum server version: 5.2
UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
// RegisterChannelGuard claims the channel for this plugin, signaling to the server that the
// channel has plugin-managed semantics and that the server's default behaviors are unsafe
// without plugin involvement.
//
// The calling plugin's ID is implicit. Multiple plugins may co-guard the same channel; each
// claim is an independent row. Subsequent calls from the same plugin are idempotent; calls from
// a different plugin add a new claim.
//
// @tag Channel
// Minimum server version: 11.8
RegisterChannelGuard(channelID string) *model.AppError
// UnregisterChannelGuard releases this plugin's claim on the channel. Only the registering
// plugin can unregister its own claim; other plugins' claims on the same channel are
// unaffected.
//
// @tag Channel
// Minimum server version: 11.8
UnregisterChannelGuard(channelID string) *model.AppError
// SearchChannels returns the channels on a team matching the provided search term.
//
// @tag Channel
// Minimum server version: 5.6
SearchChannels(teamID string, term string) ([]*model.Channel, *model.AppError)
// CreateChannelSidebarCategory creates a new sidebar category for a set of channels.
//
// @tag ChannelSidebar
// Minimum server version: 5.38
CreateChannelSidebarCategory(userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError)
// GetChannelSidebarCategories returns sidebar categories.
//
// @tag ChannelSidebar
// Minimum server version: 5.38
GetChannelSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, *model.AppError)
// UpdateChannelSidebarCategories updates the channel sidebar categories.
//
// @tag ChannelSidebar
// Minimum server version: 5.38
UpdateChannelSidebarCategories(userID, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError)
// SearchUsers returns a list of users based on some search criteria.
//
// @tag User
// Minimum server version: 5.6
SearchUsers(search *model.UserSearch) ([]*model.User, *model.AppError)
// SearchPostsInTeam returns a list of posts in a specific team that match the given params.
//
// @tag Post
// @tag Team
// Minimum server version: 5.10
SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) ([]*model.Post, *model.AppError)
// SearchPostsInTeamForUser returns a list of posts by team and user that match the given
// search parameters.
// @tag Post
// Minimum server version: 5.26
SearchPostsInTeamForUser(teamID string, userID string, searchParams model.SearchParameter) (*model.PostSearchResults, *model.AppError)
// AddChannelMember joins a user to a channel (as if they joined themselves)
// This means the user will not receive notifications for joining the channel.
//
// @tag Channel
// @tag User
// Minimum server version: 5.2
AddChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError)
// AddUserToChannel adds a user to a channel as if the specified user had invited them.
// This means the user will receive the regular notifications for being added to the channel.
//
// @tag User
// @tag Channel
// Minimum server version: 5.18
AddUserToChannel(channelId, userID, asUserId string) (*model.ChannelMember, *model.AppError)
// GetChannelMember gets a channel membership for a user.
//
// @tag Channel
// @tag User
// Minimum server version: 5.2
GetChannelMember(channelId, userID string) (*model.ChannelMember, *model.AppError)
// GetChannelMembers gets a channel membership for all users.
//
// @tag Channel
// @tag User
// Minimum server version: 5.6
GetChannelMembers(channelId string, page, perPage int) (model.ChannelMembers, *model.AppError)
// GetChannelMembersByIds gets a channel membership for a particular User
//
// @tag Channel
// @tag User
// Minimum server version: 5.6
GetChannelMembersByIds(channelId string, userIds []string) (model.ChannelMembers, *model.AppError)
// GetChannelMembersForUser returns all channel memberships on a team for a user.
//
// @tag Channel
// @tag User
// Minimum server version: 5.10
GetChannelMembersForUser(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError)
// UpdateChannelMemberRoles updates a user's roles for a channel.
//
// @tag Channel
// @tag User
// Minimum server version: 5.2
UpdateChannelMemberRoles(channelId, userID, newRoles string) (*model.ChannelMember, *model.AppError)
// UpdateChannelMemberNotifications updates a user's notification properties for a channel.
//
// @tag Channel
// @tag User
// Minimum server version: 5.2
UpdateChannelMemberNotifications(channelId, userID string, notifications map[string]string) (*model.ChannelMember, *model.AppError)
// PatchChannelMembersNotifications updates the notification properties for multiple channel members.
// Other changes made to the channel memberships will be ignored. A maximum of 200 members can be
// updated at once.
//
// @tag Channel
// @tag User
// Minimum server version: 9.5
PatchChannelMembersNotifications(members []*model.ChannelMemberIdentifier, notifyProps map[string]string) *model.AppError
// GetGroup gets a group by ID.
//
// @tag Group
// Minimum server version: 5.18
GetGroup(groupId string) (*model.Group, *model.AppError)
// GetGroupByName gets a group by name.
//
// @tag Group
// Minimum server version: 5.18
GetGroupByName(name string) (*model.Group, *model.AppError)
// GetGroupMemberUsers gets a page of users belonging to the given group.
//
// @tag Group
// Minimum server version: 5.35
GetGroupMemberUsers(groupID string, page, perPage int) ([]*model.User, *model.AppError)
// GetGroupsBySource gets a list of all groups for the given source.
//
// @tag Group
// Minimum server version: 5.35
GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError)
// GetGroupsForUser gets the groups a user is in.
//
// @tag Group
// @tag User
// Minimum server version: 5.18
GetGroupsForUser(userID string) ([]*model.Group, *model.AppError)
// DeleteChannelMember deletes a channel membership for a user.
//
// @tag Channel
// @tag User
// Minimum server version: 5.2
DeleteChannelMember(channelId, userID string) *model.AppError
// CreatePost creates a post.
//
// @tag Post
// Minimum server version: 5.2
CreatePost(post *model.Post) (*model.Post, *model.AppError)
// AddReaction add a reaction to a post.
//
// @tag Post
// Minimum server version: 5.3
AddReaction(reaction *model.Reaction) (*model.Reaction, *model.AppError)
// RemoveReaction remove a reaction from a post.
//
// @tag Post
// Minimum server version: 5.3
RemoveReaction(reaction *model.Reaction) *model.AppError
// GetReaction get the reactions of a post.
//
// @tag Post
// Minimum server version: 5.3
GetReactions(postId string) ([]*model.Reaction, *model.AppError)
// SendEphemeralPost creates an ephemeral post.
//
// @tag Post
// Minimum server version: 5.2
SendEphemeralPost(userID string, post *model.Post) *model.Post
// UpdateEphemeralPost updates an ephemeral message previously sent to the user.
// EXPERIMENTAL: This API is experimental and can be changed without advance notice.
//
// @tag Post
// Minimum server version: 5.2
UpdateEphemeralPost(userID string, post *model.Post) *model.Post
// DeleteEphemeralPost deletes an ephemeral message previously sent to the user.
// EXPERIMENTAL: This API is experimental and can be changed without advance notice.
//
// @tag Post
// Minimum server version: 5.2
DeleteEphemeralPost(userID, postId string)
// DeletePost deletes a post.
//
// @tag Post
// Minimum server version: 5.2
DeletePost(postId string) *model.AppError
// GetPostThread gets a post with all the other posts in the same thread.
//
// @tag Post
// Minimum server version: 5.6
GetPostThread(postId string) (*model.PostList, *model.AppError)
// GetPost gets a post.
//
// @tag Post
// Minimum server version: 5.2
GetPost(postId string) (*model.Post, *model.AppError)
// GetPostsSince gets posts created after a specified time as Unix time in milliseconds.
//
// @tag Post
// @tag Channel
// Minimum server version: 5.6
GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError)
// GetPostsAfter gets a page of posts that were posted after the post provided.
//
// @tag Post
// @tag Channel
// Minimum server version: 5.6
GetPostsAfter(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError)
// GetPostsBefore gets a page of posts that were posted before the post provided.
//
// @tag Post
// @tag Channel
// Minimum server version: 5.6
GetPostsBefore(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError)
// GetPostsForChannel gets a list of posts for a channel.
//
// @tag Post
// @tag Channel
// Minimum server version: 5.6
GetPostsForChannel(channelId string, page, perPage int) (*model.PostList, *model.AppError)
// GetTeamStats gets a team's statistics
//
// @tag Team
// Minimum server version: 5.8
GetTeamStats(teamID string) (*model.TeamStats, *model.AppError)
// UpdatePost updates a post.
//
// @tag Post
// Minimum server version: 5.2
UpdatePost(post *model.Post) (*model.Post, *model.AppError)
// GetProfileImage gets user's profile image.
//
// @tag User
// Minimum server version: 5.6
GetProfileImage(userID string) ([]byte, *model.AppError)
// SetProfileImage sets a user's profile image.
//
// @tag User
// Minimum server version: 5.6
SetProfileImage(userID string, data []byte) *model.AppError
// GetEmojiList returns a page of custom emoji on the system.
//
// The sortBy parameter can be: "name".
//
// @tag Emoji
// Minimum server version: 5.6
GetEmojiList(sortBy string, page, perPage int) ([]*model.Emoji, *model.AppError)
// GetEmojiByName gets an emoji by it's name.
//
// @tag Emoji
// Minimum server version: 5.6
GetEmojiByName(name string) (*model.Emoji, *model.AppError)
// GetEmoji returns a custom emoji based on the emojiId string.
//
// @tag Emoji
// Minimum server version: 5.6
GetEmoji(emojiId string) (*model.Emoji, *model.AppError)
// CopyFileInfos duplicates the FileInfo objects referenced by the given file ids,
// recording the given user id as the new creator and returning the new set of file ids.
//
// The duplicate FileInfo objects are not initially linked to a post, but may now be passed
// to CreatePost. Use this API to duplicate a post and its file attachments without
// actually duplicating the uploaded files.
//
// @tag File
// @tag User
// Minimum server version: 5.2
CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError)
// GetFileInfo gets a File Info for a specific fileId
//
// @tag File
// Minimum server version: 5.3
GetFileInfo(fileId string) (*model.FileInfo, *model.AppError)
// SetFileSearchableContent update the File Info searchable text for full text search
//
// @tag File
// Minimum server version: 9.1
SetFileSearchableContent(fileID string, content string) *model.AppError
// GetFileInfos gets File Infos with options
//
// @tag File
// Minimum server version: 5.22
GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError)
// GetFile gets content of a file by it's ID
//
// @tag File
// Minimum server version: 5.8
GetFile(fileId string) ([]byte, *model.AppError)
// GetFileLink gets the public link to a file by fileId.
//
// @tag File
// Minimum server version: 5.6
GetFileLink(fileId string) (string, *model.AppError)
// ReadFile reads the file from the backend for a specific path
//
// @tag File
// Minimum server version: 5.3
ReadFile(path string) ([]byte, *model.AppError)
// GetEmojiImage returns the emoji image.
//
// @tag Emoji
// Minimum server version: 5.6
GetEmojiImage(emojiId string) ([]byte, string, *model.AppError)
// UploadFile will upload a file to a channel using a multipart request, to be later attached to a post.
//
// @tag File
// @tag Channel
// Minimum server version: 5.6
UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError)
// OpenInteractiveDialog will open an interactive dialog on a user's client that
// generated the trigger ID. Used with interactive message buttons, menus
// and slash commands.
//
// Minimum server version: 5.6
OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError
// SendToastMessage sends a toast notification to a specific user or user session.
// The userID parameter specifies the user to send the toast to.
// If connectionID is set, the toast will only be sent to that specific connection.
//
// @tag Frontend
// Minimum server version: 11.5
SendToastMessage(userID, connectionID, message string, options model.SendToastMessageOptions) *model.AppError
// GetPlugins will return a list of plugin manifests for currently active plugins.
//
// @tag Plugin
// Minimum server version: 5.6
GetPlugins() ([]*model.Manifest, *model.AppError)
// EnablePlugin will enable an plugin installed.
//
// @tag Plugin
// Minimum server version: 5.6
EnablePlugin(id string) *model.AppError
// DisablePlugin will disable an enabled plugin.
//
// @tag Plugin
// Minimum server version: 5.6
DisablePlugin(id string) *model.AppError
// RemovePlugin will disable and delete a plugin.
//
// @tag Plugin
// Minimum server version: 5.6
RemovePlugin(id string) *model.AppError
// GetPluginStatus will return the status of a plugin.
//
// @tag Plugin
// Minimum server version: 5.6
GetPluginStatus(id string) (*model.PluginStatus, *model.AppError)
// InstallPlugin will upload another plugin with tar.gz file.
// Previous version will be replaced on replace true.
//
// @tag Plugin
// Minimum server version: 5.18
InstallPlugin(file io.Reader, replace bool) (*model.Manifest, *model.AppError)
// KVSet stores a key-value pair, unique per plugin.
// Provided helper functions and internal plugin code will use the prefix `mmi_` before keys. Do not use this prefix.
//
// @tag KeyValueStore
// Minimum server version: 5.2
KVSet(key string, value []byte) *model.AppError
// KVCompareAndSet updates a key-value pair, unique per plugin, but only if the current value matches the given oldValue.
// Inserts a new key if oldValue == nil.
// Returns (false, err) if DB error occurred
// Returns (false, nil) if current value != oldValue or key already exists when inserting
// Returns (true, nil) if current value == oldValue or new key is inserted
//
// @tag KeyValueStore
// Minimum server version: 5.12
KVCompareAndSet(key string, oldValue, newValue []byte) (bool, *model.AppError)
// KVCompareAndDelete deletes a key-value pair, unique per plugin, but only if the current value matches the given oldValue.
// Returns (false, err) if DB error occurred
// Returns (false, nil) if current value != oldValue or key does not exist when deleting
// Returns (true, nil) if current value == oldValue and the key was deleted
//
// @tag KeyValueStore
// Minimum server version: 5.16
KVCompareAndDelete(key string, oldValue []byte) (bool, *model.AppError)
// KVSetWithOptions stores a key-value pair, unique per plugin, according to the given options.
// Returns (false, err) if DB error occurred
// Returns (false, nil) if the value was not set
// Returns (true, nil) if the value was set
//
// Minimum server version: 5.20
KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError)
// KVSet stores a key-value pair with an expiry time, unique per plugin.
//
// @tag KeyValueStore
// Minimum server version: 5.6
KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError
// KVGet retrieves a value based on the key, unique per plugin. Returns nil for non-existent keys.
//
// @tag KeyValueStore
// Minimum server version: 5.2
KVGet(key string) ([]byte, *model.AppError)
// KVDelete removes a key-value pair, unique per plugin. Returns nil for non-existent keys.
//
// @tag KeyValueStore
// Minimum server version: 5.2
KVDelete(key string) *model.AppError
// KVDeleteAll removes all key-value pairs for a plugin.
//
// @tag KeyValueStore
// Minimum server version: 5.6
KVDeleteAll() *model.AppError
// KVList lists all keys for a plugin.
//
// @tag KeyValueStore
// Minimum server version: 5.6
KVList(page, perPage int) ([]string, *model.AppError)
// PublishWebSocketEvent sends an event to WebSocket connections.
// event is the type and will be prepended with "custom_<pluginid>_".
// payload is the data sent with the event. Interface values must be primitive Go types or mattermost-server/model types.
// broadcast determines to which users to send the event.
//
// Minimum server version: 5.2
PublishWebSocketEvent(event string, payload map[string]any, broadcast *model.WebsocketBroadcast)
// HasPermissionTo check if the user has the permission at system scope.
//
// @tag User
// Minimum server version: 5.3
HasPermissionTo(userID string, permission *model.Permission) bool
// HasPermissionToTeam check if the user has the permission at team scope.
//
// @tag User
// @tag Team
// Minimum server version: 5.3
HasPermissionToTeam(userID, teamID string, permission *model.Permission) bool
// HasPermissionToChannel check if the user has the permission at channel scope.
//
// @tag User
// @tag Channel
// Minimum server version: 5.3
HasPermissionToChannel(userID, channelId string, permission *model.Permission) bool
// RolesGrantPermission check if the specified roles grant the specified permission
//
// Minimum server version: 6.3
RolesGrantPermission(roleNames []string, permissionId string) bool
// LogDebug writes a log message to the Mattermost server log file.
// Appropriate context such as the plugin name will already be added as fields so plugins
// do not need to add that info.
//
// @tag Logging
// Minimum server version: 5.2
LogDebug(msg string, keyValuePairs ...any)
// LogInfo writes a log message to the Mattermost server log file.
// Appropriate context such as the plugin name will already be added as fields so plugins
// do not need to add that info.
//
// @tag Logging
// Minimum server version: 5.2
LogInfo(msg string, keyValuePairs ...any)
// LogError writes a log message to the Mattermost server log file.
// Appropriate context such as the plugin name will already be added as fields so plugins
// do not need to add that info.
//
// @tag Logging
// Minimum server version: 5.2
LogError(msg string, keyValuePairs ...any)
// LogWarn writes a log message to the Mattermost server log file.
// Appropriate context such as the plugin name will already be added as fields so plugins
// do not need to add that info.
//
// @tag Logging
// Minimum server version: 5.2
LogWarn(msg string, keyValuePairs ...any)
// SendMail sends an email to a specific address
//
// Minimum server version: 5.7
SendMail(to, subject, htmlBody string) *model.AppError
// CreateBot creates the given bot and corresponding user.
//
// @tag Bot
// Minimum server version: 5.10
CreateBot(bot *model.Bot) (*model.Bot, *model.AppError)
// PatchBot applies the given patch to the bot and corresponding user.
//
// @tag Bot
// Minimum server version: 5.10
PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError)
// GetBot returns the given bot.
//
// @tag Bot
// Minimum server version: 5.10
GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError)
// GetBots returns the requested page of bots.
//
// @tag Bot
// Minimum server version: 5.10
GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppError)
// UpdateBotActive marks a bot as active or inactive, along with its corresponding user.
//
// @tag Bot
// Minimum server version: 5.10
UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError)
// PermanentDeleteBot permanently deletes a bot and its corresponding user.
//
// @tag Bot
// Minimum server version: 5.10
PermanentDeleteBot(botUserId string) *model.AppError
// PluginHTTP allows inter-plugin requests to plugin APIs.
//
// Minimum server version: 5.18
PluginHTTP(request *http.Request) *http.Response
// PublishUserTyping publishes a user is typing WebSocket event.
// The parentId parameter may be an empty string, the other parameters are required.
//
// @tag User
// Minimum server version: 5.26
PublishUserTyping(userID, channelId, parentId string) *model.AppError
// CreateCommand creates a server-owned slash command that is not handled by the plugin
// itself, and which will persist past the life of the plugin. The command will have its
// CreatorId set to "" and its PluginId set to the id of the plugin that created it.
//
// @tag SlashCommand
// Minimum server version: 5.28
CreateCommand(cmd *model.Command) (*model.Command, error)
// ListCommands returns the list of all slash commands for teamID. E.g., custom commands
// (those created through the integrations menu, the REST api, or the plugin api CreateCommand),
// plugin commands (those created with plugin api RegisterCommand), and builtin commands
// (those added internally through RegisterCommandProvider).
//
// @tag SlashCommand
// Minimum server version: 5.28
ListCommands(teamID string) ([]*model.Command, error)
// ListCustomCommands returns the list of slash commands for teamID that where created
// through the integrations menu, the REST api, or the plugin api CreateCommand.
//
// @tag SlashCommand
// Minimum server version: 5.28
ListCustomCommands(teamID string) ([]*model.Command, error)
// ListPluginCommands returns the list of slash commands for teamID that were created
// with the plugin api RegisterCommand.
//
// @tag SlashCommand
// Minimum server version: 5.28
ListPluginCommands(teamID string) ([]*model.Command, error)
// ListBuiltInCommands returns the list of slash commands that are builtin commands
// (those added internally through RegisterCommandProvider).
//
// @tag SlashCommand
// Minimum server version: 5.28
ListBuiltInCommands() ([]*model.Command, error)
// GetCommand returns the command definition based on a command id string.
//
// @tag SlashCommand
// Minimum server version: 5.28
GetCommand(commandID string) (*model.Command, error)
// UpdateCommand updates a single command (commandID) with the information provided in the
// updatedCmd model.Command struct. The following fields in the command cannot be updated:
// Id, Token, CreateAt, DeleteAt, and PluginId. If updatedCmd.TeamId is blank, it
// will be set to commandID's TeamId.
//
// @tag SlashCommand
// Minimum server version: 5.28
UpdateCommand(commandID string, updatedCmd *model.Command) (*model.Command, error)
// DeleteCommand deletes a slash command (commandID).
//
// @tag SlashCommand
// Minimum server version: 5.28
DeleteCommand(commandID string) error
// CreateOAuthApp creates a new OAuth App.
//
// @tag OAuth
// Minimum server version: 5.38
CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)
// GetOAuthApp gets an existing OAuth App by id.
//
// @tag OAuth
// Minimum server version: 5.38
GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError)
// UpdateOAuthApp updates an existing OAuth App.
//
// @tag OAuth
// Minimum server version: 5.38
UpdateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)
// DeleteOAuthApp deletes an existing OAuth App by id.
//
// @tag OAuth
// Minimum server version: 5.38
DeleteOAuthApp(appID string) *model.AppError
// PublishPluginClusterEvent broadcasts a plugin event to all other running instances of
// the calling plugin that are present in the cluster.
//
// This method is used to allow plugin communication in a High-Availability cluster.
// The receiving side should implement the OnPluginClusterEvent hook
// to receive events sent through this method.
//
// Minimum server version: 5.36
PublishPluginClusterEvent(ev model.PluginClusterEvent, opts model.PluginClusterEventSendOptions) error
// RequestTrialLicense requests a trial license and installs it in the server
//
// Minimum server version: 5.36
RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError
// GetCloudLimits gets limits associated with a cloud workspace, if any
//
// Minimum server version: 7.0
GetCloudLimits() (*model.ProductLimits, error)
// EnsureBotUser updates the bot if it exists, otherwise creates it.
//
// Minimum server version: 7.1
EnsureBotUser(bot *model.Bot) (string, error)
// RegisterCollectionAndTopic is no longer supported.
//
// Minimum server version: 7.6
RegisterCollectionAndTopic(collectionType, topicType string) error
// CreateUploadSession creates and returns a new (resumable) upload session.
//
// @tag Upload
// Minimum server version: 7.6
CreateUploadSession(us *model.UploadSession) (*model.UploadSession, error)
// UploadData uploads the data for a given upload session.
//
// @tag Upload
// Minimum server version: 7.6
UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInfo, error)
// GetUploadSession returns the upload session for the provided id.
//
// @tag Upload
// Minimum server version: 7.6
GetUploadSession(uploadID string) (*model.UploadSession, error)
// SendPushNotification will send a push notification to all of user's sessions.
//
// It is the responsibility of the plugin to respect the server's configuration and licence,
// especially related to `cfg.EmailSettings.PushNotificationContents`, particularly
// `model.IdLoadedNotification` and the generic settings.
// Refer to `app.sendPushNotificationSync` for the logic used to construct push notifications.
//
// Note: the NotificationWillBePushed hook will be run after SendPushNotification is called.
//
// Minimum server version: 9.0
SendPushNotification(notification *model.PushNotification, userID string) *model.AppError
// UpdateUserAuth updates a user's auth data.
//
// It is not currently possible to use this to set a user's auth to e-mail with a hashed
// password. It is meant to be used exclusively in setting a non-email auth service.
//
// @tag User
// Minimum server version: 9.3
UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError)
// The plugin will receive synchronization messages via the `OnSharedChannelsSyncMsg` hook.
// This API is idempotent - when called repeatedly with the same `RegisterPluginOpts.PluginID`
// it will return the same remoteID.
//
// @tag SharedChannels
// Minimum server version: 9.5
RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
// longer receive synchronization messages via the `OnSharedChannelsSyncMsg` hook. Used in
// OnDeactivate for bulk cleanup.
//
// @tag SharedChannels
// Minimum server version: 9.5
UnregisterPluginForSharedChannels(pluginID string) error
// The remote must belong to the calling plugin (ownership is validated server-side).
// The remote will no longer receive synchronization messages. Used for config change
// reconciliation when a connection is removed but others remain.
//
// @tag SharedChannels
// Minimum server version: 11.7
UnregisterPluginRemoteForSharedChannels(remoteID string) error
// invite any remote clusters to the channel - use `InviteRemote` to invite a remote , or this plugin,
// to the shared channel and start synchronization.
//
// @tag SharedChannels
// Minimum server version: 9.5
ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
// display name, purpose, header, etc.
//
// @tag SharedChannels
// Minimum server version: 9.5
UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
// all remotes will be uninvited to the channel.
//
// @tag SharedChannels
// Minimum server version: 9.5
UnshareChannel(channelID string) (unshared bool, err error)
// the plugin when registering). This can be used to manually set the point of last sync, either
// forward to skip older posts, or backward to re-sync history. This call by itself does not force
// a re-sync - a change to channel contents or a call to SyncSharedChannel are needed to force a sync.
//
// @tag SharedChannels
// Minimum server version: 9.5
UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
//
// @tag SharedChannels
// Minimum server version: 9.5
SyncSharedChannel(channelID string) error
// InviteRemoteToChannel invites a remote, or this plugin, as a target for synchronizing. Once invited, the
// remote will start to receive synchronization messages for any changed content in the specified channel.
// If `shareIfNotShared` is true, the channel's shared flag will be set, if not already.
//
// @tag SharedChannels
// Minimum server version: 9.5
InviteRemoteToChannel(channelID string, remoteID string, userID string, shareIfNotShared bool) error
// UninviteRemoteFromChannel uninvites a remote, or this plugin, such that it will stop receiving sychronization
// messages for the channel.
//
// @tag SharedChannels
// Minimum server version: 9.5
UninviteRemoteFromChannel(channelID string, remoteID string) error
// posts, reactions, users, statuses, acknowledgements, and membership changes.
// When msg.ChannelId is set, content is synced into that shared channel.
// When msg.ChannelId is empty and only Users are present, a global user sync is performed.
// This is the inbound counterpart of the OnSharedChannelsSyncMsg hook.
// The remoteID identifies which of the plugin's registered remotes this message is from
// (the value returned by RegisterPluginForSharedChannels). Entities in the SyncMsg will
// have their RemoteId set to match this remote.
//
// @tag SharedChannels
// Minimum server version: 11.7
ReceiveSharedChannelSyncMsg(remoteID string, msg *model.SyncMsg) (model.SyncResponse, error)
// The FileInfo provides metadata (Name, Size, CreatorId); the server constructs the
// storage path and manages the upload. The data reader provides the raw file bytes.
// This is the inbound counterpart of the OnSharedChannelsAttachmentSyncMsg hook.
// The remoteID identifies which of the plugin's registered remotes this attachment is from
// (the value returned by RegisterPluginForSharedChannels).
//
// The post-receive (ReceiveSharedChannelSyncMsg) and file-receive calls for the same
// post-and-attachment pair may be issued in either order or concurrently; the framework
// binds the file to its post regardless of arrival order. Repeated calls with the same
// (fi.Id, channelID, fi.CreatorId) return the existing FileInfo without producing
// duplicates, allowing transports with at-least-once delivery semantics to redeliver
// safely. Repeats whose fi.Id matches an existing record under a different channel or
// creator are rejected.
//
// @tag SharedChannels
// Minimum server version: 11.7
ReceiveSharedChannelAttachmentSyncMsg(remoteID, channelID string, fi *model.FileInfo, data io.Reader) (*model.FileInfo, error)
// remote into Mattermost. The user must have a RemoteId matching the specified remote.
// This is the inbound counterpart of the OnSharedChannelsProfileImageSyncMsg hook.
// The remoteID identifies which of the plugin's registered remotes this image is from
// (the value returned by RegisterPluginForSharedChannels).
//
// @tag SharedChannels
// Minimum server version: 11.7
ReceiveSharedChannelProfileImageSyncMsg(remoteID, userID string, image []byte) error
// UpsertGroupMember adds a user to a group or updates their existing membership.
//
// @tag Group
// @tag User
// Minimum server version: 10.7
UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError)
// UpsertGroupMembers adds multiple users to a group or updates their existing memberships.
//
// @tag Group
// @tag User
// Minimum server version: 10.7
UpsertGroupMembers(groupID string, userIDs []string) ([]*model.GroupMember, *model.AppError)
// GetGroupByRemoteID gets a group by its remote ID.
//
// @tag Group
// Minimum server version: 10.7
GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError)
// CreateGroup creates a new group.
//
// @tag Group
// Minimum server version: 10.7
CreateGroup(group *model.Group) (*model.Group, *model.AppError)
// UpdateGroup updates a group.
//
// @tag Group
// Minimum server version: 10.7
UpdateGroup(group *model.Group) (*model.Group, *model.AppError)
// DeleteGroup soft deletes a group.
//
// @tag Group
// Minimum server version: 10.7
DeleteGroup(groupID string) (*model.Group, *model.AppError)
// RestoreGroup restores a soft deleted group.
//
// @tag Group
// Minimum server version: 10.7
RestoreGroup(groupID string) (*model.Group, *model.AppError)
// DeleteGroupMember removes a user from a group.
//
// @tag Group
// @tag User
// Minimum server version: 10.7
DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError)
// GetGroupSyncable gets a group syncable.
//
// @tag Group
// Minimum server version: 10.7
GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
// GetGroupSyncables gets all group syncables for the given group.
//
// @tag Group
// Minimum server version: 10.7
GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError)
// UpsertGroupSyncable creates or updates a group syncable.
//
// @tag Group
// Minimum server version: 10.7
UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
// UpdateGroupSyncable updates a group syncable.
//
// @tag Group
// Minimum server version: 10.7
UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
// DeleteGroupSyncable deletes a group syncable.
//
// @tag Group
// Minimum server version: 10.7
DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
// UpdateUserRoles updates the role for a user.
//
// @tag Team
// @tag User
// Minimum server version: 9.8
UpdateUserRoles(userID, newRoles string) (*model.User, *model.AppError)
// GetPluginID returns the plugin ID.
//
// @tag Plugin
// Minimum server version: 10.1
GetPluginID() string
// GetGroups returns a list of all groups with the given options and restrictions.
//
// @tag Group
// Minimum server version: 10.7
GetGroups(page, perPage int, opts model.GroupSearchOpts, viewRestrictions *model.ViewUsersRestrictions) ([]*model.Group, *model.AppError)
// CreateDefaultSyncableMemberships creates default syncable memberships based off the provided parameters.
//
// @tag Group
// Minimum server version: 10.9
CreateDefaultSyncableMemberships(params model.CreateDefaultMembershipParams) *model.AppError
// DeleteGroupConstrainedMemberships deletes team and channel memberships of users who aren't members of the allowed groups of all group-constrained teams and channels.
//
// @tag Group
// Minimum server version: 10.9
DeleteGroupConstrainedMemberships() *model.AppError
// CreatePropertyField creates a new property field.
//
// If the field's LinkedFieldID is set, the field inherits type, options,
// and security attributes from the referenced template field. The source
// must be a template field in the same group, must not itself be linked,
// and must not be deleted.
//
// @tag PropertyField
// Minimum server version: 10.10
CreatePropertyField(field *model.PropertyField) (*model.PropertyField, error)
// GetPropertyField gets a property field by groupID and fieldID.
//
// @tag PropertyField
// Minimum server version: 10.10
GetPropertyField(groupID, fieldID string) (*model.PropertyField, error)
// GetPropertyFields gets multiple property fields by groupID and a list of IDs.
//
// @tag PropertyField
// Minimum server version: 10.10
GetPropertyFields(groupID string, ids []string) ([]*model.PropertyField, error)
// UpdatePropertyField updates an existing property field.
//
// Fields with a LinkedFieldID cannot have their type or options modified.
// Set LinkedFieldID to an empty string to unlink a field from its source.
//
// @tag PropertyField
// Minimum server version: 10.10
UpdatePropertyField(groupID string, field *model.PropertyField) (*model.PropertyField, error)
// DeletePropertyField deletes a property field (soft delete).
//
// Returns an error if the field has active linked dependents. Unlink or
// delete dependent fields first.
//
// @tag PropertyField
// Minimum server version: 10.10
DeletePropertyField(groupID, fieldID string) error
// SearchPropertyFields searches for property fields with filtering options.
//
// @tag PropertyField
// Minimum server version: 11.0
SearchPropertyFields(groupID string, opts model.PropertyFieldSearchOpts) ([]*model.PropertyField, error)
// CountPropertyFields counts property fields for a group.
//
// @tag PropertyField
// Minimum server version: 11.0
CountPropertyFields(groupID string, includeDeleted bool) (int64, error)
// CountPropertyFieldsForTarget counts property fields for a specific target.
//
// @tag PropertyField
// Minimum server version: 11.0
CountPropertyFieldsForTarget(groupID, targetType, targetID string, includeDeleted bool) (int64, error)
// CreatePropertyValue creates a new property value.
//
// @tag PropertyValue
// Minimum server version: 10.10
CreatePropertyValue(value *model.PropertyValue) (*model.PropertyValue, error)
// GetPropertyValue gets a property value by groupID and valueID.
//
// @tag PropertyValue
// Minimum server version: 10.10
GetPropertyValue(groupID, valueID string) (*model.PropertyValue, error)
// GetPropertyValues gets multiple property values by groupID and a list of IDs.
//
// @tag PropertyValue
// Minimum server version: 10.10
GetPropertyValues(groupID string, ids []string) ([]*model.PropertyValue, error)
// UpdatePropertyValue updates an existing property value.
//
// @tag PropertyValue
// Minimum server version: 10.10
UpdatePropertyValue(groupID string, value *model.PropertyValue) (*model.PropertyValue, error)
// UpsertPropertyValue creates a new property value or updates if it already exists.
//
// @tag PropertyValue
// Minimum server version: 10.10
UpsertPropertyValue(value *model.PropertyValue) (*model.PropertyValue, error)
// DeletePropertyValue deletes a property value (soft delete).
//
// @tag PropertyValue
// Minimum server version: 10.10
DeletePropertyValue(groupID, valueID string) error
// SearchPropertyValues searches for property values with filtering options.
//
// @tag PropertyValue
// Minimum server version: 11.0
SearchPropertyValues(groupID string, opts model.PropertyValueSearchOpts) ([]*model.PropertyValue, error)
// RegisterPropertyGroup registers a new property group.
//
// @tag PropertyGroup
// Minimum server version: 10.10
RegisterPropertyGroup(name string) (*model.PropertyGroup, error)
// GetPropertyGroup gets a property group by name.
//
// @tag PropertyGroup
// Minimum server version: 10.10
GetPropertyGroup(name string) (*model.PropertyGroup, error)
// GetPropertyFieldByName gets a property field by groupID, targetID and name.
//
// @tag PropertyField
// Minimum server version: 10.10
GetPropertyFieldByName(groupID, targetID, name string) (*model.PropertyField, error)
// UpdatePropertyFields updates multiple property fields in a single operation.
//
// @tag PropertyField
// Minimum server version: 10.10
UpdatePropertyFields(groupID string, fields []*model.PropertyField) ([]*model.PropertyField, error)
// UpdatePropertyValues updates multiple property values in a single operation.
//
// @tag PropertyValue
// Minimum server version: 10.10
UpdatePropertyValues(groupID string, values []*model.PropertyValue) ([]*model.PropertyValue, error)
// UpsertPropertyValues creates or updates multiple property values in a single operation.
//
// @tag PropertyValue
// Minimum server version: 10.10
UpsertPropertyValues(values []*model.PropertyValue) ([]*model.PropertyValue, error)
// DeletePropertyValuesForTarget deletes all property values for a specific target.
//
// @tag PropertyValue
// Minimum server version: 10.10
DeletePropertyValuesForTarget(groupID, targetType, targetID string) error
// DeletePropertyValuesForField deletes all property values for a specific field.
//
// @tag PropertyValue
// Minimum server version: 10.10
DeletePropertyValuesForField(groupID, fieldID string) error
// LogAuditRec logs an audit record using the default audit logger.
//
// @tag Audit
// Minimum server version: 10.10
LogAuditRec(rec *model.AuditRecord)
// LogAuditRecWithLevel logs an audit record with a specific log level.
//
// @tag Audit
// Minimum server version: 10.10
LogAuditRecWithLevel(rec *model.AuditRecord, level mlog.Level)
}
The API can be used to retrieve data or perform actions on behalf of the plugin. Most methods have direct counterparts in the REST API and very similar behavior.
Plugins obtain access to the API by embedding MattermostPlugin and accessing the API member directly.
type AppDriver ¶ added in v0.1.1
type AppDriver interface {
Driver
// ConnWithPluginID is only used by the server, and isn't exposed via the RPC API.
ConnWithPluginID(isMaster bool, pluginID string) (string, error)
// This is an extra method needed to shutdown connections
// after a plugin shuts down.
ShutdownConns(pluginID string)
}
AppDriver is an extension of the Driver interface to capture non-RPC APIs.
type Context ¶
type Context struct {
SessionId string
ConnectionId string
RequestId string
IPAddress string
AcceptLanguage string
UserAgent string
}
Context passes through metadata about the request or hook event. For requests this is built in app/plugin_requests.go For hooks, app.PluginContext() is called.
type Driver ¶
type Driver interface {
// Connection
Conn(isMaster bool) (string, error)
ConnPing(connID string) error
ConnClose(connID string) error
ConnQuery(connID, q string, args []driver.NamedValue) (string, error) // rows
ConnExec(connID, q string, args []driver.NamedValue) (ResultContainer, error) // result
// Transaction
Tx(connID string, opts driver.TxOptions) (string, error)
TxCommit(txID string) error
TxRollback(txID string) error
// Statement
Stmt(connID, q string) (string, error)
StmtClose(stID string) error
StmtNumInput(stID string) int
StmtQuery(stID string, args []driver.NamedValue) (string, error) // rows
StmtExec(stID string, args []driver.NamedValue) (ResultContainer, error) // result
// Rows
RowsColumns(rowsID string) []string
RowsClose(rowsID string) error
RowsNext(rowsID string, dest []driver.Value) error
RowsHasNextResultSet(rowsID string) bool
RowsNextResultSet(rowsID string) error
RowsColumnTypeDatabaseTypeName(rowsID string, index int) string
RowsColumnTypePrecisionScale(rowsID string, index int) (int64, int64, bool)
}
Driver is a sql driver interface that is used by plugins to perform raw SQL queries without opening DB connections by themselves. This interface is not subject to backward compatibility guarantees and is only meant to be used by plugins built by the Mattermost team.
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment represents the execution environment of active plugins.
It is meant for use by the Mattermost server to manipulate, interact with and report on the set of active plugins.
func NewEnvironment ¶
func (*Environment) Active ¶
func (env *Environment) Active() []*model.BundleInfo
Returns a list of all currently active plugins within the environment. The returned list should not be modified.
func (*Environment) Available ¶
func (env *Environment) Available() ([]*model.BundleInfo, error)
Returns a list of all plugins within the environment.
func (*Environment) ClearTransitionallyPrepackagedPlugins ¶ added in v0.0.8
func (env *Environment) ClearTransitionallyPrepackagedPlugins()
ClearTransitionallyPrepackagedPlugins clears the list of plugins transitionally prepackaged in the local prepackaged_plugins folder.
func (*Environment) Deactivate ¶
func (env *Environment) Deactivate(id string) bool
Deactivates the plugin with the given id.
func (*Environment) GetManifest ¶
func (env *Environment) GetManifest(pluginId string) (*model.Manifest, error)
GetManifest returns a manifest for a given pluginId. Returns ErrNotFound if plugin is not found.
func (*Environment) GetPluginHealthCheckJob ¶
func (env *Environment) GetPluginHealthCheckJob() *PluginHealthCheckJob
GetPluginHealthCheckJob returns the configured PluginHealthCheckJob, if any.
func (*Environment) GetPluginState ¶
func (env *Environment) GetPluginState(id string) int
GetPluginState returns the current state of a plugin (disabled, running, or error)
func (*Environment) HooksForPlugin ¶
func (env *Environment) HooksForPlugin(id string) (Hooks, error)
HooksForPlugin returns the hooks API for the plugin with the given id.
Consider using RunMultiPluginHook instead.
func (*Environment) HooksForPluginWithRPCErr ¶ added in v0.4.1
func (env *Environment) HooksForPluginWithRPCErr(id string) (HooksWithRPCErr, error)
HooksForPluginWithRPCErr returns the full *WithRPCErr hook surface for the named plugin. Returns an error if the plugin is not found or not active.
func (*Environment) IsActive ¶
func (env *Environment) IsActive(id string) bool
IsActive returns true if the plugin with the given id is active.
func (*Environment) PerformHealthCheck ¶
func (env *Environment) PerformHealthCheck(id string) error
PerformHealthCheck uses the active plugin's supervisor to verify if the plugin has crashed.
func (*Environment) PrepackagedPlugins ¶
func (env *Environment) PrepackagedPlugins() []*PrepackagedPlugin
Returns a list of prepackaged plugins available in the local prepackaged_plugins folder, excluding those in transition out of being prepackaged.
The list content is immutable and should not be modified.
func (*Environment) PublicFilesPath ¶
func (env *Environment) PublicFilesPath(id string) (string, error)
PublicFilesPath returns a path and true if the plugin with the given id is active. It returns an empty string and false if the path is not set or invalid
func (*Environment) Reattach ¶ added in v0.0.18
func (env *Environment) Reattach(manifest *model.Manifest, pluginReattachConfig *model.PluginReattachConfig) (reterr error)
Reattach allows the server to bind to an existing plugin instance launched elsewhere.
func (*Environment) RemovePlugin ¶
func (env *Environment) RemovePlugin(id string)
func (*Environment) RestartPlugin ¶
func (env *Environment) RestartPlugin(id string) error
RestartPlugin deactivates, then activates the plugin with the given id.
func (*Environment) RunMultiPluginHook ¶
func (env *Environment) RunMultiPluginHook(hookRunnerFunc func(hooks Hooks, manifest *model.Manifest) bool, hookId int)
RunMultiPluginHook invokes hookRunnerFunc for each active plugin that implements the given hookId.
If hookRunnerFunc returns false, iteration will not continue. The iteration order among active plugins is not specified.
func (*Environment) RunMultiPluginHookExcluding ¶ added in v0.4.1
func (env *Environment) RunMultiPluginHookExcluding( excludePluginIDs []string, hookRunnerFunc func(hooks Hooks, manifest *model.Manifest) bool, hookId int, )
RunMultiPluginHookExcluding is like RunMultiPluginHook but skips plugins whose IDs appear in excludePluginIDs, otherwise the semantics are the same as RunMultiPluginHook. The exclusion check is a linear scan.
func (*Environment) RunMultiPluginHookWithRPCErr ¶ added in v0.4.0
func (env *Environment) RunMultiPluginHookWithRPCErr(hookRunnerFunc func(hooks HooksWithRPCErr, manifest *model.Manifest) (bool, error), hookId int) error
RunMultiPluginHookWithRPCErr is like RunMultiPluginHook but surfaces RPC transport errors. The closure receives a HooksWithRPCErr so it can call any *WithRPCErr variant. Iteration stops on the first non-nil error returned by the closure.
func (*Environment) SetPluginError ¶
func (env *Environment) SetPluginError(id string, err string)
func (*Environment) SetPrepackagedPlugins ¶
func (env *Environment) SetPrepackagedPlugins(plugins, transitionalPlugins []*PrepackagedPlugin)
SetPrepackagedPlugins saves prepackaged plugins in the environment.
func (*Environment) Shutdown ¶
func (env *Environment) Shutdown()
Shutdown deactivates all plugins and gracefully shuts down the environment.
func (*Environment) Statuses ¶
func (env *Environment) Statuses() (model.PluginStatuses, error)
Statuses returns a list of plugin statuses representing the state of every plugin
func (*Environment) TogglePluginHealthCheckJob ¶
func (env *Environment) TogglePluginHealthCheckJob(enable bool)
TogglePluginHealthCheckJob starts a new job if one is not running and is set to enabled, or kills an existing one if set to disabled.
func (*Environment) TransitionallyPrepackagedPlugins ¶ added in v0.0.8
func (env *Environment) TransitionallyPrepackagedPlugins() []*PrepackagedPlugin
TransitionallyPrepackagedPlugins returns a list of plugins transitionally prepackaged in the local prepackaged_plugins folder.
The list content is immutable and should not be modified.
func (*Environment) UnpackWebappBundle ¶
func (env *Environment) UnpackWebappBundle(id string) (*model.Manifest, error)
UnpackWebappBundle unpacks webapp bundle for a given plugin id on disk.
type ErrorString ¶
ErrorString is a fallback for sending unregistered implementations of the error interface across rpc. For example, the errorString type from the github.com/pkg/errors package cannot be registered since it is not exported, but this precludes common error handling paradigms. ErrorString merely preserves the string description of the error, while satisfying the error interface itself to allow other registered types (such as model.AppError) to be sent unmodified.
func (ErrorString) Error ¶
func (e ErrorString) Error() string
type HTTPRequestSubset ¶ added in v0.1.11
type HTTPRequestSubset struct {
Method string
URL *url.URL
Proto string
ProtoMajor int
ProtoMinor int
Header http.Header
Host string
RemoteAddr string
RequestURI string
Body io.ReadCloser
}
Using a subset of http.Request prevents a known incompatibility when decoding Go v1.23+ gob-encoded x509.Certificate structs from Go v1.22 compiled plugins. These come from http.Request.TLS field (*tls.ConnectionState).
func (*HTTPRequestSubset) GetHTTPRequest ¶ added in v0.1.11
func (r *HTTPRequestSubset) GetHTTPRequest() *http.Request
type Hooks ¶
type Hooks interface {
// OnActivate is invoked when the plugin is activated. If an error is returned, the plugin
// will be terminated. The plugin will not receive hooks until after OnActivate returns
// without error. OnConfigurationChange will be called once before OnActivate.
//
// Minimum server version: 5.2
OnActivate() error
// Implemented returns a list of hooks that are implemented by the plugin.
// Plugins do not need to provide an implementation. Any given will be ignored.
//
// Minimum server version: 5.2
Implemented() ([]string, error)
// OnDeactivate is invoked when the plugin is deactivated. This is the plugin's last chance to
// use the API, and the plugin will be terminated shortly after this invocation. The plugin
// will stop receiving hooks just prior to this method being called.
//
// Minimum server version: 5.2
OnDeactivate() error
// OnConfigurationChange is invoked when configuration changes may have been made. Any
// returned error is logged, but does not stop the plugin. You must be prepared to handle
// a configuration failure gracefully. It is called once before OnActivate.
//
// Minimum server version: 5.2
OnConfigurationChange() error
// ServeHTTP allows the plugin to implement the http.Handler interface. Requests destined for
// the /plugins/{id} path will be routed to the plugin.
//
// The Mattermost-User-Id header will be present if (and only if) the request is by an
// authenticated user.
//
// Minimum server version: 5.2
ServeHTTP(c *Context, w http.ResponseWriter, r *http.Request)
// ExecuteCommand executes a command that has been previously registered via the RegisterCommand
// API.
//
// Minimum server version: 5.2
ExecuteCommand(c *Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
// UserHasBeenCreated is invoked after a user was created.
//
// Minimum server version: 5.10
UserHasBeenCreated(c *Context, user *model.User)
// UserWillLogIn before the login of the user is returned. Returning a non empty string will reject the login event.
// If you don't need to reject the login event, see UserHasLoggedIn
//
// Minimum server version: 5.2
UserWillLogIn(c *Context, user *model.User) string
// UserHasLoggedIn is invoked after a user has logged in.
//
// Minimum server version: 5.2
UserHasLoggedIn(c *Context, user *model.User)
// MessageWillBePosted is invoked when a message is posted by a user before it is committed
// to the database. If you also want to act on edited posts, see MessageWillBeUpdated.
//
// To reject a post, return an non-empty string describing why the post was rejected.
// To modify the post, return the replacement, non-nil *model.Post and an empty string.
// To allow the post without modification, return a nil *model.Post and an empty string.
// To dismiss the post, return a nil *model.Post and the const DismissPostError string.
//
// If you don't need to modify or reject posts, use MessageHasBeenPosted instead.
//
// Note that this method will be called for posts created by plugins, including the plugin that
// created the post.
//
// Minimum server version: 5.2
MessageWillBePosted(c *Context, post *model.Post) (*model.Post, string)
// MessageWillBeUpdated is invoked when a message is updated by a user before it is committed
// to the database. If you also want to act on new posts, see MessageWillBePosted.
// Return values should be the modified post or nil if rejected and an explanation for the user.
// On rejection, the post will be kept in its previous state.
//
// If you don't need to modify or rejected updated posts, use MessageHasBeenUpdated instead.
//
// Note that this method will be called for posts updated by plugins, including the plugin that
// updated the post.
//
// Minimum server version: 5.2
MessageWillBeUpdated(c *Context, newPost, oldPost *model.Post) (*model.Post, string)
// MessageHasBeenPosted is invoked after the message has been committed to the database.
// If you need to modify or reject the post, see MessageWillBePosted
// Note that this method will be called for posts created by plugins, including the plugin that
// created the post.
//
// Minimum server version: 5.2
MessageHasBeenPosted(c *Context, post *model.Post)
// MessageHasBeenUpdated is invoked after a message is updated and has been updated in the database.
// If you need to modify or reject the post, see MessageWillBeUpdated
// Note that this method will be called for posts created by plugins, including the plugin that
// created the post.
//
// Minimum server version: 5.2
MessageHasBeenUpdated(c *Context, newPost, oldPost *model.Post)
// MessagesWillBeConsumed is invoked when a message is requested by a client before it is returned
// to the client
//
// Note that this method will be called for posts created by plugins, including the plugin that
// created the post.
//
// Minimum server version: 9.3
MessagesWillBeConsumed(posts []*model.Post) []*model.Post
// MessageHasBeenDeleted is invoked after the message has been deleted from the database.
// Note that this method will be called for posts deleted by plugins, including the plugin that
// deleted the post.
//
// Minimum server version: 9.1
MessageHasBeenDeleted(c *Context, post *model.Post)
// ChannelHasBeenCreated is invoked after the channel has been committed to the database.
//
// Minimum server version: 5.2
ChannelHasBeenCreated(c *Context, channel *model.Channel)
// ChannelWillBeArchived is invoked before a channel is archived, allowing plugins to
// reject the archive operation.
//
// To reject the archive, return a non-empty string describing why it was rejected.
// To allow the archive, return an empty string.
//
// Minimum server version: 11.7
ChannelWillBeArchived(c *Context, channel *model.Channel) string
// ChannelMemberWillBeAdded is invoked before a member is added to a channel, allowing
// plugins to modify the channel member or reject the addition.
//
// To reject the addition, return a non-empty string describing why it was rejected.
// To modify the member, return the replacement, non-nil *model.ChannelMember and an empty string.
// To allow the addition without modification, return a nil *model.ChannelMember and an empty string.
//
// Minimum server version: 11.7
ChannelMemberWillBeAdded(c *Context, channelMember *model.ChannelMember) (*model.ChannelMember, string)
// UserHasJoinedChannel is invoked after the membership has been committed to the database.
// If actor is not nil, the user was invited to the channel by the actor.
//
// Minimum server version: 5.2
UserHasJoinedChannel(c *Context, channelMember *model.ChannelMember, actor *model.User)
// UserHasLeftChannel is invoked after the membership has been removed from the database.
// If actor is not nil, the user was removed from the channel by the actor.
//
// Minimum server version: 5.2
UserHasLeftChannel(c *Context, channelMember *model.ChannelMember, actor *model.User)
// TeamMemberWillBeAdded is invoked before a member is added to a team, allowing
// plugins to modify the team member or reject the addition.
//
// To reject the addition, return a non-empty string describing why it was rejected.
// To modify the member, return the replacement, non-nil *model.TeamMember and an empty string.
// To allow the addition without modification, return a nil *model.TeamMember and an empty string.
//
// Minimum server version: 11.7
TeamMemberWillBeAdded(c *Context, teamMember *model.TeamMember) (*model.TeamMember, string)
// UserHasJoinedTeam is invoked after the membership has been committed to the database.
// If actor is not nil, the user was added to the team by the actor.
//
// Minimum server version: 5.2
UserHasJoinedTeam(c *Context, teamMember *model.TeamMember, actor *model.User)
// UserHasLeftTeam is invoked after the membership has been removed from the database.
// If actor is not nil, the user was removed from the team by the actor.
//
// Minimum server version: 5.2
UserHasLeftTeam(c *Context, teamMember *model.TeamMember, actor *model.User)
// FileWillBeUploaded is invoked when a file is uploaded, but before it is committed to backing store.
// Read from file to retrieve the body of the uploaded file.
//
// To reject a file upload, return an non-empty string describing why the file was rejected.
// To modify the file, write to the output and/or return a non-nil *model.FileInfo, as well as an empty string.
// To allow the file without modification, do not write to the output and return a nil *model.FileInfo and an empty string.
//
// Note that this method will be called for files uploaded by plugins, including the plugin that uploaded the post.
// FileInfo.Size will be automatically set properly if you modify the file.
//
// Minimum server version: 5.2
FileWillBeUploaded(c *Context, info *model.FileInfo, file io.Reader, output io.Writer) (*model.FileInfo, string)
// FileWillBeDownloaded is invoked when a file is requested for download, but before it is sent to the client.
//
// To reject a file download, return an non-empty string describing why the file was rejected.
// To allow the download, return an empty string.
//
// The downloadType parameter indicates the type of file access and can be one of:
// - model.FileDownloadTypeFile: Full file download
// - model.FileDownloadTypeThumbnail: Thumbnail request
// - model.FileDownloadTypePreview: Preview image request
// - model.FileDownloadTypePublic: Public link access (userID will be empty string in this case)
//
// Minimum server version: 11.5
FileWillBeDownloaded(c *Context, fileInfo *model.FileInfo, userID string, downloadType model.FileDownloadType) string
// ReactionHasBeenAdded is invoked after the reaction has been committed to the database.
//
// Note that this method will be called for reactions added by plugins, including the plugin that
// added the reaction.
//
// Minimum server version: 5.30
ReactionHasBeenAdded(c *Context, reaction *model.Reaction)
// ReactionHasBeenRemoved is invoked after the removal of the reaction has been committed to the database.
//
// Note that this method will be called for reactions removed by plugins, including the plugin that
// removed the reaction.
//
// Minimum server version: 5.30
ReactionHasBeenRemoved(c *Context, reaction *model.Reaction)
// OnPluginClusterEvent is invoked when an intra-cluster plugin event is received.
//
// This is used to allow communication between multiple instances of the same plugin
// that are running on separate nodes of the same High-Availability cluster.
// This hook receives events sent by a call to PublishPluginClusterEvent.
//
// Minimum server version: 5.36
OnPluginClusterEvent(c *Context, ev model.PluginClusterEvent)
// OnWebSocketConnect is invoked when a new websocket connection is opened.
//
// This is used to track which users have connections opened with the Mattermost
// websocket.
//
// Minimum server version: 6.0
OnWebSocketConnect(webConnID, userID string)
// OnWebSocketDisconnect is invoked when a websocket connection is closed.
//
// This is used to track which users have connections opened with the Mattermost
// websocket.
//
// Minimum server version: 6.0
OnWebSocketDisconnect(webConnID, userID string)
// WebSocketMessageHasBeenPosted is invoked when a websocket message is received.
//
// Minimum server version: 6.0
WebSocketMessageHasBeenPosted(webConnID, userID string, req *model.WebSocketRequest)
// RunDataRetention is invoked during a DataRetentionJob.
//
// Minimum server version: 6.4
RunDataRetention(nowTime, batchSize int64) (int64, error)
// OnInstall is invoked after the installation of a plugin as part of the onboarding.
// It's called on every installation, not only once.
//
// In the future, other plugin installation methods will trigger this hook, e.g. an installation via the Marketplace.
//
// Minimum server version: 6.5
OnInstall(c *Context, event model.OnInstallEvent) error
// OnSendDailyTelemetry is invoked when the server send the daily telemetry data.
//
// Minimum server version: 6.5
OnSendDailyTelemetry()
// OnCloudLimitsUpdated is invoked product limits change, for example when plan tiers change
//
// Minimum server version: 7.0
OnCloudLimitsUpdated(limits *model.ProductLimits)
// ConfigurationWillBeSaved is invoked before saving the configuration to the
// backing store.
// An error can be returned to reject the operation. Additionally, a new
// config object can be returned to be stored in place of the provided one.
// Minimum server version: 8.0
ConfigurationWillBeSaved(newCfg *model.Config) (*model.Config, error)
// EmailNotificationWillBeSent is invoked before an email notification is sent to a user.
// This allows plugins to customize the email notification content including subject,
// title, subtitle, message content, buttons, and other email properties.
//
// To reject an email notification, return an non-empty string describing why the notification was rejected.
// To modify the notification, return the replacement, non-nil *model.EmailNotificationContent and an empty string.
// To allow the notification without modification, return a nil *model.EmailNotificationContent and an empty string.
//
// Note that core identifiers (PostId, ChannelId, TeamId, SenderId, RecipientId, RootId) and
// context fields (ChannelType, IsDirectMessage, etc.) are immutable and changes to them will be ignored.
// Only customizable content fields can be modified.
//
// Minimum server version: 11.00
EmailNotificationWillBeSent(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string)
// NotificationWillBePushed is invoked before a push notification is sent to the push
// notification server.
//
// To reject a notification, return an non-empty string describing why the notification was rejected.
// To modify the notification, return the replacement, non-nil *model.PushNotification and an empty string.
// To allow the notification without modification, return a nil *model.PushNotification and an empty string.
//
// Note that this method will be called for push notifications created by plugins, including the plugin that
// created the notification.
//
// Minimum server version: 9.0
NotificationWillBePushed(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string)
// UserHasBeenDeactivated is invoked when a user is deactivated.
//
// Minimum server version: 9.1
UserHasBeenDeactivated(c *Context, user *model.User)
// ServeMetrics allows plugins to expose their own metrics endpoint through
// the server's metrics HTTP listener (e.g. "localhost:8067").
// Requests destined to the /plugins/{id}/metrics path will be routed to the plugin.
//
// Minimum server version: 9.2
ServeMetrics(c *Context, w http.ResponseWriter, r *http.Request)
// Shared Channels service for which they have been invited via InviteRemote. Each SyncMsg may contain
// multiple updates (posts, reactions, attachments, users) for a single channel.
//
// The cursor will be advanced based on the SyncResponse returned.
//
// Minimum server version: 9.5
OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
// to the upstream service (e.g. MS Graph APIs).
//
// Return true to indicate all is well.
//
// Return false to indicate there is a problem with the plugin or connection to upstream service.
// Some number of failed pings will result in the plugin being marked offline and it will stop receiving
// OnSharedChannelsSyncMsg calls until it comes back online. The plugin will also appear offline in the status
// report via the `secure-connection status` slash command.
//
// Minimum server version: 9.5
OnSharedChannelsPing(rc *model.RemoteCluster) bool
// PreferencesHaveChanged is invoked after one or more of a user's preferences have changed.
// Note that this method will be called for preferences changed by plugins, including the plugin that changed
// the preferences.
//
// Minimum server version: 9.5
PreferencesHaveChanged(c *Context, preferences []model.Preference)
// Shared Channels service for which they have been invited via InviteRemote. Each call represents one file attachment
// to be synchronized.
//
// The cursor will be advanced based on the timestamp returned if no error is returned.
//
// Minimum server version: 9.5
OnSharedChannelsAttachmentSyncMsg(fi *model.FileInfo, post *model.Post, rc *model.RemoteCluster) error
// Shared Channels service for which they have been invited via InviteRemote. Each call represents one user profile
// image that should be synchronized. `App.GetProfileImage` can be used to fetch the image bytes.
//
// The cursor will be advanced based on the timestamp returned if no error is returned.
//
// Minimum server version: 9.5
OnSharedChannelsProfileImageSyncMsg(user *model.User, rc *model.RemoteCluster) error
// GenerateSupportData is invoked when a Support Packet gets generated.
// It allows plugins to include their own content in the Support Packet.
//
// Plugins may specififes a "support_packet" field in the manifest props with a custom text.
// By doing so, the plugin will be included in the Support Packet UI and the user will be able to select it.
// This hook will only be called, if the user selects the plugin in the Support Packet UI.
//
// If no "support_packet" is specified, this hook will always be called.
//
// Minimum server version: 9.8
GenerateSupportData(c *Context) ([]*model.FileData, error)
// OnSAMLLogin is invoked after a successful SAML login.
//
// Minimum server version: 10.7
OnSAMLLogin(c *Context, user *model.User, assertion *saml2.AssertionInfo) error
// ChannelWillBeUpdated is invoked before a channel update is committed, allowing plugins to
// modify the channel or reject the update.
//
// To reject the update, return a non-empty string describing why. To modify the channel, return
// the replacement *model.Channel and an empty string. To allow the update without modification,
// return nil and an empty string.
//
// Fires from the app-layer UpdateChannel and PatchChannel paths so REST, local API, plugin API,
// import, and bulk callers all hit it.
//
// Minimum server version: 11.8
ChannelWillBeUpdated(c *Context, newChannel, oldChannel *model.Channel) (*model.Channel, string)
// ChannelWillBeRestored is invoked before an archived channel is un-archived. Fires from
// app.RestoreChannel before the store's Channel().Restore call. Sibling of
// ChannelWillBeArchived for the inverse operation.
//
// To reject, return a non-empty string. Empty string allows the restore.
//
// Minimum server version: 11.8
ChannelWillBeRestored(c *Context, channel *model.Channel) string
// ScheduledPostWillBeCreated is invoked before a scheduled post is committed. Fires from the
// app-layer SaveScheduledPost and UpdateScheduledPost paths.
//
// Return value semantics match MessageWillBePosted.
//
// Minimum server version: 11.8
ScheduledPostWillBeCreated(c *Context, scheduledPost *model.ScheduledPost) (*model.ScheduledPost, string)
// DraftWillBeUpserted is invoked before a draft is committed. Fires from the app-layer
// UpsertDraft path.
//
// Return value semantics match MessageWillBePosted.
//
// Minimum server version: 11.8
DraftWillBeUpserted(c *Context, draft *model.Draft) (*model.Draft, string)
}
Hooks describes the methods a plugin may implement to automatically receive the corresponding event.
A plugin only need implement the hooks it cares about. The MattermostPlugin provides some default implementations for convenience but may be overridden.
type HooksWithRPCErr ¶ added in v0.4.0
type HooksWithRPCErr interface {
HooksWithRPCErrGenerated
MessageWillBePostedWithRPCErr(c *Context, post *model.Post) (*model.Post, string, error)
MessageWillBeUpdatedWithRPCErr(c *Context, newPost, oldPost *model.Post) (*model.Post, string, error)
ChannelMemberWillBeAddedWithRPCErr(c *Context, channelMember *model.ChannelMember) (*model.ChannelMember, string, error)
}
HooksWithRPCErr extends HooksWithRPCErrGenerated with *WithRPCErr companions for the three hooks whose base stubs are hand-written in this file. The auto-generated HooksWithRPCErrGenerated in client_rpc_generated.go cannot include these because the generator skips excluded hooks. Returned by Environment.HooksForPluginWithRPCErr so callers can invoke any *WithRPCErr method without a type assertion.
type HooksWithRPCErrGenerated ¶ added in v0.4.1
type HooksWithRPCErrGenerated interface {
OnDeactivateWithRPCErr() (error, error)
OnConfigurationChangeWithRPCErr() (error, error)
ExecuteCommandWithRPCErr(c *Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError, error)
UserHasBeenCreatedWithRPCErr(c *Context, user *model.User) error
UserWillLogInWithRPCErr(c *Context, user *model.User) (string, error)
UserHasLoggedInWithRPCErr(c *Context, user *model.User) error
MessageHasBeenPostedWithRPCErr(c *Context, post *model.Post) error
MessageHasBeenUpdatedWithRPCErr(c *Context, newPost, oldPost *model.Post) error
MessageHasBeenDeletedWithRPCErr(c *Context, post *model.Post) error
ChannelHasBeenCreatedWithRPCErr(c *Context, channel *model.Channel) error
ChannelWillBeArchivedWithRPCErr(c *Context, channel *model.Channel) (string, error)
UserHasJoinedChannelWithRPCErr(c *Context, channelMember *model.ChannelMember, actor *model.User) error
UserHasLeftChannelWithRPCErr(c *Context, channelMember *model.ChannelMember, actor *model.User) error
UserHasJoinedTeamWithRPCErr(c *Context, teamMember *model.TeamMember, actor *model.User) error
UserHasLeftTeamWithRPCErr(c *Context, teamMember *model.TeamMember, actor *model.User) error
FileWillBeDownloadedWithRPCErr(c *Context, fileInfo *model.FileInfo, userID string, downloadType model.FileDownloadType) (string, error)
ReactionHasBeenAddedWithRPCErr(c *Context, reaction *model.Reaction) error
ReactionHasBeenRemovedWithRPCErr(c *Context, reaction *model.Reaction) error
OnPluginClusterEventWithRPCErr(c *Context, ev model.PluginClusterEvent) error
OnWebSocketConnectWithRPCErr(webConnID, userID string) error
OnWebSocketDisconnectWithRPCErr(webConnID, userID string) error
WebSocketMessageHasBeenPostedWithRPCErr(webConnID, userID string, req *model.WebSocketRequest) error
RunDataRetentionWithRPCErr(nowTime, batchSize int64) (int64, error, error)
OnInstallWithRPCErr(c *Context, event model.OnInstallEvent) (error, error)
OnSendDailyTelemetryWithRPCErr() error
OnCloudLimitsUpdatedWithRPCErr(limits *model.ProductLimits) error
ConfigurationWillBeSavedWithRPCErr(newCfg *model.Config) (*model.Config, error, error)
EmailNotificationWillBeSentWithRPCErr(emailNotification *model.EmailNotification) (*model.EmailNotificationContent, string, error)
NotificationWillBePushedWithRPCErr(pushNotification *model.PushNotification, userID string) (*model.PushNotification, string, error)
UserHasBeenDeactivatedWithRPCErr(c *Context, user *model.User) error
PreferencesHaveChangedWithRPCErr(c *Context, preferences []model.Preference) error
GenerateSupportDataWithRPCErr(c *Context) ([]*model.FileData, error, error)
OnSAMLLoginWithRPCErr(c *Context, user *model.User, assertion *saml2.AssertionInfo) (error, error)
ChannelWillBeUpdatedWithRPCErr(c *Context, newChannel, oldChannel *model.Channel) (*model.Channel, string, error)
ChannelWillBeRestoredWithRPCErr(c *Context, channel *model.Channel) (string, error)
ScheduledPostWillBeCreatedWithRPCErr(c *Context, scheduledPost *model.ScheduledPost) (*model.ScheduledPost, string, error)
DraftWillBeUpsertedWithRPCErr(c *Context, draft *model.Draft) (*model.Draft, string, error)
}
HooksWithRPCErrGenerated provides a WithRPCErr variant for every generated hook. The last error return is always the RPC transport error — if non-nil, the plugin's other return values are zero. For hooks whose base signature already returns error, the tuple is (originalReturns..., rpcErr) where the final slot is always transport.
If the plugin does not implement the hook, the companion returns zero values and a nil error — indistinguishable from a successful invocation that returned zeros. Callers MUST gate on supervisor.Implements(<HookID>) (or use Environment.RunMultiPluginHookWithRPCErr, which gates by the iteration's hook ID — note that any *WithRPCErr method called on the closure's HooksWithRPCErrGenerated is independently subject to its own implemented-gate).
type MattermostPlugin ¶
type MattermostPlugin struct {
// API exposes the plugin api, and becomes available just prior to the OnActive hook.
API API
Driver Driver
}
func (*MattermostPlugin) SetAPI ¶
func (p *MattermostPlugin) SetAPI(api API)
SetAPI persists the given API interface to the plugin. It is invoked just prior to the OnActivate hook, exposing the API for use by the plugin.
func (*MattermostPlugin) SetDriver ¶
func (p *MattermostPlugin) SetDriver(driver Driver)
SetDriver sets the RPC client implementation to talk with the server.
type PluginHealthCheckJob ¶
type PluginHealthCheckJob struct {
// contains filtered or unexported fields
}
func (*PluginHealthCheckJob) Cancel ¶
func (job *PluginHealthCheckJob) Cancel()
func (*PluginHealthCheckJob) CheckPlugin ¶
func (job *PluginHealthCheckJob) CheckPlugin(id string)
CheckPlugin determines the plugin's health status, then handles the error or success case. If the plugin passes the health check, do nothing. If the plugin fails the health check, the function either restarts or deactivates the plugin, based on the quantity and frequency of its failures.
type PrepackagedPlugin ¶
type PrepackagedPlugin struct {
Path string
IconData string
Manifest *model.Manifest
SignaturePath string
}
PrepackagedPlugin is a plugin prepackaged with the server and found on startup.
type ResultContainer ¶
type ResultContainer struct {
LastID int64
LastIDError error
RowsAffected int64
RowsAffectedError error
}
ResultContainer contains the output from the LastInsertID and RowsAffected methods for a given set of rows. It is used to embed another round-trip to the server, and helping to avoid tracking results on the server.
type Z_AddChannelMemberArgs ¶
type Z_AddChannelMemberReturns ¶
type Z_AddChannelMemberReturns struct {
A *model.ChannelMember
B *model.AppError
}
type Z_AddReactionArgs ¶
type Z_AddReactionReturns ¶
type Z_AddUserToChannelArgs ¶
type Z_AddUserToChannelReturns ¶
type Z_AddUserToChannelReturns struct {
A *model.ChannelMember
B *model.AppError
}
type Z_ChannelHasBeenCreatedReturns ¶
type Z_ChannelHasBeenCreatedReturns struct {
}
type Z_ChannelMemberWillBeAddedArgs ¶ added in v0.3.0
type Z_ChannelMemberWillBeAddedArgs struct {
A *Context
B *model.ChannelMember
}
type Z_ChannelMemberWillBeAddedReturns ¶ added in v0.3.0
type Z_ChannelMemberWillBeAddedReturns struct {
A *model.ChannelMember
B string
}
type Z_ChannelWillBeArchivedArgs ¶ added in v0.3.0
type Z_ChannelWillBeArchivedReturns ¶ added in v0.3.0
type Z_ChannelWillBeArchivedReturns struct {
A string
}
type Z_ChannelWillBeRestoredArgs ¶ added in v0.4.1
type Z_ChannelWillBeRestoredReturns ¶ added in v0.4.1
type Z_ChannelWillBeRestoredReturns struct {
A string
}
type Z_ChannelWillBeUpdatedArgs ¶ added in v0.4.1
type Z_ChannelWillBeUpdatedReturns ¶ added in v0.4.1
type Z_CopyFileInfosArgs ¶
type Z_CopyFileInfosReturns ¶
type Z_CountPropertyFieldsArgs ¶ added in v0.1.19
type Z_CountPropertyFieldsForTargetArgs ¶ added in v0.1.19
type Z_CountPropertyFieldsForTargetReturns ¶ added in v0.1.19
type Z_CountPropertyFieldsReturns ¶ added in v0.1.19
type Z_CreateBotArgs ¶
type Z_CreateChannelArgs ¶
type Z_CreateChannelReturns ¶
type Z_CreateChannelSidebarCategoryArgs ¶
type Z_CreateChannelSidebarCategoryArgs struct {
A string
B string
C *model.SidebarCategoryWithChannels
}
type Z_CreateChannelSidebarCategoryReturns ¶
type Z_CreateChannelSidebarCategoryReturns struct {
A *model.SidebarCategoryWithChannels
B *model.AppError
}
type Z_CreateCommandArgs ¶
type Z_CreateCommandReturns ¶
type Z_CreateDefaultSyncableMembershipsArgs ¶ added in v0.1.14
type Z_CreateDefaultSyncableMembershipsArgs struct {
A model.CreateDefaultMembershipParams
}
type Z_CreateDefaultSyncableMembershipsReturns ¶ added in v0.1.14
type Z_CreateGroupArgs ¶ added in v0.1.11
type Z_CreateGroupReturns ¶ added in v0.1.11
type Z_CreateOAuthAppArgs ¶
type Z_CreateOAuthAppReturns ¶
type Z_CreatePostArgs ¶
type Z_CreatePropertyFieldArgs ¶ added in v0.1.15
type Z_CreatePropertyFieldArgs struct {
A *model.PropertyField
}
type Z_CreatePropertyFieldReturns ¶ added in v0.1.15
type Z_CreatePropertyFieldReturns struct {
A *model.PropertyField
B error
}
type Z_CreatePropertyValueArgs ¶ added in v0.1.15
type Z_CreatePropertyValueArgs struct {
A *model.PropertyValue
}
type Z_CreatePropertyValueReturns ¶ added in v0.1.15
type Z_CreatePropertyValueReturns struct {
A *model.PropertyValue
B error
}
type Z_CreateSessionArgs ¶
type Z_CreateSessionReturns ¶
type Z_CreateTeamArgs ¶
type Z_CreateTeamMemberArgs ¶
type Z_CreateTeamMemberReturns ¶
type Z_CreateTeamMemberReturns struct {
A *model.TeamMember
B *model.AppError
}
type Z_CreateTeamMembersArgs ¶
type Z_CreateTeamMembersGracefullyReturns ¶
type Z_CreateTeamMembersGracefullyReturns struct {
A []*model.TeamMemberWithError
B *model.AppError
}
type Z_CreateTeamMembersReturns ¶
type Z_CreateTeamMembersReturns struct {
A []*model.TeamMember
B *model.AppError
}
type Z_CreateUploadSessionArgs ¶
type Z_CreateUploadSessionArgs struct {
A *model.UploadSession
}
type Z_CreateUploadSessionReturns ¶
type Z_CreateUploadSessionReturns struct {
A *model.UploadSession
B error
}
type Z_CreateUserAccessTokenArgs ¶
type Z_CreateUserAccessTokenArgs struct {
A *model.UserAccessToken
}
type Z_CreateUserAccessTokenReturns ¶
type Z_CreateUserAccessTokenReturns struct {
A *model.UserAccessToken
B *model.AppError
}
type Z_CreateUserArgs ¶
type Z_DbBoolReturn ¶
type Z_DbBoolReturn struct {
A bool
}
type Z_DbConnArgs ¶
type Z_DbConnArgs struct {
A string
B string
C []driver.NamedValue
}
type Z_DbErrReturn ¶
type Z_DbErrReturn struct {
A error
}
type Z_DbInt64ErrReturn ¶
type Z_DbIntReturn ¶
type Z_DbIntReturn struct {
A int
}
type Z_DbResultContErrReturn ¶
type Z_DbResultContErrReturn struct {
A ResultContainer
B error
}
type Z_DbRowScanArg ¶
type Z_DbRowScanReturn ¶
type Z_DbRowsColumnArg ¶
type Z_DbStmtArgs ¶
type Z_DbStmtQueryArgs ¶
type Z_DbStmtQueryArgs struct {
A string
B []driver.NamedValue
}
type Z_DbStrErrReturn ¶
type Z_DbStrSliceReturn ¶
type Z_DbStrSliceReturn struct {
A []string
}
type Z_DbTxArgs ¶
type Z_DeleteChannelArgs ¶
type Z_DeleteChannelArgs struct {
A string
}
type Z_DeleteChannelReturns ¶
type Z_DeleteCommandArgs ¶
type Z_DeleteCommandArgs struct {
A string
}
type Z_DeleteCommandReturns ¶
type Z_DeleteCommandReturns struct {
A error
}
type Z_DeleteEphemeralPostReturns ¶
type Z_DeleteEphemeralPostReturns struct {
}
type Z_DeleteGroupArgs ¶ added in v0.1.11
type Z_DeleteGroupArgs struct {
A string
}
type Z_DeleteGroupConstrainedMembershipsArgs ¶ added in v0.1.14
type Z_DeleteGroupConstrainedMembershipsArgs struct {
}
type Z_DeleteGroupConstrainedMembershipsReturns ¶ added in v0.1.14
type Z_DeleteGroupMemberArgs ¶ added in v0.1.11
type Z_DeleteGroupMemberReturns ¶ added in v0.1.11
type Z_DeleteGroupMemberReturns struct {
A *model.GroupMember
B *model.AppError
}
type Z_DeleteGroupReturns ¶ added in v0.1.11
type Z_DeleteGroupSyncableArgs ¶ added in v0.1.11
type Z_DeleteGroupSyncableArgs struct {
A string
B string
C model.GroupSyncableType
}
type Z_DeleteGroupSyncableReturns ¶ added in v0.1.11
type Z_DeleteGroupSyncableReturns struct {
A *model.GroupSyncable
B *model.AppError
}
type Z_DeleteOAuthAppArgs ¶
type Z_DeleteOAuthAppArgs struct {
A string
}
type Z_DeleteOAuthAppReturns ¶
type Z_DeletePostArgs ¶
type Z_DeletePostArgs struct {
A string
}
type Z_DeletePostReturns ¶
type Z_DeletePreferencesForUserArgs ¶
type Z_DeletePreferencesForUserArgs struct {
A string
B []model.Preference
}
type Z_DeletePropertyFieldArgs ¶ added in v0.1.15
type Z_DeletePropertyFieldReturns ¶ added in v0.1.15
type Z_DeletePropertyFieldReturns struct {
A error
}
type Z_DeletePropertyValueArgs ¶ added in v0.1.15
type Z_DeletePropertyValueReturns ¶ added in v0.1.15
type Z_DeletePropertyValueReturns struct {
A error
}
type Z_DeletePropertyValuesForFieldArgs ¶ added in v0.1.15
type Z_DeletePropertyValuesForFieldReturns ¶ added in v0.1.15
type Z_DeletePropertyValuesForFieldReturns struct {
A error
}
type Z_DeletePropertyValuesForTargetArgs ¶ added in v0.1.15
type Z_DeletePropertyValuesForTargetReturns ¶ added in v0.1.15
type Z_DeletePropertyValuesForTargetReturns struct {
A error
}
type Z_DeleteTeamArgs ¶
type Z_DeleteTeamArgs struct {
A string
}
type Z_DeleteTeamMemberArgs ¶
type Z_DeleteTeamReturns ¶
type Z_DeleteUserArgs ¶
type Z_DeleteUserArgs struct {
A string
}
type Z_DeleteUserReturns ¶
type Z_DisablePluginArgs ¶
type Z_DisablePluginArgs struct {
A string
}
type Z_DisablePluginReturns ¶
type Z_DraftWillBeUpsertedArgs ¶ added in v0.4.1
type Z_DraftWillBeUpsertedReturns ¶ added in v0.4.1
type Z_EmailNotificationWillBeSentArgs ¶ added in v0.1.17
type Z_EmailNotificationWillBeSentArgs struct {
A *model.EmailNotification
}
type Z_EmailNotificationWillBeSentReturns ¶ added in v0.1.17
type Z_EmailNotificationWillBeSentReturns struct {
A *model.EmailNotificationContent
B string
}
type Z_EnablePluginArgs ¶
type Z_EnablePluginArgs struct {
A string
}
type Z_EnablePluginReturns ¶
type Z_EnsureBotUserArgs ¶
type Z_EnsureBotUserReturns ¶
type Z_ExecuteCommandArgs ¶
type Z_ExecuteCommandArgs struct {
A *Context
B *model.CommandArgs
}
type Z_ExecuteCommandReturns ¶
type Z_ExecuteCommandReturns struct {
A *model.CommandResponse
B *model.AppError
}
type Z_ExecuteSlashCommandArgs ¶
type Z_ExecuteSlashCommandArgs struct {
A *model.CommandArgs
}
type Z_ExecuteSlashCommandReturns ¶
type Z_ExecuteSlashCommandReturns struct {
A *model.CommandResponse
B error
}
type Z_FileWillBeDownloadedArgs ¶ added in v0.2.0
type Z_FileWillBeDownloadedReturns ¶ added in v0.2.0
type Z_FileWillBeDownloadedReturns struct {
A string
}
type Z_GenerateSupportDataArgs ¶ added in v0.0.18
type Z_GenerateSupportDataArgs struct {
A *Context
}
type Z_GenerateSupportDataReturns ¶ added in v0.0.18
type Z_GetBotArgs ¶
type Z_GetBotsArgs ¶
type Z_GetBotsArgs struct {
A *model.BotGetOptions
}
type Z_GetBundlePathArgs ¶
type Z_GetBundlePathArgs struct {
}
type Z_GetBundlePathReturns ¶
type Z_GetChannelArgs ¶
type Z_GetChannelArgs struct {
A string
}
type Z_GetChannelByNameArgs ¶
type Z_GetChannelMemberArgs ¶
type Z_GetChannelMemberReturns ¶
type Z_GetChannelMemberReturns struct {
A *model.ChannelMember
B *model.AppError
}
type Z_GetChannelMembersArgs ¶
type Z_GetChannelMembersByIdsReturns ¶
type Z_GetChannelMembersByIdsReturns struct {
A model.ChannelMembers
B *model.AppError
}
type Z_GetChannelMembersForUserReturns ¶
type Z_GetChannelMembersForUserReturns struct {
A []*model.ChannelMember
B *model.AppError
}
type Z_GetChannelMembersReturns ¶
type Z_GetChannelMembersReturns struct {
A model.ChannelMembers
B *model.AppError
}
type Z_GetChannelSidebarCategoriesReturns ¶
type Z_GetChannelSidebarCategoriesReturns struct {
A *model.OrderedSidebarCategories
B *model.AppError
}
type Z_GetChannelStatsArgs ¶
type Z_GetChannelStatsArgs struct {
A string
}
type Z_GetChannelStatsReturns ¶
type Z_GetChannelStatsReturns struct {
A *model.ChannelStats
B *model.AppError
}
type Z_GetCloudLimitsArgs ¶
type Z_GetCloudLimitsArgs struct {
}
type Z_GetCloudLimitsReturns ¶
type Z_GetCloudLimitsReturns struct {
A *model.ProductLimits
B error
}
type Z_GetCommandArgs ¶
type Z_GetCommandArgs struct {
A string
}
type Z_GetCommandReturns ¶
type Z_GetConfigArgs ¶
type Z_GetConfigArgs struct {
}
type Z_GetConfigReturns ¶
type Z_GetDiagnosticIdArgs ¶
type Z_GetDiagnosticIdArgs struct {
}
type Z_GetDiagnosticIdReturns ¶
type Z_GetDiagnosticIdReturns struct {
A string
}
type Z_GetDirectChannelArgs ¶
type Z_GetEmojiArgs ¶
type Z_GetEmojiArgs struct {
A string
}
type Z_GetEmojiByNameArgs ¶
type Z_GetEmojiByNameArgs struct {
A string
}
type Z_GetEmojiByNameReturns ¶
type Z_GetEmojiImageArgs ¶
type Z_GetEmojiImageArgs struct {
A string
}
type Z_GetEmojiImageReturns ¶
type Z_GetEmojiListArgs ¶
type Z_GetEmojiListReturns ¶
type Z_GetFileArgs ¶
type Z_GetFileArgs struct {
A string
}
type Z_GetFileInfoArgs ¶
type Z_GetFileInfoArgs struct {
A string
}
type Z_GetFileInfoReturns ¶
type Z_GetFileInfosArgs ¶
type Z_GetFileInfosArgs struct {
A int
B int
C *model.GetFileInfosOptions
}
type Z_GetFileInfosReturns ¶
type Z_GetFileLinkArgs ¶
type Z_GetFileLinkArgs struct {
A string
}
type Z_GetFileLinkReturns ¶
type Z_GetFileReturns ¶
type Z_GetGroupArgs ¶
type Z_GetGroupArgs struct {
A string
}
type Z_GetGroupByNameArgs ¶
type Z_GetGroupByNameArgs struct {
A string
}
type Z_GetGroupByNameReturns ¶
type Z_GetGroupByRemoteIDArgs ¶ added in v0.1.11
type Z_GetGroupByRemoteIDArgs struct {
A string
B model.GroupSource
}
type Z_GetGroupByRemoteIDReturns ¶ added in v0.1.11
type Z_GetGroupChannelArgs ¶
type Z_GetGroupChannelArgs struct {
A []string
}
type Z_GetGroupSyncableArgs ¶ added in v0.1.11
type Z_GetGroupSyncableArgs struct {
A string
B string
C model.GroupSyncableType
}
type Z_GetGroupSyncableReturns ¶ added in v0.1.11
type Z_GetGroupSyncableReturns struct {
A *model.GroupSyncable
B *model.AppError
}
type Z_GetGroupSyncablesArgs ¶ added in v0.1.11
type Z_GetGroupSyncablesArgs struct {
A string
B model.GroupSyncableType
}
type Z_GetGroupSyncablesReturns ¶ added in v0.1.11
type Z_GetGroupSyncablesReturns struct {
A []*model.GroupSyncable
B *model.AppError
}
type Z_GetGroupsArgs ¶ added in v0.1.11
type Z_GetGroupsArgs struct {
A int
B int
C model.GroupSearchOpts
D *model.ViewUsersRestrictions
}
type Z_GetGroupsBySourceArgs ¶
type Z_GetGroupsBySourceArgs struct {
A model.GroupSource
}
type Z_GetGroupsForUserArgs ¶
type Z_GetGroupsForUserArgs struct {
A string
}
type Z_GetGroupsReturns ¶ added in v0.1.11
type Z_GetLicenseArgs ¶
type Z_GetLicenseArgs struct {
}
type Z_GetLicenseReturns ¶
type Z_GetOAuthAppArgs ¶
type Z_GetOAuthAppArgs struct {
A string
}
type Z_GetOAuthAppReturns ¶
type Z_GetPluginConfigArgs ¶
type Z_GetPluginConfigArgs struct {
}
type Z_GetPluginIDArgs ¶ added in v0.1.7
type Z_GetPluginIDArgs struct {
}
type Z_GetPluginIDReturns ¶ added in v0.1.7
type Z_GetPluginIDReturns struct {
A string
}
type Z_GetPluginStatusArgs ¶
type Z_GetPluginStatusArgs struct {
A string
}
type Z_GetPluginStatusReturns ¶
type Z_GetPluginStatusReturns struct {
A *model.PluginStatus
B *model.AppError
}
type Z_GetPluginsArgs ¶
type Z_GetPluginsArgs struct {
}
type Z_GetPluginsReturns ¶
type Z_GetPostArgs ¶
type Z_GetPostArgs struct {
A string
}
type Z_GetPostThreadArgs ¶
type Z_GetPostThreadArgs struct {
A string
}
type Z_GetPostThreadReturns ¶
type Z_GetPostsAfterReturns ¶
type Z_GetPostsBeforeReturns ¶
type Z_GetPostsSinceArgs ¶
type Z_GetPostsSinceReturns ¶
type Z_GetPreferenceForUserArgs ¶ added in v0.0.13
type Z_GetPreferenceForUserReturns ¶ added in v0.0.13
type Z_GetPreferenceForUserReturns struct {
A model.Preference
B *model.AppError
}
type Z_GetPreferencesForUserArgs ¶
type Z_GetPreferencesForUserArgs struct {
A string
}
type Z_GetPreferencesForUserReturns ¶
type Z_GetPreferencesForUserReturns struct {
A []model.Preference
B *model.AppError
}
type Z_GetProfileImageArgs ¶
type Z_GetProfileImageArgs struct {
A string
}
type Z_GetPropertyFieldArgs ¶ added in v0.1.15
type Z_GetPropertyFieldByNameArgs ¶ added in v0.1.15
type Z_GetPropertyFieldByNameReturns ¶ added in v0.1.15
type Z_GetPropertyFieldByNameReturns struct {
A *model.PropertyField
B error
}
type Z_GetPropertyFieldReturns ¶ added in v0.1.15
type Z_GetPropertyFieldReturns struct {
A *model.PropertyField
B error
}
type Z_GetPropertyFieldsArgs ¶ added in v0.1.15
type Z_GetPropertyFieldsReturns ¶ added in v0.1.15
type Z_GetPropertyFieldsReturns struct {
A []*model.PropertyField
B error
}
type Z_GetPropertyGroupArgs ¶ added in v0.1.15
type Z_GetPropertyGroupArgs struct {
A string
}
type Z_GetPropertyGroupReturns ¶ added in v0.1.15
type Z_GetPropertyGroupReturns struct {
A *model.PropertyGroup
B error
}
type Z_GetPropertyValueArgs ¶ added in v0.1.15
type Z_GetPropertyValueReturns ¶ added in v0.1.15
type Z_GetPropertyValueReturns struct {
A *model.PropertyValue
B error
}
type Z_GetPropertyValuesArgs ¶ added in v0.1.15
type Z_GetPropertyValuesReturns ¶ added in v0.1.15
type Z_GetPropertyValuesReturns struct {
A []*model.PropertyValue
B error
}
type Z_GetReactionsArgs ¶
type Z_GetReactionsArgs struct {
A string
}
type Z_GetReactionsReturns ¶
type Z_GetServerVersionArgs ¶
type Z_GetServerVersionArgs struct {
}
type Z_GetServerVersionReturns ¶
type Z_GetServerVersionReturns struct {
A string
}
type Z_GetSessionArgs ¶
type Z_GetSessionArgs struct {
A string
}
type Z_GetSystemInstallDateArgs ¶
type Z_GetSystemInstallDateArgs struct {
}
type Z_GetTeamArgs ¶
type Z_GetTeamArgs struct {
A string
}
type Z_GetTeamByNameArgs ¶
type Z_GetTeamByNameArgs struct {
A string
}
type Z_GetTeamByNameReturns ¶
type Z_GetTeamIconArgs ¶
type Z_GetTeamIconArgs struct {
A string
}
type Z_GetTeamIconReturns ¶
type Z_GetTeamMemberArgs ¶
type Z_GetTeamMemberReturns ¶
type Z_GetTeamMemberReturns struct {
A *model.TeamMember
B *model.AppError
}
type Z_GetTeamMembersArgs ¶
type Z_GetTeamMembersForUserReturns ¶
type Z_GetTeamMembersForUserReturns struct {
A []*model.TeamMember
B *model.AppError
}
type Z_GetTeamMembersReturns ¶
type Z_GetTeamMembersReturns struct {
A []*model.TeamMember
B *model.AppError
}
type Z_GetTeamStatsArgs ¶
type Z_GetTeamStatsArgs struct {
A string
}
type Z_GetTeamStatsReturns ¶
type Z_GetTeamsArgs ¶
type Z_GetTeamsArgs struct {
}
type Z_GetTeamsForUserArgs ¶
type Z_GetTeamsForUserArgs struct {
A string
}
type Z_GetTeamsUnreadForUserArgs ¶
type Z_GetTeamsUnreadForUserArgs struct {
A string
}
type Z_GetTeamsUnreadForUserReturns ¶
type Z_GetTeamsUnreadForUserReturns struct {
A []*model.TeamUnread
B *model.AppError
}
type Z_GetTelemetryIdArgs ¶
type Z_GetTelemetryIdArgs struct {
}
type Z_GetTelemetryIdReturns ¶
type Z_GetTelemetryIdReturns struct {
A string
}
type Z_GetUnsanitizedConfigArgs ¶
type Z_GetUnsanitizedConfigArgs struct {
}
type Z_GetUploadSessionArgs ¶
type Z_GetUploadSessionArgs struct {
A string
}
type Z_GetUploadSessionReturns ¶
type Z_GetUploadSessionReturns struct {
A *model.UploadSession
B error
}
type Z_GetUserArgs ¶
type Z_GetUserArgs struct {
A string
}
type Z_GetUserByEmailArgs ¶
type Z_GetUserByEmailArgs struct {
A string
}
type Z_GetUserByEmailReturns ¶
type Z_GetUserByUsernameArgs ¶
type Z_GetUserByUsernameArgs struct {
A string
}
type Z_GetUserStatusArgs ¶
type Z_GetUserStatusArgs struct {
A string
}
type Z_GetUserStatusReturns ¶
type Z_GetUserStatusesByIdsArgs ¶
type Z_GetUserStatusesByIdsArgs struct {
A []string
}
type Z_GetUsersArgs ¶
type Z_GetUsersArgs struct {
A *model.UserGetOptions
}
type Z_GetUsersByIdsArgs ¶ added in v0.1.3
type Z_GetUsersByIdsArgs struct {
A []string
}
type Z_GetUsersByIdsReturns ¶ added in v0.1.3
type Z_GetUsersByUsernamesArgs ¶
type Z_GetUsersByUsernamesArgs struct {
A []string
}
type Z_GetUsersInChannelArgs ¶
type Z_GetUsersInTeamArgs ¶
type Z_GetUsersInTeamReturns ¶
type Z_HasPermissionToArgs ¶
type Z_HasPermissionToArgs struct {
A string
B *model.Permission
}
type Z_HasPermissionToChannelArgs ¶
type Z_HasPermissionToChannelArgs struct {
A string
B string
C *model.Permission
}
type Z_HasPermissionToChannelReturns ¶
type Z_HasPermissionToChannelReturns struct {
A bool
}
type Z_HasPermissionToReturns ¶
type Z_HasPermissionToReturns struct {
A bool
}
type Z_HasPermissionToTeamArgs ¶
type Z_HasPermissionToTeamArgs struct {
A string
B string
C *model.Permission
}
type Z_HasPermissionToTeamReturns ¶
type Z_HasPermissionToTeamReturns struct {
A bool
}
type Z_InstallPluginArgs ¶
type Z_InstallPluginReturns ¶
type Z_InviteRemoteToChannelArgs ¶ added in v0.0.13
type Z_InviteRemoteToChannelReturns ¶ added in v0.0.13
type Z_InviteRemoteToChannelReturns struct {
A error
}
type Z_IsEnterpriseReadyArgs ¶
type Z_IsEnterpriseReadyArgs struct {
}
type Z_IsEnterpriseReadyReturns ¶
type Z_IsEnterpriseReadyReturns struct {
A bool
}
type Z_KVCompareAndSetArgs ¶
type Z_KVDeleteAllArgs ¶
type Z_KVDeleteAllArgs struct {
}
type Z_KVDeleteAllReturns ¶
type Z_KVDeleteArgs ¶
type Z_KVDeleteArgs struct {
A string
}
type Z_KVDeleteReturns ¶
type Z_KVGetArgs ¶
type Z_KVGetArgs struct {
A string
}
type Z_KVGetReturns ¶
type Z_KVListArgs ¶
type Z_KVListReturns ¶
type Z_KVSetArgs ¶
type Z_KVSetReturns ¶
type Z_KVSetWithExpiryArgs ¶
type Z_KVSetWithOptionsArgs ¶
type Z_KVSetWithOptionsArgs struct {
A string
B []byte
C model.PluginKVSetOptions
}
type Z_ListBuiltInCommandsArgs ¶
type Z_ListBuiltInCommandsArgs struct {
}
type Z_ListCommandsArgs ¶
type Z_ListCommandsArgs struct {
A string
}
type Z_ListCommandsReturns ¶
type Z_ListCustomCommandsArgs ¶
type Z_ListCustomCommandsArgs struct {
A string
}
type Z_ListPluginCommandsArgs ¶
type Z_ListPluginCommandsArgs struct {
A string
}
type Z_LoadPluginConfigurationArgsArgs ¶
type Z_LoadPluginConfigurationArgsArgs struct{}
type Z_LoadPluginConfigurationArgsReturns ¶
type Z_LoadPluginConfigurationArgsReturns struct {
A []byte
}
type Z_LogAuditRecArgs ¶ added in v0.1.16
type Z_LogAuditRecArgs struct {
A *model.AuditRecord
}
type Z_LogAuditRecReturns ¶ added in v0.1.16
type Z_LogAuditRecReturns struct {
}
type Z_LogAuditRecWithLevelArgs ¶ added in v0.1.16
type Z_LogAuditRecWithLevelArgs struct {
A *model.AuditRecord
B mlog.Level
}
type Z_LogAuditRecWithLevelReturns ¶ added in v0.1.16
type Z_LogAuditRecWithLevelReturns struct {
}
type Z_LogDebugArgs ¶
type Z_LogDebugReturns ¶
type Z_LogDebugReturns struct{}
type Z_LogErrorArgs ¶
type Z_LogErrorReturns ¶
type Z_LogErrorReturns struct{}
type Z_LogInfoArgs ¶
type Z_LogInfoReturns ¶
type Z_LogInfoReturns struct{}
type Z_LogWarnArgs ¶
type Z_LogWarnReturns ¶
type Z_LogWarnReturns struct{}
type Z_MessageHasBeenDeletedArgs ¶ added in v0.0.10
type Z_MessageHasBeenDeletedReturns ¶ added in v0.0.10
type Z_MessageHasBeenDeletedReturns struct {
}
type Z_MessageHasBeenPostedReturns ¶
type Z_MessageHasBeenPostedReturns struct {
}
type Z_MessageHasBeenUpdatedReturns ¶
type Z_MessageHasBeenUpdatedReturns struct {
}
type Z_MessagesWillBeConsumedArgs ¶ added in v0.0.10
type Z_MessagesWillBeConsumedReturns ¶ added in v0.0.10
type Z_NotificationWillBePushedArgs ¶ added in v0.0.8
type Z_NotificationWillBePushedArgs struct {
A *model.PushNotification
B string
}
type Z_NotificationWillBePushedReturns ¶ added in v0.0.8
type Z_NotificationWillBePushedReturns struct {
A *model.PushNotification
B string
}
type Z_OnActivateArgs ¶
type Z_OnActivateReturns ¶
type Z_OnActivateReturns struct {
A error
}
type Z_OnCloudLimitsUpdatedArgs ¶
type Z_OnCloudLimitsUpdatedArgs struct {
A *model.ProductLimits
}
type Z_OnCloudLimitsUpdatedReturns ¶
type Z_OnCloudLimitsUpdatedReturns struct {
}
type Z_OnConfigurationChangeArgs ¶
type Z_OnConfigurationChangeArgs struct {
}
type Z_OnConfigurationChangeReturns ¶
type Z_OnConfigurationChangeReturns struct {
A error
}
type Z_OnDeactivateArgs ¶
type Z_OnDeactivateArgs struct {
}
type Z_OnDeactivateReturns ¶
type Z_OnDeactivateReturns struct {
A error
}
type Z_OnInstallArgs ¶
type Z_OnInstallArgs struct {
A *Context
B model.OnInstallEvent
}
type Z_OnInstallReturns ¶
type Z_OnInstallReturns struct {
A error
}
type Z_OnPluginClusterEventArgs ¶
type Z_OnPluginClusterEventArgs struct {
A *Context
B model.PluginClusterEvent
}
type Z_OnPluginClusterEventReturns ¶
type Z_OnPluginClusterEventReturns struct {
}
type Z_OnSAMLLoginArgs ¶ added in v0.1.11
type Z_OnSAMLLoginArgs struct {
A *Context
B *model.User
C *saml2.AssertionInfo
}
type Z_OnSAMLLoginReturns ¶ added in v0.1.11
type Z_OnSAMLLoginReturns struct {
A error
}
type Z_OnSendDailyTelemetryArgs ¶
type Z_OnSendDailyTelemetryArgs struct {
}
type Z_OnSendDailyTelemetryReturns ¶
type Z_OnSendDailyTelemetryReturns struct {
}
type Z_OnSharedChannelsAttachmentSyncMsgArgs ¶ added in v0.0.14
type Z_OnSharedChannelsAttachmentSyncMsgArgs struct {
}
type Z_OnSharedChannelsAttachmentSyncMsgReturns ¶ added in v0.0.14
type Z_OnSharedChannelsAttachmentSyncMsgReturns struct {
}
type Z_OnSharedChannelsPingArgs ¶ added in v0.0.13
type Z_OnSharedChannelsPingArgs struct {
}
type Z_OnSharedChannelsPingReturns ¶ added in v0.0.13
type Z_OnSharedChannelsPingReturns struct {
}
type Z_OnSharedChannelsProfileImageSyncMsgArgs ¶ added in v0.0.14
type Z_OnSharedChannelsProfileImageSyncMsgArgs struct {
}
type Z_OnSharedChannelsProfileImageSyncMsgReturns ¶ added in v0.0.14
type Z_OnSharedChannelsProfileImageSyncMsgReturns struct {
}
type Z_OnSharedChannelsSyncMsgArgs ¶ added in v0.0.13
type Z_OnSharedChannelsSyncMsgArgs struct {
}
type Z_OnSharedChannelsSyncMsgReturns ¶ added in v0.0.13
type Z_OnSharedChannelsSyncMsgReturns struct {
}
type Z_OnWebSocketConnectReturns ¶
type Z_OnWebSocketConnectReturns struct {
}
type Z_OnWebSocketDisconnectReturns ¶
type Z_OnWebSocketDisconnectReturns struct {
}
type Z_OpenInteractiveDialogArgs ¶
type Z_OpenInteractiveDialogArgs struct {
A model.OpenDialogRequest
}
type Z_PatchBotArgs ¶
type Z_PatchChannelMembersNotificationsArgs ¶ added in v0.0.13
type Z_PatchChannelMembersNotificationsArgs struct {
A []*model.ChannelMemberIdentifier
B map[string]string
}
type Z_PatchChannelMembersNotificationsReturns ¶ added in v0.0.13
type Z_PermanentDeleteBotArgs ¶
type Z_PermanentDeleteBotArgs struct {
A string
}
type Z_PluginHTTPArgs ¶
type Z_PluginHTTPArgs struct {
Request *HTTPRequestSubset
RequestBody []byte
}
Legacy buffered structs (kept for backward compatibility with old servers)
type Z_PluginHTTPReturns ¶
type Z_PluginHTTPStreamArgs ¶ added in v0.1.22
type Z_PluginHTTPStreamArgs struct {
ResponseBodyStream uint32
Request *HTTPRequestSubset
RequestBodyStream uint32
}
New streaming structs
type Z_PluginHTTPStreamReturns ¶ added in v0.1.22
type Z_PreferencesHaveChangedArgs ¶ added in v0.0.13
type Z_PreferencesHaveChangedArgs struct {
A *Context
B []model.Preference
}
type Z_PreferencesHaveChangedReturns ¶ added in v0.0.13
type Z_PreferencesHaveChangedReturns struct {
}
type Z_PublishPluginClusterEventArgs ¶
type Z_PublishPluginClusterEventArgs struct {
A model.PluginClusterEvent
B model.PluginClusterEventSendOptions
}
type Z_PublishPluginClusterEventReturns ¶
type Z_PublishPluginClusterEventReturns struct {
A error
}
type Z_PublishUserTypingArgs ¶
type Z_PublishWebSocketEventArgs ¶
type Z_PublishWebSocketEventArgs struct {
A string
B map[string]any
C *model.WebsocketBroadcast
}
type Z_PublishWebSocketEventReturns ¶
type Z_PublishWebSocketEventReturns struct {
}
type Z_ReactionHasBeenAddedReturns ¶
type Z_ReactionHasBeenAddedReturns struct {
}
type Z_ReactionHasBeenRemovedReturns ¶
type Z_ReactionHasBeenRemovedReturns struct {
}
type Z_ReadFileArgs ¶
type Z_ReadFileArgs struct {
A string
}
type Z_ReadFileReturns ¶
type Z_ReceiveSharedChannelAttachmentSyncMsgArgs ¶ added in v0.4.0
type Z_ReceiveSharedChannelAttachmentSyncMsgArgs struct {
}
type Z_ReceiveSharedChannelAttachmentSyncMsgReturns ¶ added in v0.4.0
type Z_ReceiveSharedChannelAttachmentSyncMsgReturns struct {
}
type Z_ReceiveSharedChannelProfileImageSyncMsgArgs ¶ added in v0.4.0
type Z_ReceiveSharedChannelProfileImageSyncMsgArgs struct {
}
type Z_ReceiveSharedChannelProfileImageSyncMsgReturns ¶ added in v0.4.0
type Z_ReceiveSharedChannelProfileImageSyncMsgReturns struct {
}
type Z_ReceiveSharedChannelSyncMsgArgs ¶ added in v0.4.0
type Z_ReceiveSharedChannelSyncMsgArgs struct {
}
type Z_ReceiveSharedChannelSyncMsgReturns ¶ added in v0.4.0
type Z_ReceiveSharedChannelSyncMsgReturns struct {
}
type Z_RegisterChannelGuardArgs ¶ added in v0.4.1
type Z_RegisterChannelGuardArgs struct {
A string
}
type Z_RegisterChannelGuardReturns ¶ added in v0.4.1
type Z_RegisterCollectionAndTopicReturns ¶
type Z_RegisterCollectionAndTopicReturns struct {
A error
}
type Z_RegisterCommandArgs ¶
type Z_RegisterCommandReturns ¶
type Z_RegisterCommandReturns struct {
A error
}
type Z_RegisterPluginForSharedChannelsArgs ¶ added in v0.0.13
type Z_RegisterPluginForSharedChannelsArgs struct {
}
type Z_RegisterPluginForSharedChannelsReturns ¶ added in v0.0.13
type Z_RegisterPluginForSharedChannelsReturns struct {
}
type Z_RegisterPropertyGroupArgs ¶ added in v0.1.15
type Z_RegisterPropertyGroupArgs struct {
A string
}
type Z_RegisterPropertyGroupReturns ¶ added in v0.1.15
type Z_RegisterPropertyGroupReturns struct {
A *model.PropertyGroup
B error
}
type Z_RemovePluginArgs ¶
type Z_RemovePluginArgs struct {
A string
}
type Z_RemovePluginReturns ¶
type Z_RemoveReactionArgs ¶
type Z_RemoveReactionReturns ¶
type Z_RemoveTeamIconArgs ¶
type Z_RemoveTeamIconArgs struct {
A string
}
type Z_RemoveTeamIconReturns ¶
type Z_RemoveUserCustomStatusArgs ¶
type Z_RemoveUserCustomStatusArgs struct {
A string
}
type Z_RestoreGroupArgs ¶ added in v0.1.11
type Z_RestoreGroupArgs struct {
A string
}
type Z_RestoreGroupReturns ¶ added in v0.1.11
type Z_RevokeSessionArgs ¶
type Z_RevokeSessionArgs struct {
A string
}
type Z_RevokeSessionReturns ¶
type Z_RevokeUserAccessTokenArgs ¶
type Z_RevokeUserAccessTokenArgs struct {
A string
}
type Z_RolesGrantPermissionReturns ¶
type Z_RolesGrantPermissionReturns struct {
A bool
}
type Z_RunDataRetentionArgs ¶
type Z_SaveConfigArgs ¶
type Z_SaveConfigReturns ¶
type Z_SavePluginConfigArgs ¶
type Z_ScheduledPostWillBeCreatedArgs ¶ added in v0.4.1
type Z_ScheduledPostWillBeCreatedArgs struct {
A *Context
B *model.ScheduledPost
}
type Z_ScheduledPostWillBeCreatedReturns ¶ added in v0.4.1
type Z_ScheduledPostWillBeCreatedReturns struct {
A *model.ScheduledPost
B string
}
type Z_SearchChannelsArgs ¶
type Z_SearchChannelsReturns ¶
type Z_SearchPostsInTeamArgs ¶
type Z_SearchPostsInTeamArgs struct {
A string
B []*model.SearchParams
}
type Z_SearchPostsInTeamForUserArgs ¶
type Z_SearchPostsInTeamForUserArgs struct {
A string
B string
C model.SearchParameter
}
type Z_SearchPostsInTeamForUserReturns ¶
type Z_SearchPostsInTeamForUserReturns struct {
A *model.PostSearchResults
B *model.AppError
}
type Z_SearchPropertyFieldsArgs ¶ added in v0.1.15
type Z_SearchPropertyFieldsArgs struct {
A string
B model.PropertyFieldSearchOpts
}
type Z_SearchPropertyFieldsReturns ¶ added in v0.1.15
type Z_SearchPropertyFieldsReturns struct {
A []*model.PropertyField
B error
}
type Z_SearchPropertyValuesArgs ¶ added in v0.1.15
type Z_SearchPropertyValuesArgs struct {
A string
B model.PropertyValueSearchOpts
}
type Z_SearchPropertyValuesReturns ¶ added in v0.1.15
type Z_SearchPropertyValuesReturns struct {
A []*model.PropertyValue
B error
}
type Z_SearchTeamsArgs ¶
type Z_SearchTeamsArgs struct {
A string
}
type Z_SearchUsersArgs ¶
type Z_SearchUsersArgs struct {
A *model.UserSearch
}
type Z_SendEphemeralPostArgs ¶
type Z_SendMailArgs ¶
type Z_SendMailReturns ¶
type Z_SendPushNotificationArgs ¶ added in v0.0.9
type Z_SendPushNotificationArgs struct {
A *model.PushNotification
B string
}
type Z_SendPushNotificationReturns ¶ added in v0.0.9
type Z_SendToastMessageArgs ¶ added in v0.2.0
type Z_SendToastMessageArgs struct {
A string
B string
C string
D model.SendToastMessageOptions
}
type Z_SendToastMessageReturns ¶ added in v0.2.0
type Z_ServeHTTPArgs ¶
type Z_ServeHTTPArgs struct {
ResponseWriterStream uint32
Request *HTTPRequestSubset
Context *Context
RequestBodyStream uint32
}
type Z_ServeMetricsArgs ¶ added in v0.0.11
type Z_ServeMetricsArgs struct {
ResponseWriterStream uint32
Request *HTTPRequestSubset
Context *Context
RequestBodyStream uint32
}
type Z_SetFileSearchableContentArgs ¶ added in v0.0.9
type Z_SetFileSearchableContentReturns ¶ added in v0.0.9
type Z_SetProfileImageArgs ¶
type Z_SetTeamIconArgs ¶
type Z_SetTeamIconReturns ¶
type Z_ShareChannelArgs ¶ added in v0.0.13
type Z_ShareChannelArgs struct {
}
type Z_ShareChannelReturns ¶ added in v0.0.13
type Z_ShareChannelReturns struct {
}
type Z_SyncSharedChannelArgs ¶ added in v0.0.13
type Z_SyncSharedChannelArgs struct {
}
type Z_SyncSharedChannelReturns ¶ added in v0.0.13
type Z_SyncSharedChannelReturns struct {
}
type Z_TeamMemberWillBeAddedArgs ¶ added in v0.3.0
type Z_TeamMemberWillBeAddedArgs struct {
A *Context
B *model.TeamMember
}
type Z_TeamMemberWillBeAddedReturns ¶ added in v0.3.0
type Z_TeamMemberWillBeAddedReturns struct {
A *model.TeamMember
B string
}
type Z_UninviteRemoteFromChannelArgs ¶ added in v0.0.13
type Z_UninviteRemoteFromChannelReturns ¶ added in v0.0.13
type Z_UninviteRemoteFromChannelReturns struct {
A error
}
type Z_UnregisterChannelGuardArgs ¶ added in v0.4.1
type Z_UnregisterChannelGuardArgs struct {
A string
}
type Z_UnregisterChannelGuardReturns ¶ added in v0.4.1
type Z_UnregisterCommandArgs ¶
type Z_UnregisterCommandReturns ¶
type Z_UnregisterCommandReturns struct {
A error
}
type Z_UnregisterPluginForSharedChannelsArgs ¶ added in v0.0.13
type Z_UnregisterPluginForSharedChannelsArgs struct {
}
type Z_UnregisterPluginForSharedChannelsReturns ¶ added in v0.0.13
type Z_UnregisterPluginForSharedChannelsReturns struct {
}
type Z_UnregisterPluginRemoteForSharedChannelsArgs ¶ added in v0.4.0
type Z_UnregisterPluginRemoteForSharedChannelsArgs struct {
}
type Z_UnregisterPluginRemoteForSharedChannelsReturns ¶ added in v0.4.0
type Z_UnregisterPluginRemoteForSharedChannelsReturns struct {
}
type Z_UnshareChannelArgs ¶ added in v0.0.13
type Z_UnshareChannelArgs struct {
}
type Z_UnshareChannelReturns ¶ added in v0.0.13
type Z_UnshareChannelReturns struct {
}
type Z_UpdateBotActiveArgs ¶
type Z_UpdateChannelArgs ¶
type Z_UpdateChannelMemberNotificationsReturns ¶
type Z_UpdateChannelMemberNotificationsReturns struct {
A *model.ChannelMember
B *model.AppError
}
type Z_UpdateChannelMemberRolesReturns ¶
type Z_UpdateChannelMemberRolesReturns struct {
A *model.ChannelMember
B *model.AppError
}
type Z_UpdateChannelReturns ¶
type Z_UpdateChannelSidebarCategoriesArgs ¶
type Z_UpdateChannelSidebarCategoriesArgs struct {
A string
B string
C []*model.SidebarCategoryWithChannels
}
type Z_UpdateChannelSidebarCategoriesReturns ¶
type Z_UpdateChannelSidebarCategoriesReturns struct {
A []*model.SidebarCategoryWithChannels
B *model.AppError
}
type Z_UpdateCommandArgs ¶
type Z_UpdateCommandReturns ¶
type Z_UpdateGroupArgs ¶ added in v0.1.11
type Z_UpdateGroupReturns ¶ added in v0.1.11
type Z_UpdateGroupSyncableArgs ¶ added in v0.1.11
type Z_UpdateGroupSyncableArgs struct {
A *model.GroupSyncable
}
type Z_UpdateGroupSyncableReturns ¶ added in v0.1.11
type Z_UpdateGroupSyncableReturns struct {
A *model.GroupSyncable
B *model.AppError
}
type Z_UpdateOAuthAppArgs ¶
type Z_UpdateOAuthAppReturns ¶
type Z_UpdatePostArgs ¶
type Z_UpdatePreferencesForUserArgs ¶
type Z_UpdatePreferencesForUserArgs struct {
A string
B []model.Preference
}
type Z_UpdatePropertyFieldArgs ¶ added in v0.1.15
type Z_UpdatePropertyFieldArgs struct {
A string
B *model.PropertyField
}
type Z_UpdatePropertyFieldReturns ¶ added in v0.1.15
type Z_UpdatePropertyFieldReturns struct {
A *model.PropertyField
B error
}
type Z_UpdatePropertyFieldsArgs ¶ added in v0.1.15
type Z_UpdatePropertyFieldsArgs struct {
A string
B []*model.PropertyField
}
type Z_UpdatePropertyFieldsReturns ¶ added in v0.1.15
type Z_UpdatePropertyFieldsReturns struct {
A []*model.PropertyField
B error
}
type Z_UpdatePropertyValueArgs ¶ added in v0.1.15
type Z_UpdatePropertyValueArgs struct {
A string
B *model.PropertyValue
}
type Z_UpdatePropertyValueReturns ¶ added in v0.1.15
type Z_UpdatePropertyValueReturns struct {
A *model.PropertyValue
B error
}
type Z_UpdatePropertyValuesArgs ¶ added in v0.1.15
type Z_UpdatePropertyValuesArgs struct {
A string
B []*model.PropertyValue
}
type Z_UpdatePropertyValuesReturns ¶ added in v0.1.15
type Z_UpdatePropertyValuesReturns struct {
A []*model.PropertyValue
B error
}
type Z_UpdateSharedChannelArgs ¶ added in v0.0.13
type Z_UpdateSharedChannelArgs struct {
}
type Z_UpdateSharedChannelCursorArgs ¶ added in v0.0.13
type Z_UpdateSharedChannelCursorArgs struct {
}
type Z_UpdateSharedChannelCursorReturns ¶ added in v0.0.13
type Z_UpdateSharedChannelCursorReturns struct {
}
type Z_UpdateSharedChannelReturns ¶ added in v0.0.13
type Z_UpdateSharedChannelReturns struct {
}
type Z_UpdateTeamArgs ¶
type Z_UpdateTeamMemberRolesReturns ¶
type Z_UpdateTeamMemberRolesReturns struct {
A *model.TeamMember
B *model.AppError
}
type Z_UpdateUserActiveArgs ¶
type Z_UpdateUserArgs ¶
type Z_UpdateUserAuthArgs ¶ added in v0.0.10
type Z_UpdateUserAuthReturns ¶ added in v0.0.10
type Z_UpdateUserCustomStatusArgs ¶
type Z_UpdateUserCustomStatusArgs struct {
A string
B *model.CustomStatus
}
type Z_UpdateUserRolesArgs ¶ added in v0.0.18
type Z_UpdateUserRolesReturns ¶ added in v0.0.18
type Z_UpdateUserStatusArgs ¶
type Z_UploadDataArgs ¶
type Z_UploadDataArgs struct {
A *model.UploadSession
PluginStreamID uint32
}
type Z_UploadDataReturns ¶
type Z_UploadFileArgs ¶
type Z_UpsertGroupMemberArgs ¶ added in v0.1.11
type Z_UpsertGroupMemberReturns ¶ added in v0.1.11
type Z_UpsertGroupMemberReturns struct {
A *model.GroupMember
B *model.AppError
}
type Z_UpsertGroupMembersArgs ¶ added in v0.1.11
type Z_UpsertGroupMembersReturns ¶ added in v0.1.11
type Z_UpsertGroupMembersReturns struct {
A []*model.GroupMember
B *model.AppError
}
type Z_UpsertGroupSyncableArgs ¶ added in v0.1.11
type Z_UpsertGroupSyncableArgs struct {
A *model.GroupSyncable
}
type Z_UpsertGroupSyncableReturns ¶ added in v0.1.11
type Z_UpsertGroupSyncableReturns struct {
A *model.GroupSyncable
B *model.AppError
}
type Z_UpsertPropertyValueArgs ¶ added in v0.1.15
type Z_UpsertPropertyValueArgs struct {
A *model.PropertyValue
}
type Z_UpsertPropertyValueReturns ¶ added in v0.1.15
type Z_UpsertPropertyValueReturns struct {
A *model.PropertyValue
B error
}
type Z_UpsertPropertyValuesArgs ¶ added in v0.1.15
type Z_UpsertPropertyValuesArgs struct {
A []*model.PropertyValue
}
type Z_UpsertPropertyValuesReturns ¶ added in v0.1.15
type Z_UpsertPropertyValuesReturns struct {
A []*model.PropertyValue
B error
}
type Z_UserHasBeenCreatedReturns ¶
type Z_UserHasBeenCreatedReturns struct {
}
type Z_UserHasBeenDeactivatedArgs ¶ added in v0.0.9
type Z_UserHasBeenDeactivatedReturns ¶ added in v0.0.9
type Z_UserHasBeenDeactivatedReturns struct {
}
type Z_UserHasJoinedChannelArgs ¶
type Z_UserHasJoinedChannelArgs struct {
A *Context
B *model.ChannelMember
C *model.User
}
type Z_UserHasJoinedChannelReturns ¶
type Z_UserHasJoinedChannelReturns struct {
}
type Z_UserHasJoinedTeamArgs ¶
type Z_UserHasJoinedTeamArgs struct {
A *Context
B *model.TeamMember
C *model.User
}
type Z_UserHasJoinedTeamReturns ¶
type Z_UserHasJoinedTeamReturns struct {
}
type Z_UserHasLeftChannelArgs ¶
type Z_UserHasLeftChannelArgs struct {
A *Context
B *model.ChannelMember
C *model.User
}
type Z_UserHasLeftChannelReturns ¶
type Z_UserHasLeftChannelReturns struct {
}
type Z_UserHasLeftTeamArgs ¶
type Z_UserHasLeftTeamArgs struct {
A *Context
B *model.TeamMember
C *model.User
}
type Z_UserHasLeftTeamReturns ¶
type Z_UserHasLeftTeamReturns struct {
}
type Z_UserHasLoggedInArgs ¶
type Z_UserHasLoggedInReturns ¶
type Z_UserHasLoggedInReturns struct {
}
type Z_UserWillLogInArgs ¶
type Z_UserWillLogInReturns ¶
type Z_UserWillLogInReturns struct {
A string
}
type Z_WebSocketMessageHasBeenPostedArgs ¶
type Z_WebSocketMessageHasBeenPostedArgs struct {
A string
B string
C *model.WebSocketRequest
}
type Z_WebSocketMessageHasBeenPostedReturns ¶
type Z_WebSocketMessageHasBeenPostedReturns struct {
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
The plugintest package provides mocks that can be used to test plugins.
|
The plugintest package provides mocks that can be used to test plugins. |
|
mock
This package provides aliases for the contents of "github.com/stretchr/testify/mock".
|
This package provides aliases for the contents of "github.com/stretchr/testify/mock". |