Skip to content

Commit ac2716a

Browse files
committed
lorca version
1 parent ae73e45 commit ac2716a

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ require (
2323
github.com/smartystreets/goconvey v1.6.4 // indirect
2424
github.com/t-tomalak/logrus-easy-formatter v0.0.0-20190827215021-c074f06c5816
2525
github.com/ugorji/go v1.2.6 // indirect
26+
github.com/zserge/lorca v0.1.10
2627
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
2728
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
2829
golang.org/x/text v0.3.6 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn
109109
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
110110
github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ=
111111
github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw=
112+
github.com/zserge/lorca v0.1.10 h1:f/xBJ3D3ipcVRCcvN8XqZnpoKcOXV8I4vwqlFyw7ruc=
113+
github.com/zserge/lorca v0.1.10/go.mod h1:bVmnIbIRlOcoV285KIRSe4bUABKi7R7384Ycuum6e4A=
112114
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
113115
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
114116
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
@@ -122,6 +124,8 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r
122124
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
123125
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
124126
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
127+
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
128+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
125129
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
126130
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
127131
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

pkg/gmc/gmc.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ func Start() {
9898

9999
CreateBotIfParamExist() // 如果环境变量存在,使用环境变量创建机器人 UIN PASSWORD
100100
InitGin() // 初始化GIN HTTP管理
101-
102-
select {}
103101
}
104102

105103
func LoadGmcConfigFile(filePath string) {

service/gmc/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ import "github.com/ProtobufBot/Go-Mirai-Client/pkg/gmc"
44

55
func main() {
66
gmc.Start()
7+
select {}
78
}

service/gmc_lorca/main.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/ProtobufBot/Go-Mirai-Client/pkg/config"
7+
"github.com/ProtobufBot/Go-Mirai-Client/pkg/gmc"
8+
"github.com/ProtobufBot/Go-Mirai-Client/pkg/util"
9+
10+
log "github.com/sirupsen/logrus"
11+
"github.com/zserge/lorca"
12+
)
13+
14+
func main() {
15+
gmc.Start()
16+
ui, err := lorca.New(fmt.Sprintf("http://localhost:%s", config.Port), "", 1024, 768)
17+
if err != nil {
18+
util.FatalError(err)
19+
return
20+
}
21+
defer ui.Close()
22+
<-ui.Done()
23+
log.Info("UI exit.")
24+
}

0 commit comments

Comments
 (0)