-
Notifications
You must be signed in to change notification settings - Fork 5
/
root.go
39 lines (31 loc) · 788 Bytes
/
root.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
39
package root
import (
"embed" // Need to embed manifest file
"encoding/json"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-plugin-apps/apps"
)
// pluginManifestData is preloaded with the plugin manifest.
//
//go:embed plugin.json
var pluginManifestData []byte
// appManifestData is preloaded with the Mattermost App manifest.
//
//go:embed manifest.json
var appManifestData []byte
// Static is preloaded with the contents of the ./static directory.
//
//go:embed static
var Static embed.FS
var Manifest model.Manifest
var AppManifest apps.Manifest
func init() {
err := json.Unmarshal(pluginManifestData, &Manifest)
if err != nil {
panic(err)
}
err = json.Unmarshal(appManifestData, &AppManifest)
if err != nil {
panic(err)
}
}