Skip to content

Commit ed7f582

Browse files
committed
chore: upgrade go-zero
1 parent cef2161 commit ed7f582

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ Upstreams:
99
Key: hello.rpc
1010
# protoset mode
1111
ProtoSet: hello.pb
12+
# Mapping is optional, auto mapping from annotations (google.api.http)
1213
Mapping:
1314
- Method: get
1415
Path: /pingHello/:ping
15-
Rpc: hello.Hello/Ping
16+
RpcPath: hello.Hello/Ping
1617
- Grpc:
1718
Endpoints:
1819
- localhost:8081
@@ -21,4 +22,4 @@ Upstreams:
2122
Mapping:
2223
- Method: post
2324
Path: /pingWorld
24-
Rpc: world.World/Ping
25+
RpcPath: world.World/Ping

gateway.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@ package main
22

33
import (
44
"flag"
5+
"fmt"
56

67
"github.com/zeromicro/go-zero/core/conf"
7-
"github.com/zeromicro/go-zero/core/logx"
88
"github.com/zeromicro/go-zero/gateway"
99
)
1010

1111
var configFile = flag.String("f", "config.yaml", "config file")
1212

1313
func main() {
1414
flag.Parse()
15-
logx.DisableStat()
1615

1716
var c gateway.GatewayConf
1817
conf.MustLoad(*configFile, &c)
1918
gw := gateway.MustNewServer(c)
2019
defer gw.Stop()
20+
21+
fmt.Printf("gateway is started at %s:%d...\n", c.Host, c.Port)
2122
gw.Start()
2223
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/kevwan/gateway
22

33
go 1.18
44

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
66

77
require (
88
github.com/beorn7/perks v1.0.1 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJB
442442
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
443443
github.com/zeromicro/go-zero v1.3.6-0.20220716154053-b206dd28a3b8 h1:YQcF2azWmpoCDeDrNEYeN6bF6PDCxSecNnUsddN0x9s=
444444
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=
445447
go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc=
446448
go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
447449
go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg=

readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ Upstreams:
2424
Key: hello.rpc
2525
# protoset mode
2626
ProtoSet: hello.pb
27+
# Mapping is optional, auto mapping from annotations (google.api.http)
2728
Mapping:
2829
- Method: get
2930
Path: /pingHello/:ping
30-
Rpc: hello.Hello/Ping
31+
RpcPath: hello.Hello/Ping
3132
- Grpc:
3233
Endpoints:
3334
- localhost:8081
@@ -36,7 +37,7 @@ Upstreams:
3637
Mapping:
3738
- Method: post
3839
Path: /pingWorld
39-
Rpc: world.World/Ping
40+
RpcPath: world.World/Ping
4041
```
4142
4243
## Run the gateway

0 commit comments

Comments
 (0)