summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/mattermost-server/model/cluster_message.go
diff options
context:
space:
mode:
authorDuco van Amstel <helcaraxan@gmail.com>2018-11-18 17:55:05 +0000
committerWim <wim@42.be>2018-11-25 21:21:04 +0100
commit09875fe1603307080f3a4172985c5dca3bd9912d (patch)
treea23220772f6f6597d509ca71b2df3480a77b8076 /vendor/github.com/mattermost/mattermost-server/model/cluster_message.go
parentf716b8fc0ff90f47b61e218ef34019b38bd70e0d (diff)
downloadmatterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.gz
matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.tar.bz2
matterbridge-msglm-09875fe1603307080f3a4172985c5dca3bd9912d.zip
Update direct dependencies where possible
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/model/cluster_message.go')
-rw-r--r--vendor/github.com/mattermost/mattermost-server/model/cluster_message.go48
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/model/cluster_message.go b/vendor/github.com/mattermost/mattermost-server/model/cluster_message.go
new file mode 100644
index 00000000..d02da3ee
--- /dev/null
+++ b/vendor/github.com/mattermost/mattermost-server/model/cluster_message.go
@@ -0,0 +1,48 @@
+// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package model
+
+import (
+ "encoding/json"
+ "io"
+)
+
+const (
+ CLUSTER_EVENT_PUBLISH = "publish"
+ CLUSTER_EVENT_UPDATE_STATUS = "update_status"
+ CLUSTER_EVENT_INVALIDATE_ALL_CACHES = "inv_all_caches"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_REACTIONS = "inv_reactions"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_WEBHOOK = "inv_webhook"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_POSTS = "inv_channel_posts"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_MEMBERS_NOTIFY_PROPS = "inv_channel_members_notify_props"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_MEMBERS = "inv_channel_members"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL_BY_NAME = "inv_channel_name"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_CHANNEL = "inv_channel"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_USER = "inv_user"
+ CLUSTER_EVENT_CLEAR_SESSION_CACHE_FOR_USER = "clear_session_user"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_ROLES = "inv_roles"
+ CLUSTER_EVENT_INVALIDATE_CACHE_FOR_SCHEMES = "inv_schemes"
+
+ CLUSTER_SEND_BEST_EFFORT = "best_effort"
+ CLUSTER_SEND_RELIABLE = "reliable"
+)
+
+type ClusterMessage struct {
+ Event string `json:"event"`
+ SendType string `json:"-"`
+ WaitForAllToSend bool `json:"-"`
+ Data string `json:"data,omitempty"`
+ Props map[string]string `json:"props,omitempty"`
+}
+
+func (o *ClusterMessage) ToJson() string {
+ b, _ := json.Marshal(o)
+ return string(b)
+}
+
+func ClusterMessageFromJson(data io.Reader) *ClusterMessage {
+ var o *ClusterMessage
+ json.NewDecoder(data).Decode(&o)
+ return o
+}