matterbridge/vendor/github.com/mattermost/platform/einterfaces/cluster.go

34 lines
999 B
Go
Raw Normal View History

2017-08-16 21:37:37 +00:00
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2016-08-15 16:47:31 +00:00
// See License.txt for license information.
package einterfaces
import (
"github.com/mattermost/platform/model"
)
2017-08-16 21:37:37 +00:00
type ClusterMessageHandler func(msg *model.ClusterMessage)
2016-08-15 16:47:31 +00:00
type ClusterInterface interface {
StartInterNodeCommunication()
StopInterNodeCommunication()
2017-08-16 21:37:37 +00:00
RegisterClusterMessageHandler(event string, crm ClusterMessageHandler)
GetClusterId() string
2016-08-15 16:47:31 +00:00
GetClusterInfos() []*model.ClusterInfo
2017-08-16 21:37:37 +00:00
SendClusterMessage(cluster *model.ClusterMessage)
NotifyMsg(buf []byte)
2017-01-16 22:59:50 +00:00
GetClusterStats() ([]*model.ClusterStats, *model.AppError)
2017-08-16 21:37:37 +00:00
GetLogs(page, perPage int) ([]string, *model.AppError)
2016-08-15 16:47:31 +00: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
}