2017-08-16 23:37:37 +02:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2016-08-15 18:47:31 +02:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
package einterfaces
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mattermost/platform/model"
|
|
|
|
)
|
|
|
|
|
2017-08-16 23:37:37 +02:00
|
|
|
type ClusterMessageHandler func(msg *model.ClusterMessage)
|
|
|
|
|
2016-08-15 18:47:31 +02:00
|
|
|
type ClusterInterface interface {
|
|
|
|
StartInterNodeCommunication()
|
|
|
|
StopInterNodeCommunication()
|
2017-08-16 23:37:37 +02:00
|
|
|
RegisterClusterMessageHandler(event string, crm ClusterMessageHandler)
|
|
|
|
GetClusterId() string
|
2016-08-15 18:47:31 +02:00
|
|
|
GetClusterInfos() []*model.ClusterInfo
|
2017-08-16 23:37:37 +02:00
|
|
|
SendClusterMessage(cluster *model.ClusterMessage)
|
|
|
|
NotifyMsg(buf []byte)
|
2017-01-16 23:59:50 +01:00
|
|
|
GetClusterStats() ([]*model.ClusterStats, *model.AppError)
|
2017-08-16 23:37:37 +02:00
|
|
|
GetLogs(page, perPage int) ([]string, *model.AppError)
|
2016-08-15 18:47:31 +02:00
|
|
|
ConfigChanged(previousConfig *model.Config, newConfig *model.Config, sendToOtherServer bool) *model.AppError
|
|
|
|
}
|
|
|
|
|
|
|
|
var theClusterInterface ClusterInterface
|
|
|
|
|
|
|
|
func RegisterClusterInterface(newInterface ClusterInterface) {
|
|
|
|
theClusterInterface = newInterface
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetClusterInterface() ClusterInterface {
|
|
|
|
return theClusterInterface
|
|
|
|
}
|