mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
24 lines
805 B
Go
24 lines
805 B
Go
|
|
package pluginapi
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/mattermost/mattermost/server/public/model"
|
||
|
|
"github.com/mattermost/mattermost/server/public/plugin"
|
||
|
|
)
|
||
|
|
|
||
|
|
// ClusterService exposes methods to interact with cluster nodes.
|
||
|
|
type ClusterService struct {
|
||
|
|
api plugin.API
|
||
|
|
}
|
||
|
|
|
||
|
|
// ClusterService broadcasts a plugin event to all other running instances of
|
||
|
|
// the calling plugin that are present in the cluster.
|
||
|
|
//
|
||
|
|
// This method is used to allow plugin communication in a High-Availability cluster.
|
||
|
|
// The receiving side should implement the OnPluginClusterEvent hook
|
||
|
|
// to receive events sent through this method.
|
||
|
|
//
|
||
|
|
// Minimum server version: 5.36
|
||
|
|
func (c *ClusterService) PublishPluginEvent(ev model.PluginClusterEvent, opts model.PluginClusterEventSendOptions) error {
|
||
|
|
return c.api.PublishPluginClusterEvent(ev, opts)
|
||
|
|
}
|