mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-11 14:54:34 -05:00
Combines the following repositories into one: https://github.com/mattermost/mattermost-server https://github.com/mattermost/mattermost-webapp https://github.com/mattermost/focalboard https://github.com/mattermost/mattermost-plugin-playbooks
20 lines
829 B
Go
20 lines
829 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package app
|
|
|
|
// Registers a given function to be called when the cluster leader may have changed. Returns a unique ID for the
|
|
// listener which can later be used to remove it. If clustering is not enabled in this build, the callback will never
|
|
// be called.
|
|
func (s *Server) AddClusterLeaderChangedListener(listener func()) string {
|
|
return s.platform.AddClusterLeaderChangedListener(listener)
|
|
}
|
|
|
|
// Removes a listener function by the unique ID returned when AddConfigListener was called
|
|
func (s *Server) RemoveClusterLeaderChangedListener(id string) {
|
|
s.platform.RemoveClusterLeaderChangedListener(id)
|
|
}
|
|
|
|
func (s *Server) InvokeClusterLeaderChangedListeners() {
|
|
s.platform.InvokeClusterLeaderChangedListeners()
|
|
}
|