2019-11-29 06:59:40 -05:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See LICENSE.txt for license information.
|
2017-06-19 11:44:04 -04:00
|
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
2021-07-15 01:32:17 -04:00
|
|
|
type ClusterEvent string
|
|
|
|
|
|
2017-06-19 11:44:04 -04:00
|
|
|
const (
|
2024-08-05 23:58:41 -04:00
|
|
|
ClusterEventNone ClusterEvent = "none"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventPublish ClusterEvent = "publish"
|
|
|
|
|
ClusterEventUpdateStatus ClusterEvent = "update_status"
|
|
|
|
|
ClusterEventInvalidateAllCaches ClusterEvent = "inv_all_caches"
|
|
|
|
|
ClusterEventInvalidateCacheForReactions ClusterEvent = "inv_reactions"
|
|
|
|
|
ClusterEventInvalidateCacheForChannelMembersNotifyProps ClusterEvent = "inv_channel_members_notify_props"
|
|
|
|
|
ClusterEventInvalidateCacheForChannelByName ClusterEvent = "inv_channel_name"
|
|
|
|
|
ClusterEventInvalidateCacheForChannel ClusterEvent = "inv_channel"
|
|
|
|
|
ClusterEventInvalidateCacheForChannelGuestCount ClusterEvent = "inv_channel_guest_count"
|
|
|
|
|
ClusterEventInvalidateCacheForUser ClusterEvent = "inv_user"
|
2024-09-11 11:12:49 -04:00
|
|
|
ClusterEventInvalidateWebConnCacheForUser ClusterEvent = "inv_user_teams"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventClearSessionCacheForUser ClusterEvent = "clear_session_user"
|
|
|
|
|
ClusterEventInvalidateCacheForRoles ClusterEvent = "inv_roles"
|
|
|
|
|
ClusterEventInvalidateCacheForRolePermissions ClusterEvent = "inv_role_permissions"
|
|
|
|
|
ClusterEventInvalidateCacheForProfileByIds ClusterEvent = "inv_profile_ids"
|
2024-03-11 01:04:20 -04:00
|
|
|
ClusterEventInvalidateCacheForAllProfiles ClusterEvent = "inv_all_profiles"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventInvalidateCacheForProfileInChannel ClusterEvent = "inv_profile_in_channel"
|
|
|
|
|
ClusterEventInvalidateCacheForSchemes ClusterEvent = "inv_schemes"
|
|
|
|
|
ClusterEventInvalidateCacheForFileInfos ClusterEvent = "inv_file_infos"
|
|
|
|
|
ClusterEventInvalidateCacheForWebhooks ClusterEvent = "inv_webhooks"
|
|
|
|
|
ClusterEventInvalidateCacheForEmojisById ClusterEvent = "inv_emojis_by_id"
|
|
|
|
|
ClusterEventInvalidateCacheForEmojisIdByName ClusterEvent = "inv_emojis_id_by_name"
|
2022-03-25 16:28:14 -04:00
|
|
|
ClusterEventInvalidateCacheForChannelFileCount ClusterEvent = "inv_channel_file_count"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventInvalidateCacheForChannelPinnedpostsCounts ClusterEvent = "inv_channel_pinnedposts_counts"
|
|
|
|
|
ClusterEventInvalidateCacheForChannelMemberCounts ClusterEvent = "inv_channel_member_counts"
|
2023-07-19 02:15:27 -04:00
|
|
|
ClusterEventInvalidateCacheForChannelsMemberCount ClusterEvent = "inv_channels_member_count"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventInvalidateCacheForLastPosts ClusterEvent = "inv_last_posts"
|
|
|
|
|
ClusterEventInvalidateCacheForLastPostTime ClusterEvent = "inv_last_post_time"
|
2022-05-31 06:55:46 -04:00
|
|
|
ClusterEventInvalidateCacheForPostsUsage ClusterEvent = "inv_posts_usage"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventInvalidateCacheForTeams ClusterEvent = "inv_teams"
|
2025-10-13 02:54:01 -04:00
|
|
|
ClusterEventInvalidateCacheForContentFlagging ClusterEvent = "inv_content_flagging"
|
2026-01-26 17:05:34 -05:00
|
|
|
ClusterEventInvalidateCacheForAutoTranslation ClusterEvent = "inv_autotranslation"
|
2025-12-11 01:59:50 -05:00
|
|
|
ClusterEventInvalidateCacheForReadReceipts ClusterEvent = "inv_read_receipts"
|
|
|
|
|
ClusterEventInvalidateCacheForTemporaryPosts ClusterEvent = "inv_temporary_posts"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventClearSessionCacheForAllUsers ClusterEvent = "inv_all_user_sessions"
|
|
|
|
|
ClusterEventInstallPlugin ClusterEvent = "install_plugin"
|
|
|
|
|
ClusterEventRemovePlugin ClusterEvent = "remove_plugin"
|
|
|
|
|
ClusterEventPluginEvent ClusterEvent = "plugin_event"
|
|
|
|
|
ClusterEventInvalidateCacheForTermsOfService ClusterEvent = "inv_terms_of_service"
|
2025-11-21 20:32:01 -05:00
|
|
|
ClusterEventInvalidateCacheForUserAutoTranslation ClusterEvent = "inv_user_autotranslation"
|
2026-02-09 18:32:26 -05:00
|
|
|
ClusterEventInvalidateCacheForPostTranslationEtag ClusterEvent = "inv_post_translation_etag"
|
2026-01-26 17:05:34 -05:00
|
|
|
ClusterEventAutoTranslationTask ClusterEvent = "autotranslation_task"
|
2021-07-15 01:32:17 -04:00
|
|
|
ClusterEventBusyStateChanged ClusterEvent = "busy_state_change"
|
2024-07-26 09:39:09 -04:00
|
|
|
// Note: if you are adding a new event, please also add it in the slice of
|
|
|
|
|
// m.ClusterEventMap in metrics/metrics.go file.
|
2017-06-19 11:44:04 -04:00
|
|
|
|
2020-05-23 02:13:58 -04:00
|
|
|
// Gossip communication
|
2024-08-03 10:11:13 -04:00
|
|
|
ClusterGossipEventRequestGetLogs = "gossip_request_get_logs"
|
|
|
|
|
ClusterGossipEventResponseGetLogs = "gossip_response_get_logs"
|
|
|
|
|
ClusterGossipEventRequestGenerateSupportPacket = "gossip_request_generate_support_packet"
|
|
|
|
|
ClusterGossipEventResponseGenerateSupportPacket = "gossip_response_generate_support_packet"
|
|
|
|
|
ClusterGossipEventRequestGetClusterStats = "gossip_request_cluster_stats"
|
|
|
|
|
ClusterGossipEventResponseGetClusterStats = "gossip_response_cluster_stats"
|
|
|
|
|
ClusterGossipEventRequestGetPluginStatuses = "gossip_request_plugin_statuses"
|
|
|
|
|
ClusterGossipEventResponseGetPluginStatuses = "gossip_response_plugin_statuses"
|
|
|
|
|
ClusterGossipEventRequestSaveConfig = "gossip_request_save_config"
|
|
|
|
|
ClusterGossipEventResponseSaveConfig = "gossip_response_save_config"
|
|
|
|
|
ClusterGossipEventRequestWebConnCount = "gossip_request_webconn_count"
|
|
|
|
|
ClusterGossipEventResponseWebConnCount = "gossip_response_webconn_count"
|
2025-01-17 00:41:32 -05:00
|
|
|
ClusterGossipEventRequestWSQueues = "gossip_request_ws_queues"
|
|
|
|
|
ClusterGossipEventResponseWSQueues = "gossip_response_ws_queues"
|
2020-05-23 02:13:58 -04:00
|
|
|
|
2019-07-18 14:05:53 -04:00
|
|
|
// SendTypes for ClusterMessage.
|
2021-07-12 14:05:36 -04:00
|
|
|
ClusterSendBestEffort = "best_effort"
|
|
|
|
|
ClusterSendReliable = "reliable"
|
2017-06-19 11:44:04 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ClusterMessage struct {
|
2021-07-15 01:32:17 -04:00
|
|
|
Event ClusterEvent `json:"event"`
|
2017-06-19 11:44:04 -04:00
|
|
|
SendType string `json:"-"`
|
|
|
|
|
WaitForAllToSend bool `json:"-"`
|
2021-07-26 04:11:20 -04:00
|
|
|
Data []byte `json:"data,omitempty"`
|
2017-06-19 11:44:04 -04:00
|
|
|
Props map[string]string `json:"props,omitempty"`
|
|
|
|
|
}
|