File tree Expand file tree Collapse file tree 5 files changed +12
-7
lines changed Expand file tree Collapse file tree 5 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ Upstreams:
9
9
Key : hello.rpc
10
10
# protoset mode
11
11
ProtoSet : hello.pb
12
+ # Mapping is optional, auto mapping from annotations (google.api.http)
12
13
Mapping :
13
14
- Method : get
14
15
Path : /pingHello/:ping
15
- Rpc : hello.Hello/Ping
16
+ RpcPath : hello.Hello/Ping
16
17
- Grpc :
17
18
Endpoints :
18
19
- localhost:8081
@@ -21,4 +22,4 @@ Upstreams:
21
22
Mapping :
22
23
- Method : post
23
24
Path : /pingWorld
24
- Rpc : world.World/Ping
25
+ RpcPath : world.World/Ping
Original file line number Diff line number Diff line change @@ -2,21 +2,22 @@ package main
2
2
3
3
import (
4
4
"flag"
5
+ "fmt"
5
6
6
7
"github.com/zeromicro/go-zero/core/conf"
7
- "github.com/zeromicro/go-zero/core/logx"
8
8
"github.com/zeromicro/go-zero/gateway"
9
9
)
10
10
11
11
var configFile = flag .String ("f" , "config.yaml" , "config file" )
12
12
13
13
func main () {
14
14
flag .Parse ()
15
- logx .DisableStat ()
16
15
17
16
var c gateway.GatewayConf
18
17
conf .MustLoad (* configFile , & c )
19
18
gw := gateway .MustNewServer (c )
20
19
defer gw .Stop ()
20
+
21
+ fmt .Printf ("gateway is started at %s:%d...\n " , c .Host , c .Port )
21
22
gw .Start ()
22
23
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ module github.com/kevwan/gateway
2
2
3
3
go 1.18
4
4
5
- require github.com/zeromicro/go-zero v1.3.6-0.20220716154053-b206dd28a3b8
5
+ require github.com/zeromicro/go-zero v1.3.6-0.20220717152119-8d567b550833
6
6
7
7
require (
8
8
github.com/beorn7/perks v1.0.1 // indirect
Original file line number Diff line number Diff line change @@ -442,6 +442,8 @@ github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJB
442
442
github.com/yusufpapurcu/wmi v1.2.2 /go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0 =
443
443
github.com/zeromicro/go-zero v1.3.6-0.20220716154053-b206dd28a3b8 h1:YQcF2azWmpoCDeDrNEYeN6bF6PDCxSecNnUsddN0x9s =
444
444
github.com/zeromicro/go-zero v1.3.6-0.20220716154053-b206dd28a3b8 /go.mod h1:76TOEKE3Xe6cvoxorFnOiTCTWu0sSs4oGbxwwIM08Ug =
445
+ github.com/zeromicro/go-zero v1.3.6-0.20220717152119-8d567b550833 h1:knyakl2S4auaFlDYLOfeyeK82hwkmcQs2RQo9OQVXik =
446
+ github.com/zeromicro/go-zero v1.3.6-0.20220717152119-8d567b550833 /go.mod h1:76TOEKE3Xe6cvoxorFnOiTCTWu0sSs4oGbxwwIM08Ug =
445
447
go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc =
446
448
go.etcd.io/etcd/api/v3 v3.5.4 /go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A =
447
449
go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg =
Original file line number Diff line number Diff line change @@ -24,10 +24,11 @@ Upstreams:
24
24
Key : hello.rpc
25
25
# protoset mode
26
26
ProtoSet : hello.pb
27
+ # Mapping is optional, auto mapping from annotations (google.api.http)
27
28
Mapping :
28
29
- Method : get
29
30
Path : /pingHello/:ping
30
- Rpc : hello.Hello/Ping
31
+ RpcPath : hello.Hello/Ping
31
32
- Grpc :
32
33
Endpoints :
33
34
- localhost:8081
@@ -36,7 +37,7 @@ Upstreams:
36
37
Mapping :
37
38
- Method : post
38
39
Path : /pingWorld
39
- Rpc : world.World/Ping
40
+ RpcPath : world.World/Ping
40
41
` ` `
41
42
42
43
## Run the gateway
You can’t perform that action at this time.
0 commit comments