2017-04-12 08:27:57 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2019-11-29 06:59:40 -05:00
|
|
|
// See LICENSE.txt for license information.
|
2016-08-04 13:25:37 -04:00
|
|
|
|
|
|
|
|
package einterfaces
|
|
|
|
|
|
|
|
|
|
import (
|
2023-06-11 01:24:35 -04:00
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
2024-08-03 10:11:13 -04:00
|
|
|
"github.com/mattermost/mattermost/server/public/shared/request"
|
2016-08-04 13:25:37 -04:00
|
|
|
)
|
|
|
|
|
|
2017-06-19 11:44:04 -04:00
|
|
|
type ClusterMessageHandler func(msg *model.ClusterMessage)
|
|
|
|
|
|
2016-08-04 13:25:37 -04:00
|
|
|
type ClusterInterface interface {
|
|
|
|
|
StartInterNodeCommunication()
|
|
|
|
|
StopInterNodeCommunication()
|
2021-07-15 01:32:17 -04:00
|
|
|
RegisterClusterMessageHandler(event model.ClusterEvent, crm ClusterMessageHandler)
|
2017-06-19 11:44:04 -04:00
|
|
|
GetClusterId() string
|
2017-08-16 13:29:45 -04:00
|
|
|
IsLeader() bool
|
2020-06-24 09:16:33 -04:00
|
|
|
// HealthScore returns a number which is indicative of how well an instance is meeting
|
|
|
|
|
// the soft real-time requirements of the protocol. Lower numbers are better,
|
|
|
|
|
// and zero means "totally healthy".
|
|
|
|
|
HealthScore() int
|
2017-09-05 10:58:30 -04:00
|
|
|
GetMyClusterInfo() *model.ClusterInfo
|
2025-05-12 13:37:58 -04:00
|
|
|
GetClusterInfos() ([]*model.ClusterInfo, error)
|
2021-04-28 13:59:32 -04:00
|
|
|
SendClusterMessage(msg *model.ClusterMessage)
|
|
|
|
|
SendClusterMessageToNode(nodeID string, msg *model.ClusterMessage) error
|
2017-06-19 11:44:04 -04:00
|
|
|
NotifyMsg(buf []byte)
|
2024-09-27 03:17:16 -04:00
|
|
|
GetClusterStats(rctx request.CTX) ([]*model.ClusterStats, *model.AppError)
|
2025-09-10 09:11:32 -04:00
|
|
|
GetLogs(rctx request.CTX, page, perPage int) ([]string, *model.AppError)
|
2024-09-27 03:17:16 -04:00
|
|
|
QueryLogs(rctx request.CTX, page, perPage int) (map[string][]string, *model.AppError)
|
2024-08-03 10:11:13 -04:00
|
|
|
GenerateSupportPacket(rctx request.CTX, options *model.SupportPacketOptions) (map[string][]model.FileData, error)
|
2018-05-23 14:26:35 -04:00
|
|
|
GetPluginStatuses() (model.PluginStatuses, *model.AppError)
|
2016-08-04 13:25:37 -04:00
|
|
|
ConfigChanged(previousConfig *model.Config, newConfig *model.Config, sendToOtherServer bool) *model.AppError
|
2024-04-30 09:58:55 -04:00
|
|
|
// WebConnCountForUser returns the number of active webconn connections
|
|
|
|
|
// for a given userID.
|
|
|
|
|
WebConnCountForUser(userID string) (int, *model.AppError)
|
2025-01-17 00:41:32 -05:00
|
|
|
// GetWSQueues returns the necessary websocket queues from a cluster for a given
|
|
|
|
|
// connectionID and sequence number.
|
|
|
|
|
GetWSQueues(userID, connectionID string, seqNum int64) (map[string]*model.WSQueues, error)
|
2016-08-04 13:25:37 -04:00
|
|
|
}
|