-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (36 loc) · 867 Bytes
/
main.go
File metadata and controls
46 lines (36 loc) · 867 Bytes
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
40
41
42
43
44
45
46
package iot_master
import (
"embed"
"encoding/json"
_ "github.com/busy-cloud/boat-ui"
"github.com/busy-cloud/boat/apps"
"github.com/busy-cloud/boat/log"
"github.com/busy-cloud/boat/store"
"github.com/god-jason/iot-master/iot"
_ "github.com/god-jason/iot-master/iot"
)
//go:embed assets
var assets embed.FS
//go:embed pages
var pages embed.FS
//go:embed tables
var tables embed.FS
//go:embed protocols
var protocols embed.FS
//go:embed manifest.json
var manifest []byte
func init() {
//注册为内部插件
var a apps.App
err := json.Unmarshal(manifest, &a)
if err != nil {
log.Fatal(err)
}
apps.Register(&a)
//注册资源
a.AssetsFS = store.PrefixFS(&assets, "assets")
a.PagesFS = store.PrefixFS(&pages, "pages")
a.TablesFS = store.PrefixFS(&tables, "tables")
//加载协议
iot.Protocols = store.PrefixFS(&protocols, "protocols")
}