File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 - name : Setup web
4141 run : |
4242 go get github.com/jeessy2/ddns-go/v6
43+ go get github.com/OpenIoTHub/gateway-go/v2
4344 bash build.sh dev web
4445 env :
4546 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -113,6 +114,7 @@ jobs:
113114 - name : Setup web
114115 run : |
115116 go get github.com/jeessy2/ddns-go/v6
117+ go get github.com/OpenIoTHub/gateway-go/v2
116118 bash build.sh dev web
117119 env :
118120 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 2222 - name : Setup web
2323 run : |
2424 go get github.com/jeessy2/ddns-go/v6
25+ go get github.com/OpenIoTHub/gateway-go/v2
2526 bash build.sh dev web
2627 env :
2728 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5960 build/linux/libmobile_arm64.so
6061 build/windows/mobile_amd64.dll
6162 gomobile-libs-android :
62- needs : linux-android-windows-libs
63+ # needs: linux-android-windows-libs
6364 runs-on : macos-latest
6465 steps :
6566 - name : Checkout
7374 - name : Setup web
7475 run : |
7576 go get github.com/jeessy2/ddns-go/v6
77+ go get github.com/OpenIoTHub/gateway-go/v2
7678 bash build.sh dev web
7779 env :
7880 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -80,6 +80,20 @@ func RunAPIServer() {
8080 "message" : "success" ,
8181 })
8282 })
83+ r .GET ("/start-ddns-go" , func (c * gin.Context ) {
84+ runDdnsGo ()
85+ c .JSON (http .StatusOK , gin.H {
86+ "code" : 0 ,
87+ "message" : "success" ,
88+ })
89+ })
90+ r .GET ("/start-gateway-go" , func (c * gin.Context ) {
91+ runGatewayGO ()
92+ c .JSON (http .StatusOK , gin.H {
93+ "code" : 0 ,
94+ "message" : "success" ,
95+ })
96+ })
8397 err := r .Run ("0.0.0.0:15244" )
8498 if err != nil {
8599 log .Println (err .Error ())
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ var staticEmbeddedFiles embed.FS
2222//go:embed favicon.ico
2323var faviconEmbeddedFile embed.FS
2424
25+ // 默认开启
2526func init () {
26- go run ()
27+ go runDdnsGo ()
2728}
2829
29- func run () {
30+ func runDdnsGo () {
31+ log .Println ("Start ddns-go service" )
3032 // 兼容之前的配置文件
3133 conf , _ := config .GetConfigCached ()
3234 conf .CompatibleConfig ()
Original file line number Diff line number Diff line change 1+ package mobile
2+
3+ import (
4+ "github.com/OpenIoTHub/gateway-go/v2/client"
5+ "github.com/OpenIoTHub/gateway-go/v2/register"
6+ "log"
7+ "net"
8+ )
9+
10+ //只可以由用户开启
11+ //func init() {
12+ // runGatewayGO()
13+ //}
14+
15+ func runGatewayGO () {
16+ log .Println ("Start gateway-go service" )
17+ register .RegisterService ("localhost" ,
18+ "gateway-go" ,
19+ "_http._tcp" ,
20+ "localhost" ,
21+ 5244 ,
22+ []string {},
23+ 0 ,
24+ []net.IP {net .ParseIP ("127.0.0.1" )},
25+ []net.IP {},
26+ )
27+ client .Run ()
28+ }
You can’t perform that action at this time.
0 commit comments