-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathplugin.go
38 lines (27 loc) · 919 Bytes
/
plugin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"sync"
"github.com/gorilla/mux"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/public/plugin"
"github.com/mattermost/mattermost/server/public/pluginapi"
"github.com/mattermost/mattermost/server/public/pluginapi/cluster"
root "github.com/mattermost/mattermost-plugin-demo"
)
var (
manifest model.Manifest = root.Manifest
)
type Plugin struct {
plugin.MattermostPlugin
client *pluginapi.Client
// configurationLock synchronizes access to the configuration.
configurationLock sync.RWMutex
// configuration is the active plugin configuration. Consult getConfiguration and
// setConfiguration for usage.
configuration *configuration
router *mux.Router
// BotId of the created bot account.
botID string
// backgroundJob is a job that executes periodically on only one plugin instance at a time
backgroundJob *cluster.Job
}